feat(ai): 添加 AI 助手功能支持多模型对话
- 集成 OpenAI 兼容网关和 Ollama 原生 API 接口 - 新增 AI 测试页面支持流式对话和模型切换 - 配置开发环境同源反向代理解决浏览器 CORS 问题 - 添加环境变量配置支持 AI API 和 Ollama 接口设置 - 实现聊天历史记录、中断请求和参数调节功能 - 提供 Nginx 反向代理配置文档用于生产环境部署
This commit is contained in:
13
.env.example
13
.env.example
@@ -6,6 +6,19 @@ VITE_API_URL=https://your-api.com/api
|
||||
VITE_SERVER_API_URL=https://your-server.com/api
|
||||
VITE_DOMAIN=https://your-domain.com
|
||||
VITE_FILE_SERVER=https://your-file-server.com
|
||||
# AI 网关(OpenAI兼容)
|
||||
# - 开发环境推荐走同源反代:VITE_AI_API_URL=/ai-proxy(配合 vite.config.ts)
|
||||
# - 生产环境可直连(需 AI 服务允许 CORS),或在 Nginx 里配置 /ai-proxy 反代
|
||||
VITE_AI_API_URL=https://ai-api.websoft.top/api/v1
|
||||
|
||||
# Ollama 原生接口(默认端口 11434)
|
||||
# - 开发环境推荐走同源反代:VITE_OLLAMA_API_URL=/ollama-proxy(配合 vite.config.ts)
|
||||
# - 生产环境不要直接用 http(会混合内容被拦截),建议 Nginx 反代成同源 https
|
||||
VITE_OLLAMA_API_URL=http://47.119.165.234:11434
|
||||
|
||||
# 仅用于本地开发反代注入(vite.config.ts 会读取并注入到 /ai-proxy 请求头)
|
||||
# 不要加 VITE_ 前缀,避免被打包到前端产物里
|
||||
AI_API_KEY=your_ai_api_key
|
||||
|
||||
# 租户配置
|
||||
VITE_TENANT_ID=your_tenant_id
|
||||
|
||||
Reference in New Issue
Block a user