Feed GPT more unstructured data

Hello,

after a couple of hours reading the developer docs of openai I still can’t really answer if I can fulfill this use case with openai tooling:

I want a custom GPT which I can feed lots of tokens loosely structured context, like a knowledge base on top of the chatgpt model.

What I did manage to do is to dump a ton of context in a conversation by doing this:

client.chat.completions.create(
        model="gpt-4-turbo-preview",
        messages=[
            {
                "role": "system",
                "content": "You are a virtual knowledge-base assistant, you answer questions and give instructions"
                "based on this given content:\n" + context,
            },
            {
                "role": "user",
                "content": prompt,
            },
        ],
    )

ChatGPT will be able to give proper answers taking the newly given context into account.

So what I am searching now is an api where i can create a custom gpt by feeding it context like this (via API). I looked at assistants and fine-tuned models but while assistants seems to be enabling me to attach third-party applications, fine-tuned models rely on well structured prompt-answer training data neither of which reflect my use case.

Any hint whether this is possible or not is well appreciated.

Best regards,

l0rn

Welcome to the community!

It’s not super clear to me what you want to do :grimacing:

It’s confusing because people often conflate chatgpt with the API models - when you say chatgpt and custom gpt, do you mean the actual chat.openai.com chatgpt?

none of the stuff from platform.openai.com (the API), like fine tuning, assistants, chat completions, etc works with the chat.openai.com stuff.

So here are the options:

  • chat.openai.com
    • custom gpt, comes with a UI, usage doesn’t cost you, accessible only to gpt+ users
      • add all your stuff to the instructions (fast but limited to 8000 characters)
      • upload additional knowledge in the form of document uploads (slower, but more stuff, but little control over what gets used)
      • create a custom action that allows the model to pull information into the chat (slower, requires external db)
  • platform.openai.com
    • assistants, doesn’t come with a UI, you pay for what your users use, you control user access
      • add stuff to the instructions (fast, but rigid)
      • add files for retrieval (same as chatgpt knowledge)
      • create a tool that retrieves stuff contextually from an external db. (same as custom gpt actions)
    • chat completions, doesn’t manage conversations for you
      • add stuff to the prompt statically (as you did in your demo, fast, limited to max tokens)
      • add stuff to the prompt dynamically (with an embedding vector db for example, can be very fast)

Could you clarify your terminology?

In case you meant what you said, I would try uploading your data as a knowledge file and see how far you can get with that.

2 Likes

Ok, sorry for mixing up terminology. I guess I just want a bot that i can Feed knowledge incrementially, only via API no Frontend needed. I think the hot Tip in your answer is the knowledge File for the Assistant API. I somehow missed this in my first read.

Thanks!

3 Likes