Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel
2026-06-03 23:01:10 +08:00
parent 5747fe42f4
commit 565d1d0e17
+5 -1
View File
@@ -214,9 +214,13 @@ func AgentChat(ctx context.Context, client *openai.Client, model string, history
continue
}
content := contentBuilder.String()
if content == "" {
content = " "
}
messages = append(messages, openai.ChatCompletionMessage{
Role: openai.ChatMessageRoleAssistant,
Content: contentBuilder.String(),
Content: content,
})
ch <- AgentEvent{Type: "usage", PromptTokens: totalPrompt, CompletionTokens: totalCompletion}