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

Add enable_parallel_tool_calls to OpenAIModel #633

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

remigw
Copy link

@remigw remigw commented Jan 7, 2025

Implementation as per this comment: #169 (comment)

Fix #169

Remington Thurber and others added 2 commits January 7, 2025 14:56
@samuelcolvin samuelcolvin changed the title Fixes #169 Add enable_parallel_tool_calls to OpenAIModel Jan 7, 2025
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, but please can you add a test.

assert str(m.client.base_url) == 'https://api.openai.com/v1/'
assert m.client.api_key == 'foobar'
assert m.name() == 'openai:gpt-4'
assert m.enable_parallel_tool_calls is False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really test very much, we should check that that this changes the request made to OpenAI.

There are other tests in this file that should give you a hint as to what to do.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the OpenAIAgentModel._completions_create method is effectively untested because of the way MockOpenAI is constructed in the tests (i.e. overriding that method), so testing the passing of any kwargs to self.chat.completions.create (openai.py L193) would require changing/making a new mock class. Can you confirm if that is accurate?

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.

Unrecognized request argument supplied: parallel_tool_calls when using Azure Open AI client
2 participants