Skip to content

Commit 5e062b4

Browse files
authored
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
1 parent 4906cba commit 5e062b4

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

core/http/endpoints/anthropic/messages.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ func convertAnthropicTools(input *schema.AnthropicRequest, cfg *config.ModelConf
880880
if tcType, ok := tc["type"].(string); ok && tcType == "tool" {
881881
if name, ok := tc["name"].(string); ok {
882882
// Force specific tool
883-
cfg.SetFunctionCallString(name)
883+
cfg.SetFunctionCallNameString(name)
884884
}
885885
}
886886
}

core/http/endpoints/openai/realtime_model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (m *wrappedModel) Predict(ctx context.Context, messages schema.Messages, im
168168
}
169169
} else if toolChoice.Function != nil {
170170
// Specific function specified
171-
m.LLMConfig.SetFunctionCallString(toolChoice.Function.Name)
171+
m.LLMConfig.SetFunctionCallNameString(toolChoice.Function.Name)
172172
}
173173
}
174174

core/http/endpoints/openresponses/responses.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ func convertORToolsToFunctions(input *schema.OpenResponsesRequest, cfg *config.M
773773
case map[string]any:
774774
if tcType, ok := tc["type"].(string); ok && tcType == "function" {
775775
if name, ok := tc["name"].(string); ok {
776-
cfg.SetFunctionCallString(name)
776+
cfg.SetFunctionCallNameString(name)
777777
}
778778
}
779779
}

0 commit comments

Comments
 (0)