-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Thread and Message for Assistant v2 #735
Comments
There are more changes, because the |
In the new version, seems like |
A workaround for now is to use a custom config to set the version: config := openai.DefaultConfig(key)
config.AssistantVersion = "v2"
return openai.NewClientWithConfig(config) |
Was working on a pull request for this but don't know how to handle content being either a string or array in Go. |
@sashabaranov thoughts? |
https://github.com/sashabaranov/go-openai/releases/tag/v1.26.0 contains assistant API v2 by default |
@sashabaranov It's still missing attachments and content being a string or object. |
@dezchai we're open for your contributions to add those! 🥰 |
@sashabaranov Sounds good, but I'm new to Go and am not sure how content being a string or array* in https://platform.openai.com/docs/api-reference/runs/createThreadAndRun |
@dezchai there are a couple of ways we can go here:
UPD: note that with the first approach you'll get |
Is your feature request related to a problem? Please describe.
OpenAI has released their new version of assistant(v2) and the old version of assistant(v1) will be deprecated by the end of 2024. There are some incompatibilities between the two version in terms of API request body.
For example,
MessageRequest
in v1MessageRequest
in v2, which introducedattachments
We let the user configure the assistant version in the client configuration but the new assistant version will cause trouble at runtime when making calls to Thread and Message.
Describe the solution you'd like
Support both assistant v1 and v2.
Additional context
There are different implementations I can think of that could make the enhancement, but most likely the compatibility will be checked at runtime. Would be good to see an implementation to support both assistant versions and check errors at compile time while maintaining the configured
assistantVersion
.The text was updated successfully, but these errors were encountered: