调整公共模块结构,方便后续延伸

This commit is contained in:
2026-06-29 11:58:16 +08:00
parent 46544e9c42
commit 6d45b8fb7a
12 changed files with 14 additions and 170 deletions
+3 -6
View File
@@ -2,7 +2,7 @@ use std::sync::OnceLock;
use tokio::sync::Mutex;
use common::ai::{ChatCompletionRequestMessage, ChatCompletionToolCall};
use common::model::ai::{ChatCompletionRequestMessage, ChatCompletionToolCall};
static CHAT_CONTEXT: OnceLock<Mutex<Vec<ChatCompletionRequestMessage>>> = OnceLock::new();
@@ -24,11 +24,8 @@ pub async fn add_assistant_message(
content: String,
tool_calls: Option<Vec<ChatCompletionToolCall>>,
) {
let message = ChatCompletionRequestMessage::assistant(
"assistant".to_string(),
content,
tool_calls,
);
let message =
ChatCompletionRequestMessage::assistant("assistant".to_string(), content, tool_calls);
push_context_message(message).await;
}