From 5e062b4d1fc528364b35ea833a563d22cce0bf35 Mon Sep 17 00:00:00 2001 From: Tai An Date: Fri, 24 Apr 2026 00:06:42 -0700 Subject: [PATCH] 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 --- core/http/endpoints/anthropic/messages.go | 2 +- core/http/endpoints/openai/realtime_model.go | 2 +- core/http/endpoints/openresponses/responses.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/http/endpoints/anthropic/messages.go b/core/http/endpoints/anthropic/messages.go index 2f20e945e..62e58a4a1 100644 --- a/core/http/endpoints/anthropic/messages.go +++ b/core/http/endpoints/anthropic/messages.go @@ -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) } } } diff --git a/core/http/endpoints/openai/realtime_model.go b/core/http/endpoints/openai/realtime_model.go index 5c516aae3..dd9baf1b7 100644 --- a/core/http/endpoints/openai/realtime_model.go +++ b/core/http/endpoints/openai/realtime_model.go @@ -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) } } diff --git a/core/http/endpoints/openresponses/responses.go b/core/http/endpoints/openresponses/responses.go index dea6ffa21..7d051b5d7 100644 --- a/core/http/endpoints/openresponses/responses.go +++ b/core/http/endpoints/openresponses/responses.go @@ -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) } } }