Use of openAi assistant with @ai-sdk/openai
#1851
-
Do you know if the openAi assistant can (or will can ?) be used with In the example given in the doc, Maybe I'm missing something, but is it mandatory to use the openai library to use the assistant API ? Thanks for you help |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can use OpenAI Assistants with |
Beta Was this translation helpful? Give feedback.
-
and hooks
Regarding So you're right that you don't have to use |
Beta Was this translation helpful? Give feedback.
@ai-sdk/openai
can be only be used with the following core functionsgenerateText
streamText
generateObject
streamObject
embed
and hooks
useChat
useCompletion
Regarding
useAssistant
, it is a hook that abstracts only OpenAI's assistant endpoints, and does not use the core functions. That's why the examples explicitly use theopenai
library instead os@ai-sdk/openai
.So you're right that you don't have to use
@ai-sdk/openai
provider, you will need to import the actualopenai
library instead.