Closed pkosiec closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.68%. Comparing base (
774fc9d
) to head (9b434df
). Report is 19 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@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!
Thank you @sashabaranov, let me add the field ASAP 👍
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!
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 https://github.com/sashabaranov/go-openai/issues/759