feat: 新增 Agent 应用核心代码
- supervisor, memory, skills 模块 - LLM 工厂 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
30
agent/app/agent/llm/factory.py
Normal file
30
agent/app/agent/llm/factory.py
Normal 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)
|
||||
Reference in New Issue
Block a user