Skip to content

Commit

Permalink
new agent config
Browse files Browse the repository at this point in the history
  • Loading branch information
Stan370 committed Jul 2, 2024
1 parent 7471f5d commit caabde1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions app/chat/agent.tsx
Original file line number Diff line number Diff line change
@@ -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 } = {};

Expand All @@ -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;
Expand All @@ -19,4 +25,4 @@ export function getAgent(id: string): Agent | undefined {

function generateRandomId(): string {
return Math.random().toString(36).substring(2, 10);
}
}
3 changes: 2 additions & 1 deletion lib/ModelSetting.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { LLMID } from "@/types"

/**
* LLM 模型
*/
Expand Down Expand Up @@ -209,7 +211,6 @@ export interface ChatCompletionFunctions {
[key: string]: any;
};
}
import { LLMID } from "@/types"

type ChatSettingLimits = {
MIN_TEMPERATURE: number
Expand Down

0 comments on commit caabde1

Please sign in to comment.