feat: 配置默认使用千问模型
- 修改默认LLM配置为千问模型(qwen-turbo) - 创建LLM配置文件,支持千问、OpenAI、Anthropic等多种模型 - 添加千问模型的特殊支持和模拟响应 - 创建配置说明文档,指导用户如何配置千问API密钥 - 优化智能Agent的模拟响应,体现千问模型的特色 - 支持通过配置文件灵活切换不同的LLM提供商
This commit is contained in:
@@ -37,13 +37,21 @@ class TSPAgentAssistant(TSPAssistant):
|
||||
if llm_config:
|
||||
self.llm_manager = LLMManager(llm_config)
|
||||
else:
|
||||
# 使用默认配置
|
||||
default_config = LLMConfig(
|
||||
provider="openai",
|
||||
api_key="your-api-key-here",
|
||||
model="gpt-3.5-turbo"
|
||||
)
|
||||
self.llm_manager = LLMManager(default_config)
|
||||
# 使用默认配置 - 千问模型
|
||||
try:
|
||||
from config.llm_config import DEFAULT_CONFIG
|
||||
self.llm_manager = LLMManager(DEFAULT_CONFIG)
|
||||
except ImportError:
|
||||
# 如果配置文件不存在,使用内置配置
|
||||
default_config = LLMConfig(
|
||||
provider="openai",
|
||||
api_key="sk-your-qwen-api-key-here",
|
||||
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
|
||||
model="qwen-turbo",
|
||||
temperature=0.7,
|
||||
max_tokens=2000
|
||||
)
|
||||
self.llm_manager = LLMManager(default_config)
|
||||
|
||||
# 初始化智能Agent
|
||||
self.intelligent_agent = IntelligentAgent(self.llm_manager)
|
||||
|
||||
Reference in New Issue
Block a user