-
-
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
Support Tool Resources properties for Threads #760
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #760 +/- ##
==========================================
+ Coverage 98.46% 98.68% +0.22%
==========================================
Files 24 24
Lines 1364 1140 -224
==========================================
- Hits 1343 1125 -218
+ Misses 15 9 -6
Partials 6 6 ☔ View full report in Codecov by Sentry. |
@pkosiec Hello! Could you provide an example of how you use this? I tried to substitute a vector store in the request and am getting an error, would like to take a look at your version of using this |
Hey @temamagic, this is how I used it: return i.openaiClient.CreateThread(ctx, openai.ThreadRequest{
Metadata: map[string]any{
// ...
},
ToolResources: openai.ToolResourcesRequest{
FileSearch: &openai.FileSearchToolResourcesRequest{
VectorStoreIDs: []string{
"{customVectorStoreID}",
},
},
},
Messages: []openai.ThreadMessage{
{
Role: openai.ThreadMessageRoleUser,
Content: "prompt",
},
},
}) Hope that helps! |
thread.go
Outdated
|
||
type VectorStoreToolResources struct { | ||
FileIDs []string `json:"file_ids,omitempty"` | ||
Metadata map[string]any `json:"metadata,omitempty"` |
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.
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.
Thank you for the PR! I've added a minor comment — we either can add an additional field or just merge as is!
Thank you @sashabaranov, let me add the field ASAP 👍 |
@sashabaranov Done: 9b434df |
In my case, it helped to set the agents version to 2 after initializing the client, but thanks! |
@temamagic Ah yes, forgot to mention that, sorry. Glad you figured it out! |
Describe the change
Support Tool Resources properties for Threads.
Provide OpenAI documentation link
Describe your solution
Describe how your changes address the problem or how they add the feature. This should include a brief description of your approach and any new libraries or dependencies you're using.
Tests
I've manually tested the functionality when using the library in the project I'm working on.
Additional context
Resolves #759