Initial commit
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user