Skip to content

Difference between useChat and useAssistant? #920

Closed Answered by jeremyphilemon
mosnicholas asked this question in Help
Discussion options

You must be logged in to vote

Both the hooks are similar in their use, but are different in how they work. Your preference will vary based on the following differences.

useChat

  • uses a chat.completion like endpoint, see streamText
  • supports various providers
  • you have to use callbacks to persist messages in your database
  • tools, model, and system prompts are defined in your route handler

useAssistant

  • uses a assistants.create endpoint
  • current only supports OpenAI
  • the messages are automatically stored in a database by OpenAI
  • tools, model, and system prompts are defined in OpenAI's assistant dashboard

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jeremyphilemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants