Fix Bedrock ToolChoiceNone still sending tool definitions
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -74,9 +74,8 @@ func (p *Provider) ChatCompletionStream(ctx context.Context, req *llm.ChatComple
|
|||||||
input.System = system
|
input.System = system
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(req.Tools) > 0 {
|
if len(req.Tools) > 0 && (req.ToolChoice == nil || req.ToolChoice.Type != llm.ToolChoiceNone) {
|
||||||
toolConfig := buildToolConfig(req)
|
input.ToolConfig = buildToolConfig(req)
|
||||||
input.ToolConfig = toolConfig
|
|
||||||
}
|
}
|
||||||
|
|
||||||
output, err := p.client.ConverseStream(ctx, input)
|
output, err := p.client.ConverseStream(ctx, input)
|
||||||
@@ -99,9 +98,8 @@ func buildInput(req *llm.ChatCompletionRequest) *bedrockruntime.ConverseInput {
|
|||||||
input.System = system
|
input.System = system
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(req.Tools) > 0 {
|
if len(req.Tools) > 0 && (req.ToolChoice == nil || req.ToolChoice.Type != llm.ToolChoiceNone) {
|
||||||
toolConfig := buildToolConfig(req)
|
input.ToolConfig = buildToolConfig(req)
|
||||||
input.ToolConfig = toolConfig
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return input
|
return input
|
||||||
|
|||||||
Reference in New Issue
Block a user