📚 Update documentation links to include file extensions and remove outdated wiki references
This commit is contained in:
@@ -151,7 +151,6 @@ Accept: text/event-stream
|
|||||||
### 💬 Get Help
|
### 💬 Get Help
|
||||||
- [📋 Issues](../../issues) - Report bugs or suggest features
|
- [📋 Issues](../../issues) - Report bugs or suggest features
|
||||||
- [💡 Discussions](../../discussions) - Community discussion and experience sharing
|
- [💡 Discussions](../../discussions) - Community discussion and experience sharing
|
||||||
- [📖 Wiki](../../wiki) - Complete documentation and tutorials
|
|
||||||
|
|
||||||
### 🔧 Contribute
|
### 🔧 Contribute
|
||||||
- [🤝 Contributing Guide](./docs/Contributing.en.md) - How to participate in project development
|
- [🤝 Contributing Guide](./docs/Contributing.en.md) - How to participate in project development
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ Accept: text/event-stream
|
|||||||
### 💬 获取帮助
|
### 💬 获取帮助
|
||||||
- [📋 Issues](../../issues) - 报告 Bug 或提出功能建议
|
- [📋 Issues](../../issues) - 报告 Bug 或提出功能建议
|
||||||
- [💡 Discussions](../../discussions) - 社区讨论和经验分享
|
- [💡 Discussions](../../discussions) - 社区讨论和经验分享
|
||||||
- [📖 Wiki](../../wiki) - 完整文档和教程
|
|
||||||
|
|
||||||
### 🔧 参与贡献
|
### 🔧 参与贡献
|
||||||
- [🤝 贡献指南](./docs/Contributing.md) - 如何参与项目开发
|
- [🤝 贡献指南](./docs/Contributing.md) - 如何参与项目开发
|
||||||
|
|||||||
@@ -633,4 +633,4 @@ function getCachedResponse(key) {
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Need More Help?** 👉 [View Usage Examples](./Examples.en) | [Troubleshooting](./Troubleshooting.en)
|
**Need More Help?** 👉 [View Usage Examples](./Examples.en.md) | [Troubleshooting](./Troubleshooting.en.md)
|
||||||
|
|||||||
@@ -633,4 +633,4 @@ function getCachedResponse(key) {
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**需要更多帮助?** 👉 [查看使用示例](./Examples) | [故障排除](./Troubleshooting)
|
**需要更多帮助?** 👉 [查看使用示例](./Examples.md) | [故障排除](./Troubleshooting.md)
|
||||||
|
|||||||
@@ -312,4 +312,4 @@ A: Modify `Access-Control-Allow-Origin` in `CORS_HEADERS`:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Need Help?** 👉 [Troubleshooting Guide](./Troubleshooting) | [GitHub Issues](../../issues)
|
**Need Help?** 👉 [Troubleshooting Guide](./Troubleshooting.en.md) | [GitHub Issues](../../issues)
|
||||||
|
|||||||
@@ -312,4 +312,4 @@ A: 修改 `CORS_HEADERS` 中的 `Access-Control-Allow-Origin`:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**需要帮助?** 👉 [故障排除指南](./Troubleshooting) | [GitHub Issues](../../issues)
|
**需要帮助?** 👉 [故障排除指南](./Troubleshooting.md) | [GitHub Issues](../../issues)
|
||||||
|
|||||||
@@ -328,4 +328,4 @@ After successful deployment, you can:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Deployment Successful?** 👉 [Start Using API](./API-Reference.en)
|
**Deployment Successful?** 👉 [Start Using API](./API-Reference.en.md)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
5. 复制并保存密钥(**注意:只显示一次**)
|
5. 复制并保存密钥(**注意:只显示一次**)
|
||||||
|
|
||||||
### 3. 准备项目文件
|
### 3. 准备项目文件
|
||||||
确保你已经完成了 [安装指南](./Installation) 中的步骤,并且项目文件已就绪。
|
确保你已经完成了 [安装指南](./Installation.md) 中的步骤,并且项目文件已就绪。
|
||||||
|
|
||||||
## 🚀 方法一:本地 CLI 部署(推荐)
|
## 🚀 方法一:本地 CLI 部署(推荐)
|
||||||
|
|
||||||
@@ -411,11 +411,11 @@ wrangler secret put DEEPSEEK_API_KEY
|
|||||||
|
|
||||||
部署完成后,你可以:
|
部署完成后,你可以:
|
||||||
|
|
||||||
1. **[配置 API 使用](./API-Reference)** - 了解完整的 API 文档
|
1. **[配置 API 使用](./API-Reference.md)** - 了解完整的 API 文档
|
||||||
2. **[集成到应用](./Examples)** - 查看各种编程语言的集成示例
|
2. **[集成到应用](./Examples.md)** - 查看各种编程语言的集成示例
|
||||||
3. **[监控和维护](./Monitoring)** - 设置监控和日志分析
|
3. **[监控和维护](./Monitoring.md)** - 设置监控和日志分析
|
||||||
4. **[性能优化](./Performance)** - 优化 Worker 性能
|
4. **[性能优化](./Performance)** - 优化 Worker 性能
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**部署成功?** 👉 [开始使用 API](./API-Reference)
|
**部署成功?** 👉 [开始使用 API](./API-Reference.md)
|
||||||
|
|||||||
137
docs/Home.en.md
137
docs/Home.en.md
@@ -1,137 +0,0 @@
|
|||||||
# AI Proxy Worker Wiki
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
|
|
||||||
**🌍 Language / 语言**
|
|
||||||
|
|
||||||
[🇺🇸 English](./Home.en.md) | [🇨🇳 中文](./Home.md)
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Welcome to the complete documentation for AI Proxy Worker! Here you'll find detailed information from installation to advanced usage.
|
|
||||||
|
|
||||||
## 📚 Documentation Navigation
|
|
||||||
|
|
||||||
### 🚀 Quick Start
|
|
||||||
- **[Installation Guide](./Installation.en)** - Detailed system installation steps
|
|
||||||
- **[Deployment Tutorial](./Deployment.en)** - Multiple deployment methods comparison
|
|
||||||
- **[Quick Setup](./Quick-Setup.en)** - 5-minute quick configuration guide
|
|
||||||
|
|
||||||
### 📖 Usage Guide
|
|
||||||
- **[API Documentation](./API-Reference.en)** - Complete API reference
|
|
||||||
- **[Configuration Guide](./Configuration.en)** - Environment variables and code configuration details
|
|
||||||
- **[Usage Examples](./Examples.en)** - Examples in various programming languages
|
|
||||||
|
|
||||||
### 🔧 Operations Guide
|
|
||||||
- **[Troubleshooting](./Troubleshooting.en)** - Common issues and solutions
|
|
||||||
- **[Monitoring Guide](./Monitoring.en)** - Logging and performance monitoring
|
|
||||||
- **[Security Configuration](./Security.en)** - Production environment security best practices
|
|
||||||
|
|
||||||
### 🏗️ Development Guide
|
|
||||||
- **[Contributing Guide](./Contributing.en)** - How to participate in project development
|
|
||||||
- **[Code Style](./Code-Style.en)** - Code style and best practices
|
|
||||||
- **[Testing Guide](./Testing.en)** - Testing writing and execution
|
|
||||||
|
|
||||||
### 🔮 Advanced Features
|
|
||||||
- **[Multi-AI Support](./Multi-AI-Support.en)** - Extending support for other AI services
|
|
||||||
- **[Custom Middleware](./Custom-Middleware.en)** - Adding custom functionality
|
|
||||||
- **[Performance Optimization](./Performance.en)** - Performance tuning guide
|
|
||||||
|
|
||||||
## 🎯 Project Overview
|
|
||||||
|
|
||||||
AI Proxy Worker is a universal AI API proxy service based on Cloudflare Workers, designed to solve the following problems:
|
|
||||||
|
|
||||||
### 🔐 Security Issues
|
|
||||||
- **Problem**: Client applications calling AI APIs directly need to expose API keys
|
|
||||||
- **Solution**: Proxy service stores keys securely on the server side, clients only need proxy access keys
|
|
||||||
|
|
||||||
### ⚡ Performance Issues
|
|
||||||
- **Problem**: Direct calls may be affected by network restrictions
|
|
||||||
- **Solution**: Based on Cloudflare's global edge network for nearby access
|
|
||||||
|
|
||||||
### 🔄 Compatibility Issues
|
|
||||||
- **Problem**: Different AI service providers have inconsistent API formats
|
|
||||||
- **Solution**: Provides unified proxy interface, future support for multiple AI service providers
|
|
||||||
|
|
||||||
## 🏗️ Architecture Design
|
|
||||||
|
|
||||||
```
|
|
||||||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
||||||
│ Client Apps │────│ AI Proxy │────│ AI Service │
|
|
||||||
│ (iOS/Web) │ │ Worker │ │ (DeepSeek) │
|
|
||||||
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
||||||
│ │ │
|
|
||||||
│ PROXY_KEY │ DEEPSEEK_API_KEY │
|
|
||||||
│ (Public Safe) │ (Server Secret) │
|
|
||||||
└────────────────────────┴───────────────────────┘
|
|
||||||
```
|
|
||||||
|
|
||||||
### Core Components
|
|
||||||
|
|
||||||
1. **Authentication Layer**: Handles client access control
|
|
||||||
2. **Routing Layer**: Distributes requests to different AI services
|
|
||||||
3. **Proxy Layer**: Communicates with upstream AI APIs
|
|
||||||
4. **Security Layer**: Request validation, rate limiting, logging
|
|
||||||
|
|
||||||
## 📊 Supported AI Services
|
|
||||||
|
|
||||||
### Currently Supported (v1.0)
|
|
||||||
- ✅ **DeepSeek API** - Complete support including conversation and reasoning models
|
|
||||||
- `deepseek-chat` - General conversation model
|
|
||||||
- `deepseek-reasoner` - Complex reasoning model
|
|
||||||
|
|
||||||
### Planned Support (Future Versions)
|
|
||||||
- 🔄 **OpenAI API** - GPT series models (planned for v2.0)
|
|
||||||
- 🔄 **Claude API** - Anthropic Claude models (planned for v2.0)
|
|
||||||
- 🔄 **Gemini API** - Google Gemini models (planned for v2.0)
|
|
||||||
- 🔄 **Unified Routing** - One interface to call all AI service providers (planned for v2.0)
|
|
||||||
|
|
||||||
> **Note**: The current version focuses on providing stable and reliable DeepSeek API proxy service. Multi-AI support is under development, stay tuned!
|
|
||||||
|
|
||||||
## 🎯 Use Cases
|
|
||||||
|
|
||||||
### Mobile Applications
|
|
||||||
- iOS/Android apps securely call AI APIs
|
|
||||||
- Avoid storing sensitive keys in clients
|
|
||||||
- Provide unified AI service interface
|
|
||||||
|
|
||||||
### Web Applications
|
|
||||||
- Frontend direct calls without backend relay
|
|
||||||
- Support streaming responses for real-time conversation experience
|
|
||||||
- Global CDN accelerated access
|
|
||||||
|
|
||||||
### Microservice Architecture
|
|
||||||
- Serve as AI service gateway
|
|
||||||
- Unified AI API access layer
|
|
||||||
- Support multi-tenancy and access control
|
|
||||||
|
|
||||||
## 🔄 Version History
|
|
||||||
|
|
||||||
### v1.0.0 (Current Version)
|
|
||||||
- ✅ Support DeepSeek API
|
|
||||||
- ✅ Complete error handling
|
|
||||||
- ✅ Streaming response support
|
|
||||||
- ✅ Security protection mechanisms
|
|
||||||
|
|
||||||
### Future Versions
|
|
||||||
- 🔮 Multi-AI service provider support
|
|
||||||
- 🔮 User-level access control
|
|
||||||
- 🔮 Request rate limiting and quotas
|
|
||||||
- 🔮 Detailed usage statistics
|
|
||||||
|
|
||||||
## 🤝 Community
|
|
||||||
|
|
||||||
### Ways to Participate
|
|
||||||
- 🐛 [Report Bugs](../../issues/new?template=bug_report.md)
|
|
||||||
- 💡 [Feature Suggestions](../../issues/new?template=feature_request.md)
|
|
||||||
- 📝 [Improve Documentation](../../issues/new?template=documentation.md)
|
|
||||||
- 🔧 [Submit Code](./Contributing.en)
|
|
||||||
|
|
||||||
### Community Resources
|
|
||||||
- [GitHub Discussions](../../discussions) - Discussion and communication
|
|
||||||
- [Example Projects](./Examples.en) - Real-world use cases
|
|
||||||
- [Best Practices](./Best-Practices.en) - Experience sharing
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Ready to Start?** 👉 [Installation Guide](./Installation.en)
|
|
||||||
137
docs/Home.md
137
docs/Home.md
@@ -1,137 +0,0 @@
|
|||||||
# AI Proxy Worker Wiki
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
|
|
||||||
**🌍 Language / 语言**
|
|
||||||
|
|
||||||
[🇺🇸 English](./Home.en.md) | [🇨🇳 中文](./Home.md)
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
欢迎来到 AI Proxy Worker 的完整文档!这里包含了从安装到高级使用的所有详细信息。
|
|
||||||
|
|
||||||
## 📚 文档导航
|
|
||||||
|
|
||||||
### 🚀 快速开始
|
|
||||||
- **[安装指南](./Installation)** - 详细的系统安装步骤
|
|
||||||
- **[部署教程](./Deployment)** - 多种部署方式对比
|
|
||||||
- **[快速配置](./Quick-Setup)** - 5分钟快速配置指南
|
|
||||||
|
|
||||||
### 📖 使用指南
|
|
||||||
- **[API 文档](./API-Reference)** - 完整的 API 参考
|
|
||||||
- **[配置指南](./Configuration)** - 环境变量和代码配置详解
|
|
||||||
- **[使用示例](./Examples)** - 各种编程语言示例
|
|
||||||
|
|
||||||
### 🔧 运维指南
|
|
||||||
- **[故障排除](./Troubleshooting)** - 常见问题解决方案
|
|
||||||
- **[监控指南](./Monitoring)** - 日志和性能监控
|
|
||||||
- **[安全配置](./Security)** - 生产环境安全最佳实践
|
|
||||||
|
|
||||||
### 🏗️ 开发指南
|
|
||||||
- **[贡献指南](./Contributing)** - 如何参与项目开发
|
|
||||||
- **[代码规范](./Code-Style)** - 代码风格和最佳实践
|
|
||||||
- **[测试指南](./Testing)** - 测试编写和执行
|
|
||||||
|
|
||||||
### 🔮 高级功能
|
|
||||||
- **[多 AI 支持](./Multi-AI-Support)** - 扩展支持其他 AI 服务
|
|
||||||
- **[自定义中间件](./Custom-Middleware)** - 添加自定义功能
|
|
||||||
- **[性能优化](./Performance)** - 性能调优指南
|
|
||||||
|
|
||||||
## 🎯 项目概览
|
|
||||||
|
|
||||||
AI Proxy Worker 是一个基于 Cloudflare Workers 的通用 AI API 代理服务,旨在解决以下问题:
|
|
||||||
|
|
||||||
### 🔐 安全性问题
|
|
||||||
- **问题**:客户端应用直接调用 AI API 需要暴露 API 密钥
|
|
||||||
- **解决**:代理服务将密钥安全存储在服务端,客户端只需要代理访问密钥
|
|
||||||
|
|
||||||
### ⚡ 性能问题
|
|
||||||
- **问题**:直接调用可能受网络限制影响速度
|
|
||||||
- **解决**:基于 Cloudflare 全球边缘网络,就近访问
|
|
||||||
|
|
||||||
### 🔄 兼容性问题
|
|
||||||
- **问题**:不同 AI 服务商 API 格式不统一
|
|
||||||
- **解决**:提供统一的代理接口,未来支持多个 AI 服务商
|
|
||||||
|
|
||||||
## 🏗️ 架构设计
|
|
||||||
|
|
||||||
```
|
|
||||||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
||||||
│ 客户端应用 │────│ AI Proxy │────│ AI 服务商 │
|
|
||||||
│ (iOS/Web) │ │ Worker │ │ (DeepSeek) │
|
|
||||||
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
||||||
│ │ │
|
|
||||||
│ PROXY_KEY │ DEEPSEEK_API_KEY │
|
|
||||||
│ (公开安全) │ (服务端机密) │
|
|
||||||
└────────────────────────┴───────────────────────┘
|
|
||||||
```
|
|
||||||
|
|
||||||
### 核心组件
|
|
||||||
|
|
||||||
1. **认证层**:处理客户端访问控制
|
|
||||||
2. **路由层**:分发请求到不同的 AI 服务
|
|
||||||
3. **代理层**:与上游 AI API 通信
|
|
||||||
4. **安全层**:请求验证、限流、日志记录
|
|
||||||
|
|
||||||
## 📊 支持的 AI 服务
|
|
||||||
|
|
||||||
### 当前支持 (v1.0)
|
|
||||||
- ✅ **DeepSeek API** - 完整支持,包含对话和推理模型
|
|
||||||
- `deepseek-chat` - 通用对话模型
|
|
||||||
- `deepseek-reasoner` - 复杂推理模型
|
|
||||||
|
|
||||||
### 计划支持 (未来版本)
|
|
||||||
- 🔄 **OpenAI API** - GPT 系列模型 (v2.0 计划)
|
|
||||||
- 🔄 **Claude API** - Anthropic Claude 模型 (v2.0 计划)
|
|
||||||
- 🔄 **Gemini API** - Google Gemini 模型 (v2.0 计划)
|
|
||||||
- 🔄 **统一路由** - 一套接口调用所有 AI 服务商 (v2.0 计划)
|
|
||||||
|
|
||||||
> **注意**: 当前版本专注于提供稳定可靠的 DeepSeek API 代理服务。多 AI 支持正在开发中,敬请期待!
|
|
||||||
|
|
||||||
## 🎯 使用场景
|
|
||||||
|
|
||||||
### 移动应用
|
|
||||||
- iOS/Android 应用安全调用 AI API
|
|
||||||
- 避免在客户端存储敏感密钥
|
|
||||||
- 提供统一的 AI 服务接口
|
|
||||||
|
|
||||||
### Web 应用
|
|
||||||
- 前端直接调用,无需后端中转
|
|
||||||
- 支持流式响应,实时对话体验
|
|
||||||
- 全球 CDN 加速访问
|
|
||||||
|
|
||||||
### 微服务架构
|
|
||||||
- 作为 AI 服务网关
|
|
||||||
- 统一的 AI API 访问层
|
|
||||||
- 支持多租户和访问控制
|
|
||||||
|
|
||||||
## 🔄 版本历史
|
|
||||||
|
|
||||||
### v1.0.0 (当前版本)
|
|
||||||
- ✅ 支持 DeepSeek API
|
|
||||||
- ✅ 完整的错误处理
|
|
||||||
- ✅ 流式响应支持
|
|
||||||
- ✅ 安全防护机制
|
|
||||||
|
|
||||||
### 未来版本
|
|
||||||
- 🔮 多 AI 服务商支持
|
|
||||||
- 🔮 用户级访问控制
|
|
||||||
- 🔮 请求限流和配额
|
|
||||||
- 🔮 详细的使用统计
|
|
||||||
|
|
||||||
## 🤝 社区
|
|
||||||
|
|
||||||
### 参与方式
|
|
||||||
- 🐛 [报告 Bug](../../issues/new?template=bug_report.md)
|
|
||||||
- 💡 [功能建议](../../issues/new?template=feature_request.md)
|
|
||||||
- 📝 [改进文档](../../issues/new?template=documentation.md)
|
|
||||||
- 🔧 [提交代码](./Contributing)
|
|
||||||
|
|
||||||
### 社区资源
|
|
||||||
- [GitHub Discussions](../../discussions) - 讨论和交流
|
|
||||||
- [示例项目](./Examples) - 实际使用案例
|
|
||||||
- [最佳实践](./Best-Practices) - 经验分享
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**开始使用?** 👉 [安装指南](./Installation)
|
|
||||||
@@ -326,4 +326,4 @@ If you encounter installation issues:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Installation Complete?** 👉 [Start Deployment](./Deployment.en)
|
**Installation Complete?** 👉 [Start Deployment](./Deployment.en.md)
|
||||||
|
|||||||
@@ -273,9 +273,7 @@ ls worker.js wrangler.toml
|
|||||||
|
|
||||||
安装完成后,你可以:
|
安装完成后,你可以:
|
||||||
|
|
||||||
1. **[配置部署环境](./Deployment)** - 设置 Cloudflare 账户和密钥
|
1. **[配置部署环境](./Deployment.md)** - 设置 Cloudflare 账户和密钥
|
||||||
2. **[快速部署](./Quick-Setup)** - 5分钟部署到生产环境
|
|
||||||
3. **[本地开发](./Development)** - 设置本地开发环境
|
|
||||||
|
|
||||||
## 🔧 故障排除
|
## 🔧 故障排除
|
||||||
|
|
||||||
@@ -319,11 +317,11 @@ npm install -g wrangler
|
|||||||
|
|
||||||
如果遇到安装问题:
|
如果遇到安装问题:
|
||||||
|
|
||||||
1. 查看 [故障排除指南](./Troubleshooting)
|
1. 查看 [故障排除指南](./Troubleshooting.md)
|
||||||
2. 搜索 [GitHub Issues](../../issues)
|
2. 搜索 [GitHub Issues](../../issues)
|
||||||
3. 在 [Discussions](../../discussions) 中提问
|
3. 在 [Discussions](../../discussions) 中提问
|
||||||
4. 查看 [Cloudflare Workers 文档](https://developers.cloudflare.com/workers/)
|
4. 查看 [Cloudflare Workers 文档](https://developers.cloudflare.com/workers/)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**安装完成?** 👉 [开始部署](./Deployment)
|
**安装完成?** 👉 [开始部署](./Deployment.md)
|
||||||
|
|||||||
@@ -470,4 +470,4 @@ curl -v -X POST https://your-worker.workers.dev/chat \
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Issue Resolved?** 👉 [Back to Home](./Home.en) | [View More Examples](./Examples.en)
|
**Issue Resolved?** 👉 [View More Examples](./Examples.en.md) | [GitHub Issues](../../issues)
|
||||||
|
|||||||
@@ -568,4 +568,4 @@ curl -v -X POST https://your-worker.workers.dev/chat \
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**问题解决了?** 👉 [回到主页](./Home) | [查看更多示例](./Examples)
|
**问题解决了?** 👉 [查看更多示例](./Examples.md) | [GitHub Issues](../../issues)
|
||||||
|
|||||||
Reference in New Issue
Block a user