Files
AI-VideoAssistant/docs/content/getting-started/configuration.md

84 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 配置说明
## 环境变量
在项目根目录或 `web` 目录下创建 `.env` 文件:
```env
# API 服务地址
VITE_API_URL=http://localhost:8080
# Gemini API Key可选
VITE_GEMINI_API_KEY=your_api_key_here
```
## 变量说明
| 变量 | 必填 | 说明 | 默认值 |
|------|------|------|--------|
| `VITE_API_URL` | 是 | 后端 API 服务地址 | http://localhost:8080 |
| `VITE_GEMINI_API_KEY` | 否 | Google Gemini API 密钥 | - |
## 后端服务配置
后端服务使用独立的配置文件,位于 `api/config/` 目录:
### 数据库配置
```yaml
database:
host: localhost
port: 5432
name: ai_assistant
user: postgres
password: your_password
```
### Redis 配置
```yaml
redis:
host: localhost
port: 6379
db: 0
```
## Engine 服务配置
Engine 服务配置位于 `engine/config/` 目录:
### 助手默认配置
参考 `engine/config/agents/default.yaml`
```yaml
agent:
name: "默认助手"
language: "zh-CN"
temperature: 0.7
max_tokens: 2048
```
## 多环境配置
### 开发环境
```env
# .env.development
VITE_API_URL=http://localhost:8080
```
### 生产环境
```env
# .env.production
VITE_API_URL=https://api.your-domain.com
```
## 配置优先级
1. 命令行参数
2. 环境变量
3. `.env` 文件
4. 默认值