fix: use SetFunctionCallNameString when forcing a specific tool (3 sites) (#9526)

* fix(anthropic): use SetFunctionCallNameString for specific tool forcing

* fix(openai/realtime): use SetFunctionCallNameString for specific tool forcing

* fix(openresponses): use SetFunctionCallNameString for specific tool forcing
This commit is contained in:
Tai An
2026-04-24 00:06:42 -07:00
committed by GitHub
parent 4906cbad04
commit 5e062b4d1f
3 changed files with 3 additions and 3 deletions

View File

@@ -880,7 +880,7 @@ func convertAnthropicTools(input *schema.AnthropicRequest, cfg *config.ModelConf
if tcType, ok := tc["type"].(string); ok && tcType == "tool" {
if name, ok := tc["name"].(string); ok {
// Force specific tool
cfg.SetFunctionCallString(name)
cfg.SetFunctionCallNameString(name)
}
}
}

View File

@@ -168,7 +168,7 @@ func (m *wrappedModel) Predict(ctx context.Context, messages schema.Messages, im
}
} else if toolChoice.Function != nil {
// Specific function specified
m.LLMConfig.SetFunctionCallString(toolChoice.Function.Name)
m.LLMConfig.SetFunctionCallNameString(toolChoice.Function.Name)
}
}

View File

@@ -773,7 +773,7 @@ func convertORToolsToFunctions(input *schema.OpenResponsesRequest, cfg *config.M
case map[string]any:
if tcType, ok := tc["type"].(string); ok && tcType == "function" {
if name, ok := tc["name"].(string); ok {
cfg.SetFunctionCallString(name)
cfg.SetFunctionCallNameString(name)
}
}
}