feat: 配置默认使用千问模型

- 修改默认LLM配置为千问模型(qwen-turbo)
- 创建LLM配置文件,支持千问、OpenAI、Anthropic等多种模型
- 添加千问模型的特殊支持和模拟响应
- 创建配置说明文档,指导用户如何配置千问API密钥
- 优化智能Agent的模拟响应,体现千问模型的特色
- 支持通过配置文件灵活切换不同的LLM提供商
This commit is contained in:
zhaojie
2025-09-11 00:03:02 +08:00
parent 23f460d997
commit a0de2a6c0e
5 changed files with 125 additions and 20 deletions

37
config/llm_config.py Normal file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
LLM配置文件 - 千问模型配置
"""
from src.agent.llm_client import LLMConfig
# 千问模型配置
QWEN_CONFIG = LLMConfig(
provider="openai",
api_key="sk-your-qwen-api-key-here", # 请替换为您的千问API密钥
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
model="qwen-turbo", # 可选: qwen-turbo, qwen-plus, qwen-max
temperature=0.7,
max_tokens=2000
)
# 其他模型配置示例
OPENAI_CONFIG = LLMConfig(
provider="openai",
api_key="sk-your-openai-api-key-here",
model="gpt-3.5-turbo",
temperature=0.7,
max_tokens=2000
)
ANTHROPIC_CONFIG = LLMConfig(
provider="anthropic",
api_key="sk-ant-your-anthropic-api-key-here",
model="claude-3-sonnet-20240229",
temperature=0.7,
max_tokens=2000
)
# 默认使用千问模型
DEFAULT_CONFIG = QWEN_CONFIG