#What API to use for story telling and acting

1 messages · Page 1 of 1 (latest)

craggy quarry
#

I am writing an application where I will use OpenAI to act like a medieval ruler which has a set of traits that influence its personality. I will feed events that happen and I want the AI to respond to the situation while acting as the ruler.

I know there is the Chat API that I can use, but I also noticed there is an Assistant endpoint. Which one would be best suited for the task.
What about the costs, is there a big difference?

sonic glenBOT
#

Hi @craggy quarry. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

For your application, both the Chat API and the Assistants API could be used, but they offer different features and capabilities.

The Chat API, part of the GPT series, is a powerful tool for generating language responses. It's stateless, meaning you have to manage conversation state, tool definitions, retrieval documents, and code execution manually. It's a good choice if you want a lightweight and flexible solution, and you're comfortable managing the state of the conversation yourself (source (https://cookbook.openai.com/examples/assistants_api_overview_python)).

On the other hand, the Assistants API is a stateful evolution of the Chat API. It simplifies the creation of assistant-like experiences and enables developer access to powerful tools like Code Interpreter and Retrieval. The primitives of the Assistants API are Assistants, Threads, and Runs. Assistants encapsulate a base model, instructions, tools, and (context) documents. Threads represent the state of a conversation, and Runs power the execution of an Assistant on a Thread, including textual responses and multi-step tool use (source (https://cookbook.openai.com/examples/assistants_api_overview_python)). Assistants are designed to be created by developers using the OpenAI API and can leverage models, tools, and knowledge to respond to user queries (source (https://help.openai.com/en/articles/8673914-gpts-vs-assistants#h_5740051b75)).

As for the costs, the pricing for the Chat API (GPTs) and the Assistants API is different. GPTs are included in ChatGPT on Plus/Team/Enterprise plans, while the Assistants API is billed based on the usage of different Assistant features (source (https://help.openai.com/en/articles/8673914-gpts-vs-assistants#h_7569ffca53)).

#

In conclusion, if you want more control and are comfortable managing the state of the conversation yourself, the Chat API might be a better choice. If you want a more stateful experience and access to powerful tools, the Assistants API might be more suitable. You should also consider the pricing differences when making your decision.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@craggy quarry kapa.ai is still learning and improving, please let us know how it did by reacting below

craggy quarry
#

@sonic glen Can you tell me a bit more about the pricing differences?

sonic glenBOT
#

Let me check the knowledge base for you. One moment! :books:

#

Sure, I can provide some information on the pricing differences based on the knowledge sources provided.

For the GPT-4 model, the pricing is as follows:

  • For models with 128k context lengths (e.g., gpt-4-turbo), the price is $10.00 per 1 million prompt tokens (or $0.01 per 1K prompt tokens) and $30.00 per 1 million sampled tokens (or $0.03 per 1K sampled tokens).
  • For models with 8k context lengths (e.g., gpt-4 and gpt-4-0314), the price is $30.00 per 1 million prompt tokens (or $0.03 per 1K prompt tokens) and $60.00 per 1 million sampled tokens (or $0.06 per 1K sampled tokens).
  • For models with 32k context lengths (e.g., gpt-4-32k and gpt-4-32k-0314), the price is $60.00 per 1 million prompt tokens (or $0.06 per 1K prompt tokens) and $120.00 per 1 million sampled tokens (or $0.12 per 1K sampled tokens) (source (https://help.openai.com/en/articles/7127956-how-much-does-gpt-4-cost)).

As for the Assistants API, it is billed based on the usage of different Assistant features. However, the exact pricing details for the Assistants API are not provided in the knowledge sources. You can find more detailed information on the OpenAI Pricing page (source (https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them#h_4f7e925c57)).

Please note that the actual costs may vary depending on the specific usage and the number of tokens processed by the models. It's also important to note that the number of tokens in an API call affects the cost, the time it takes, and whether the call works at all based on the maximum limit of tokens for a model.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: