Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://ld246.com/article/1760404351939

Daniel404d9f63d009
diff --git a/kernel/util/openai.go b/kernel/util/openai.go
index f38606eea8..6f28b46038 100644
--- a/kernel/util/openai.go
+++ b/kernel/util/openai.go
@@ -54,10 +54,10 @@ func ChatGPT(msg string, contextMsgs []string, c *openai.Client, model string, m
}
req := openai.ChatCompletionRequest{
- Model: model,
- MaxTokens: maxTokens,
- Temperature: float32(temperature),
- Messages: reqMsgs,
+ Model: model,
+ MaxCompletionTokens: maxTokens,
+ Temperature: float32(temperature),
+ Messages: reqMsgs,
}
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
defer cancel()