mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
fix: resolve doubao-seed-1.6-250615 model API 400 error with empty content
- Fix Tool message content issue when model returns empty content in function calling - Add content validation in callModelWithLogging to handle empty content in messages - Ensure compatibility between UI-TARS and function calling models This resolves the "missing messages.content parameter" error when using doubao-seed-1.6-250615 model compared to doubao-1.5-ui-tars-250328
This commit is contained in:
+9
-1
@@ -135,9 +135,17 @@ func (p *Planner) Plan(ctx context.Context, opts *PlanningOptions) (result *Plan
|
||||
for _, toolCall := range message.ToolCalls {
|
||||
toolCallID += toolCall.ID
|
||||
}
|
||||
|
||||
// Ensure content is not empty for Tool messages to avoid API 400 errors
|
||||
// Some models may return empty content when using function calling
|
||||
toolContent := message.Content
|
||||
if toolContent == "" {
|
||||
toolContent = "Function call initiated"
|
||||
}
|
||||
|
||||
p.history.Append(&schema.Message{
|
||||
Role: schema.Tool,
|
||||
Content: message.Content,
|
||||
Content: toolContent,
|
||||
ToolCalls: message.ToolCalls,
|
||||
ToolCallID: toolCallID,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user