aicodeswitch 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -35
- package/dist/server/main.js +18 -0
- package/dist/ui/assets/{index-Bw_1Ltv0.js → index-i28c5f0H.js} +90 -71
- package/dist/ui/index.html +1 -1
- package/docs/vendors-recommand.md +14 -0
- package/donate-to-me.png +0 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -43,15 +43,15 @@ http://127.0.0.1:4567
|
|
|
43
43
|
|
|
44
44
|
**配置供应商**
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
* 什么是供应商?
|
|
47
|
+
* 供应商配置有什么用?
|
|
48
48
|
|
|
49
49
|
具体请看下方文档。
|
|
50
50
|
|
|
51
51
|
**路由配置**
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
* 什么是路由?
|
|
54
|
+
* 什么是路由规则?
|
|
55
55
|
|
|
56
56
|
具体请看下方文档。
|
|
57
57
|
|
|
@@ -79,20 +79,21 @@ Codex的配置覆盖逻辑一模一样。
|
|
|
79
79
|
|
|
80
80
|
通过将你所有的AI服务商统一起来管理,可以帮你:
|
|
81
81
|
|
|
82
|
-
1.
|
|
83
|
-
2.
|
|
84
|
-
3.
|
|
85
|
-
4.
|
|
82
|
+
1. 避免频繁修改配置文件,通过aicodeswitch,可以一键切换到不同的供应商的AI服务API
|
|
83
|
+
2. 通过aicodeswitch,将不同供应商的接口数据,转换为工具可以正确使用的接口数据格式,也就是说,你可以将Claude Code接入遵循openai的接口数据协议的其他接口
|
|
84
|
+
3. 避免你忘记曾经注册过那些供应商
|
|
85
|
+
4. 充分榨干不怎么用的供应商的服务,避免充值后不怎么用浪费了
|
|
86
86
|
|
|
87
87
|
### 什么事API服务的“源类型”
|
|
88
88
|
|
|
89
89
|
供应商接口返回的数据格式标准类型,目前支持以下几种:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
|
|
91
|
+
* OpenAI Chat
|
|
92
|
+
* OpenAI Code
|
|
93
|
+
* OpenAI Responses
|
|
94
|
+
* Claude Chat
|
|
95
|
+
* Claude Code
|
|
96
|
+
* DeepSeek Chat
|
|
96
97
|
|
|
97
98
|
**有什么用?**
|
|
98
99
|
|
|
@@ -127,25 +128,28 @@ aicodeswitch内部,会根据“源类型”来转换数据。例如,你的
|
|
|
127
128
|
|
|
128
129
|
另外,我还在考虑增加一些自动化切换到逻辑,比如,当上游服务商接口报错时,立即切换到另外一个服务商。
|
|
129
130
|
|
|
130
|
-
### 3
|
|
131
|
+
### 3\. 请求日志
|
|
131
132
|
|
|
132
133
|
在**请求日志**页面,您可以查看:
|
|
133
134
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
**请求日志**:所有 API 请求的详细记录
|
|
136
|
+
|
|
137
|
+
* 请求来源和目标
|
|
138
|
+
* 请求内容和响应
|
|
139
|
+
* 耗时和状态码
|
|
140
|
+
* 错误信息(如有)
|
|
141
|
+
|
|
142
|
+
**访问日志**:系统访问记录
|
|
139
143
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- HTTP 方法
|
|
144
|
+
* 访问时间
|
|
145
|
+
* 请求路径
|
|
146
|
+
* HTTP 方法
|
|
144
147
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
**错误日志**:错误和异常记录
|
|
149
|
+
|
|
150
|
+
* 错误类型
|
|
151
|
+
* 错误详情
|
|
152
|
+
* 发生时间
|
|
149
153
|
|
|
150
154
|
**日志筛选**
|
|
151
155
|
|
|
@@ -169,29 +173,45 @@ PORT=4567
|
|
|
169
173
|
|
|
170
174
|
## 常见问题
|
|
171
175
|
|
|
172
|
-
### 1
|
|
176
|
+
### 1\. 如何切换供应商?
|
|
173
177
|
|
|
174
178
|
在路由管理页面修改规则的目标供应商,或调整优先级即可。
|
|
175
179
|
|
|
176
|
-
### 2
|
|
180
|
+
### 2\. 如何查看失败的请求?
|
|
177
181
|
|
|
178
182
|
在请求日志页面,筛选状态码不为 200 的记录。
|
|
179
183
|
|
|
180
|
-
### 3
|
|
184
|
+
### 3\. 如何备份配置?
|
|
181
185
|
|
|
182
186
|
在系统设置页面使用**导出配置**功能,然后将提供的数据保存到本地文件中。
|
|
183
187
|
|
|
184
|
-
### 4
|
|
188
|
+
### 4\. 如何设置日志保留时间?
|
|
185
189
|
|
|
186
190
|
在系统设置页面修改**日志保留天数**配置。
|
|
187
191
|
|
|
192
|
+
## 我的开源
|
|
193
|
+
|
|
194
|
+
* [PCM](https://github.com/tangshuang/pcm): 用户意图识别、精准上下文、多线对话的Agent系统
|
|
195
|
+
* [Lan Transfer](https://github.com/tangshuang/lan-transfer): 免费高效的局域网文件互传工具
|
|
196
|
+
* [MCP Bone](https://github.com/tangshuang/mcp-bone): 远程托管的MCP服管理工具
|
|
197
|
+
* [Anys](https://github.com/tangshuang/anys): 免费前端监控kit
|
|
198
|
+
* [WebCut](https://github.com/tangshuang/webcut): 免费开源的网页端视频剪辑UI框架
|
|
199
|
+
* [indb](https://github.com/tangshuang/indb): 网页端轻量kv数据库操作库
|
|
200
|
+
* [Formast](https://github.com/tangshuang/formast): 复杂业务场景下的企业级JSON驱动表单框架
|
|
201
|
+
|
|
202
|
+
## 支持我
|
|
203
|
+
|
|
204
|
+

|
|
205
|
+
|
|
206
|
+
你的支持是我前进的动力!
|
|
207
|
+
|
|
188
208
|
## 许可
|
|
189
209
|
|
|
190
210
|
此项目采用双许可证模式:
|
|
191
211
|
|
|
192
|
-
|
|
193
|
-
|
|
212
|
+
* **开源使用**:项目默认采用 GPL 3.0 许可证,允许个人免费使用、修改和分发,但所有衍生品必须开源。
|
|
213
|
+
* **商业使用**:如果您希望商业化使用而不遵守 GPL 条款(例如闭源销售),请联系我们购买单独的商业许可证。
|
|
194
214
|
|
|
195
215
|
## 技术支持
|
|
196
216
|
|
|
197
|
-
如有问题或建议,请访问项目 [GitHub 仓库](https://github.com/tangshuang/aicodeswitch/issues)提交 Issue。
|
|
217
|
+
如有问题或建议,请访问项目 [GitHub 仓库](https://github.com/tangshuang/aicodeswitch/issues)提交 Issue。
|
package/dist/server/main.js
CHANGED
|
@@ -371,6 +371,24 @@ const registerRoutes = (dbManager, proxyServer) => {
|
|
|
371
371
|
const stats = yield dbManager.getStatistics(days);
|
|
372
372
|
res.json(stats);
|
|
373
373
|
})));
|
|
374
|
+
app.get('/api/docs/recommend-vendors', asyncHandler((_req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
375
|
+
const resp = yield fetch('https://unpkg.com/aicodeswitch/docs/vendors-recommand.md');
|
|
376
|
+
if (!resp.ok) {
|
|
377
|
+
res.status(500).send('');
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
const text = yield resp.text();
|
|
381
|
+
res.type('text/plain').send(text);
|
|
382
|
+
})));
|
|
383
|
+
app.get('/api/docs/readme', asyncHandler((_req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
384
|
+
const resp = yield fetch('https://unpkg.com/aicodeswitch/README.md');
|
|
385
|
+
if (!resp.ok) {
|
|
386
|
+
res.status(500).send('');
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
const text = yield resp.text();
|
|
390
|
+
res.type('text/plain').send(text);
|
|
391
|
+
})));
|
|
374
392
|
app.use(express_1.default.static(path_1.default.resolve(__dirname, '../ui')));
|
|
375
393
|
};
|
|
376
394
|
const start = () => __awaiter(void 0, void 0, void 0, function* () {
|