mirror of
https://github.com/mudler/LocalAI
synced 2026-05-24 09:28:23 +00:00
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:
parent
4906cbad04
commit
5e062b4d1f
3 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue