https://www.boundaryml.com logo
🟡 Anthropic client tool use issue with BAMLValida...
# questions
s
If we set tool use to any (which means required):
Copy code
// Anthropic client configured for forced tool-use (tool_choice: any)
client<llm> CustomSonnet4ToolRequired {
  provider anthropic
  retry_policy Exponential
  options {
    model "claude-sonnet-4-20250514"
    api_key env.ANTHROPIC_API_KEY
    tool_choice "any"
  }
}
Anthropic doesn't return any text - it just returns the tool calls and also returns a BAMLValidationError so you have to parse the HTTP response. Any other way that I should be thinking about this that I'm missing?