本指南将帮助你在5分钟内运行Mori项目。
- Python 3.10+
- uv(Python包管理器)
- 一个LLM API密钥(OpenAI、DeepSeek、通义千问等)
# 创建虚拟环境
uv venv
# 激活虚拟环境
# Windows PowerShell:
.venv\Scripts\activate
# Linux/Mac:
source .venv/bin/activate
# 安装项目
uv pip install -e .# Windows PowerShell:
$env:OPENAI_API_KEY="your-api-key-here"
# Linux/Mac:
export OPENAI_API_KEY="your-api-key-here"然后复制配置文件:
# Windows PowerShell:
Copy-Item config\models.yaml.example config\models.yaml
Copy-Item config\agents.yaml.example config\agents.yaml
Copy-Item config\config.yaml.example config\config.yaml
# Linux/Mac:
cp config/models.yaml.example config/models.yaml
cp config/agents.yaml.example config/agents.yaml
cp config/config.yaml.example config/config.yaml- 复制配置文件(同上)
- 编辑
config/models.yaml,将${OPENAI_API_KEY}替换为你的实际API密钥
models:
- model_name: gpt-4
model_type: openai
api_key: sk-your-actual-key-here # 直接填入密钥
generate_kwargs:
temperature: 0.7
max_tokens: 2000python gui/app.py然后在浏览器中访问: http://localhost:7860
# config/models.yaml
models:
- model_name: deepseek-chat
model_type: openai
api_key: ${DEEPSEEK_API_KEY}
base_url: https://api.deepseek.com/v1
generate_kwargs:
temperature: 0.7# config/agents.yaml
agents:
- name: mori
model: deepseek-chat # 使用DeepSeek
template: mori # 使用简短名称
parallel_tool_calls: true# config/models.yaml
models:
- model_name: qwen-max
model_type: dashscope
api_key: ${DASHSCOPE_API_KEY}
generate_kwargs:
temperature: 0.7# config/agents.yaml
agents:
- name: mori
model: qwen-max # 使用通义千问
template: mori # 使用简短名称
parallel_tool_calls: true# config/models.yaml
models:
- model_name: llama3
model_type: ollama
base_url: http://localhost:11434
generate_kwargs:
temperature: 0.8# config/agents.yaml
agents:
- name: mori
model: llama3 # 使用本地Ollama模型
template: mori # 使用简短名称
parallel_tool_calls: false # Ollama可能不支持并行工具调用A: 确保你已经复制了配置文件示例:
cp config/models.yaml.example config/models.yaml
cp config/agents.yaml.example config/agents.yaml
cp config/config.yaml.example config/config.yamlA: 检查以下几点:
- 环境变量是否正确设置
- 配置文件中的API密钥是否正确
- 如果使用环境变量,确保格式为
${ENV_VAR_NAME}
A: 修改 config/config.yaml 中的端口:
server:
port: 8080 # 改为其他端口A: 可以尝试:
- 使用更快的模型(如gpt-3.5-turbo)
- 减少
max_tokens参数 - 使用本地Ollama模型
- 查看 README.md 了解更多功能
- 查看 ARCHITECTURE.md 了解架构设计
- 自定义提示词模板:编辑
mori/template/internal_template/mori.jinja2 - 添加自定义工具:在
mori/tool/internal_tools/中添加新工具
如有问题,请查看:
- README.md - 完整文档
- ARCHITECTURE.md - 架构说明
- GitHub Issues - 提交问题
祝你使用愉快!💕