diff --git a/app/chat/agent.tsx b/app/chat/agent.tsx index 785be4c..1dcf919 100644 --- a/app/chat/agent.tsx +++ b/app/chat/agent.tsx @@ -1,4 +1,9 @@ -import { OpenAIChatMessage } from "@/lib/ModelSetting"; +interface Agent { + id: string; + name: string; + content: string; + config?: any; // 添加config字段来存储agentConfig +} const agents: { [key: string]: Agent } = {}; @@ -8,6 +13,7 @@ export function createAgent(): Agent { id, name: `Agent ${id}`, content: 'This is the default agent content.', + config: agentConfig, // 将agentConfig添加到新创建的Agent中 }; agents[id] = newAgent; return newAgent; @@ -19,4 +25,4 @@ export function getAgent(id: string): Agent | undefined { function generateRandomId(): string { return Math.random().toString(36).substring(2, 10); -} \ No newline at end of file +} diff --git a/lib/ModelSetting.ts b/lib/ModelSetting.ts index c5c08bf..fcd38a1 100644 --- a/lib/ModelSetting.ts +++ b/lib/ModelSetting.ts @@ -1,3 +1,5 @@ +import { LLMID } from "@/types" + /** * LLM 模型 */ @@ -209,7 +211,6 @@ export interface ChatCompletionFunctions { [key: string]: any; }; } -import { LLMID } from "@/types" type ChatSettingLimits = { MIN_TEMPERATURE: number