-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Add tool_choice
parameter to OpenAI specification for tool control
#138
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
Conversation
WalkthroughThe pull request introduces a new Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
tool_choice
parameter to OpenAI specification for tool control
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/libs/Cohere/openapi.yaml (1)
870-876
: Well-structured parameter definition with comprehensive documentation!The
tool_choice
parameter is well-defined with clear enum values and excellent documentation that covers:
- Behavior of each option
- Default behavior
- Model compatibility
- Cross-reference to similar functionality
Consider adding usage examples to the documentation
To further enhance the documentation, consider adding example requests/responses for each
tool_choice
value. This would help developers better understand the practical implications of each option.Example documentation addition:
description: "Used to control whether or not the model will be forced to use a tool when answering. When `REQUIRED` is specified, the model will be forced to use at least one of the user-defined tools, and the `tools` parameter must be passed in the request.\nWhen `NONE` is specified, the model will be forced **not** to use one of the specified tools, and give a direct response.\nIf tool_choice isn't specified, then the model is free to choose whether to use the specified tools or not.\n\n**Note**: This parameter is only compatible with models [Command-r7b-12-2024](https://docs.cohere.com/v2/docs/command-r7b) and newer.\n\n**Note**: The same functionality can be achieved in `/v1/chat` using the `force_single_step` parameter. If `force_single_step=true`, this is equivalent to specifying `REQUIRED`. While if `force_single_step=true` and `tool_results` are passed, this is equivalent to specifying `NONE`.\n" + examples: + - value: "REQUIRED" + description: "Forces the model to use at least one tool" + - value: "NONE" + description: "Forces the model to provide a direct response without tools"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (8)
src/libs/Cohere/Generated/Cohere.CohereApi.Chatv2.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.ICohereApi.Chatv2.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.Chatv2Request.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.Chatv2RequestToolChoice.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonConverters.Chatv2RequestToolChoice.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonConverters.Chatv2RequestToolChoiceNullable.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonSerializerContext.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonSerializerContextTypes.g.cs
is excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Cohere/openapi.yaml
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test / Build, test and publish
Summary by CodeRabbit
tool_choice
parameter to control AI tool usage in the API specification