Skip to content
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

fix: when no Assistant Tools are specified, an empty list should be sent #669

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

guillaume-dussault
Copy link
Contributor

Describe the change
Currently, it is not possible to remove all tools when modifying an assistant because the field will be omitted if empty. With this change, it will now be possible.

Provide OpenAI documentation link
https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-tools

Describe your solution
When creating or modifying an assistant, an empty list of tools will be sent instead of omitting the field.

Tests

  • Created an assistant with no tools
  • Created an assistant with tools
  • Updated an assistant with tools to remove all tools
  • Updated an assistant with tools to remove some tools
  • Updated an assistant without tools to add some tools
  • Ran unit tests

Otherwhise, when updating an assistant that already has tools,
if the list is omitted, no changes will be made and the tools will
set.
Copy link
Owner

@sashabaranov sashabaranov left a 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!

@sashabaranov sashabaranov merged commit 4103778 into sashabaranov:master Feb 26, 2024
1 check passed
grulex pushed a commit to grulex/go-openai that referenced this pull request Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants