Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Conversation

@SamSaffron
Copy link
Member

@SamSaffron SamSaffron commented Mar 24, 2025

This PR adds support for disabling further tool calls by setting tool_choice to :none across all supported LLM providers:

  • OpenAI: Uses "none" tool_choice parameter
  • Anthropic: Uses {type: "none"} and adds a prefill message to prevent confusion
  • Gemini: Sets function_calling_config mode to "NONE"
  • AWS Bedrock: Doesn't natively support tool disabling, so adds a prefill message

We previously used to disable tool calls by simply removing tool definitions, but this would cause errors with some providers. This implementation uses the supported method appropriate for each provider while providing a fallback for Bedrock.

end
end

puts "tool_choice: #{payload[:tool_choice]} - #{dialect.tool_choice}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope leftover ... oops ... will clean up

@SamSaffron
Copy link
Member Author

thanks @nattsw

@SamSaffron SamSaffron changed the title tool use none FEATURE: allow specifying tool use none in completion prompt Mar 24, 2025
@SamSaffron SamSaffron merged commit 1dde82e into main Mar 24, 2025
6 checks passed
@SamSaffron SamSaffron deleted the tool_use_none branch March 24, 2025 21:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants