mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-05-07 05:02:42 +08:00
* feat: Implement AI Agent with tool processing capabilities - Added tools for listing and running processors in the agent. - Created data models for agent chat requests and tool calls. - Developed API integration for agent chat and streaming responses. - Built the AI Agent widget with a user interface for interaction. - Styled the agent components for better user experience. * feat: 增强 AI 助手工具功能,添加文件操作和搜索功能,更新界面显示 * feat: 更新 AI 助手组件 * feat: 更新 AiAgentWidget 组件样式,调整背景和边距以提升界面一致性
24 lines
638 B
Python
24 lines
638 B
Python
from typing import Any, Dict, List, Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class AgentChatContext(BaseModel):
|
|
current_path: Optional[str] = None
|
|
|
|
|
|
class AgentChatRequest(BaseModel):
|
|
messages: List[Dict[str, Any]] = Field(default_factory=list)
|
|
auto_execute: bool = False
|
|
approved_tool_call_ids: List[str] = Field(default_factory=list)
|
|
rejected_tool_call_ids: List[str] = Field(default_factory=list)
|
|
context: Optional[AgentChatContext] = None
|
|
|
|
|
|
class PendingToolCall(BaseModel):
|
|
id: str
|
|
name: str
|
|
arguments: Dict[str, Any] = Field(default_factory=dict)
|
|
requires_confirmation: bool = True
|
|
|