-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[BREAKING_CHANGES] fix: support ThreadMessage.Content as an array #821
base: master
Are you sure you want to change the base?
[BREAKING_CHANGES] fix: support ThreadMessage.Content as an array #821
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #821 +/- ##
==========================================
+ Coverage 98.46% 99.01% +0.55%
==========================================
Files 24 26 +2
Lines 1364 1418 +54
==========================================
+ Hits 1343 1404 +61
+ Misses 15 8 -7
Partials 6 6 ☔ View full report in Codecov by Sentry. |
Attachments []ThreadAttachment `json:"attachments,omitempty"` | ||
Metadata map[string]any `json:"metadata,omitempty"` | ||
Role ThreadMessageRole `json:"role"` | ||
Content []ThreadMessageContent `json:"content"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thank you for the PR!
The documentation says it is either a string
or array
: https://platform.openai.com/docs/api-reference/messages/createMessage#messages-createmessage-content
So I think we need a new type here that supports proper marshalling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we send an array of one with text: { ... }
instead of a new type?
FileIDs on ThreadMessage isn't supported anymore, but Content can be an array. Fixes: sashabaranov#773
aa77be8
to
d6c7739
Compare
Hi, guys. |
Describe the change
FileIDs on ThreadMessage isn't supported anymore, but Content can be an array.
Provide OpenAI documentation link
https://platform.openai.com/docs/api-reference/threads/createThread
Describe your solution
Remove old fields and update existing ones to support current OpenAI endpoints.
Tests
I've verified this allows me to upload an image and prompt in a thread (ran under an assistant).
Here's the snippet of code that creates the thread.
Fixes: #773