feat: 新增 Agent 应用核心代码

- supervisor, memory, skills 模块
- LLM 工厂

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 16:26:33 +08:00
parent 0cab33b16b
commit f9660a3d7b
14 changed files with 835 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
"""
LLM Factory - LLM 工厂类
"""
from typing import Dict, Any
from app.agent.llm.openai import OpenAILLM
from app.agent.llm.anthropic import AnthropicLLM
class LLMFactory:
"""LLM 工厂类"""
@staticmethod
def create(provider: str, model_name: str):
"""
创建 LLM 实例
Args:
provider: 模型提供商 (openai/anthropic)
model_name: 模型名称
Returns:
LLM 实例
"""
if provider.lower() == "openai":
return OpenAILLM(model_name)
elif provider.lower() == "anthropic":
return AnthropicLLM(model_name)
else:
# 默认使用 OpenAI
return OpenAILLM(model_name)