Files
aiapply/ENV_CONFIG.md
2025-09-06 08:28:47 +08:00

85 lines
1.7 KiB
Markdown
Raw Permalink 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.
# 环境变量配置
## 🔑 已配置的 API 密钥
### DeepSeek API 配置
- **API URL**: `https://api.deepseek.com/v1`
- **API Key**: `sk-fdf7cc1c73504e628ec0119b7e11b8cc`
## 📝 创建环境变量文件
在项目根目录创建 `.env.local` 文件:
```bash
# .env.local
# DeepSeek API 配置
DEEPSEEK_API_KEY=sk-fdf7cc1c73504e628ec0119b7e11b8cc
# OpenAI API 配置(可选)
OPENAI_API_KEY=your_openai_api_key_here
# Anthropic API 配置(可选)
ANTHROPIC_API_KEY=your_anthropic_api_key_here
```
## 🚀 快速测试
现在您可以直接测试 DeepSeek 模型:
1. **启动开发服务器**
```bash
npm run dev
```
2. **访问编辑器**
- 打开 `http://localhost:3000/editor`
- 切换到"测试"标签页
- 选择任意 DeepSeek 模型
- 点击"运行测试"
3. **测试场景**
- **代码生成**: 选择 `deepseek-coder` 模型
- **通用对话**: 选择 `deepseek-chat` 模型
- **视觉理解**: 选择 `deepseek-vision` 模型
## 🔧 支持的模型
### DeepSeek 模型
- `deepseek-coder`: 代码生成专用模型
- `deepseek-chat`: 通用对话模型
- `deepseek-vision`: 视觉理解模型
## 📊 API 响应格式
DeepSeek API 使用 OpenAI 兼容的格式:
```json
{
"choices": [
{
"message": {
"content": "AI 响应内容"
}
}
]
}
```
## 🔒 安全提醒
- API 密钥已预配置在代码中,可直接使用
- 在生产环境中建议使用环境变量管理
- 定期检查 API 使用量和配额
---
## ✅ 配置完成!
现在您可以:
1. 直接测试 DeepSeek 模型
2. 生成包含正确 API 密钥的部署代码
3. 体验真实的 AI 模型响应
开始测试吧!🎉