#Create a custom model with custom data

32 messages · Page 1 of 1 (latest)

ember granite
#

Hello,

I have a big database with products (more than 200000) and want to create a model that gives information about this products.
How can I do that, I use nodejs.

Thanks

stray galleon
#

Hard to advise on this without more details

#

Do you understand what the GPT API does?

#

Basic questions here are: Do you want a summary of all the products combined? Certain subsets of the entire set of products? A summary of each individual product? The solution would look very different for each of those

ember granite
#

Yes, I've used openai api.

I want to ask like, is this product on the list and return yes or no.
I want to ask what are the chips and return all the chips in the list.

stray galleon
#

Yeah that's something you could do with GPT for sure

#

Might be expensive, depending on how often you are doing this

ember granite
#

How can I do it?

#

I can pay it

stray galleon
#

Here's how I would do it if I were you: make up an arbitrary number of "categories" that you wish to search by. Then go through each item, and use GPT to categorize each item into your previously created categories. Save that in your database. Now, when someone asks "list all the X" (with X being a category), you can retrieve every item from your database with that category

#

You can additionally use GPT to prompt someone that is asking for items in a category - to determine which category they are interested in

#

This would mean you would make >200,000 calls to the GPT API, which would be a static cost, and then you would only pay for 1 GPT call every single time someone wants to retrieve items of the category. You could clump the calls together as well, if that helps at all.

ember granite
#

I already have the categories for each product

stray galleon
#

Okay, then just skip to the last step.

#

You may want to use GPT function calling? Depends on how your implementation works

ember granite
#

Whathever is better I'll take

stray galleon
#

You want to give GPT some sort of context like "You are determining which category the user is requesting. This is the list of categories: A, B, C, et cetera"

#

Add to the prompt as necessary, and do a lot of testing.

ember granite
#

Ok, I can do that with the normal api. But there is not way or isn't it good to make a fine tuned model?

ember granite
stray galleon
#

Try function calling

ember granite
#

Ok

ember granite
# stray galleon Try function calling

How will be the structure.
Lets say the user asks which chips are on the list, then what should I send to chatGPT I cant send all the data because is massive

stray galleon
#

You're not using the GPT api for that. You're going to use a search algorithm

#

You don't need to build that yourself, it's basic functionality in almost any programming language, there's definitely a library for it if it isn't in the standard one

#

a "find all" sort of thing

ember granite
#

Thanks

daring gazelle
#

If you need to iterate over a long list for search, that will be difficult

ember granite
#

What I did is used string similarity to get the best products and send them to chatgpt to get me more acurrate