Initial commit

This commit is contained in:
2025-12-10 16:04:26 +08:00
commit ff3ec65139
13 changed files with 2714 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
// 消息类型
export interface Message {
role: 'user' | 'assistant';
content: string;
}
// 工具定义
export interface Tool {
name: string;
description: string;
parameters: Record<string, ToolParameter>;
execute: (params: Record<string, unknown>) => Promise<ToolResult>;
}
export interface ToolParameter {
type: 'string' | 'number' | 'boolean' | 'array' | 'object';
description: string;
required?: boolean;
}
export interface ToolResult {
success: boolean;
output: string;
error?: string;
}
// 工具调用请求
export interface ToolCall {
name: string;
input: Record<string, unknown>;
}
// Agent 配置
export interface AgentConfig {
apiKey: string;
model: string;
maxTokens: number;
systemPrompt: string;
}
// 会话上下文
export interface ConversationContext {
messages: Message[];
workingDirectory: string;
}