mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
✨ AI Agent panel https://github.com/siyuan-note/siyuan/issues/17797
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user