docs: 更新README以突出开发者特性和免费额度
更新了中英文README文件,强调项目为开发者打造的特性以及提供大量免费API请求额度的优势。同时修改了Qwen API服务中的工具合并逻辑,使其能够正确处理请求中已定义的工具。
This commit is contained in:
parent
a23a3af4c6
commit
1b7c143971
3 changed files with 8 additions and 4 deletions
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
`AIClient2API` is a versatile and lightweight API proxy designed for ultimate flexibility and ease of use. It transforms various backend APIs, such as Google Gemini CLI OAuth, OpenAI, Claude, and Kiro, into a standard OpenAI format interface via a Node.js HTTP server. The project features a modern, modular architecture, supporting strategy and adapter patterns, complete with comprehensive test coverage and health check mechanisms. It's ready to use out-of-the-box: simply `npm install` and run. You can easily switch between model providers in the configuration file, allowing any OpenAI-compatible client or application to seamlessly use different large model capabilities through the same API address, eliminating the hassle of maintaining multiple configurations and dealing with incompatible interfaces for different services.
|
||||
`AIClient2API` is a versatile and lightweight API proxy designed for developers, providing abundant free API request quotas and comprehensive support for mainstream large models including Google Gemini, Qwen Code, and Claude. It transforms various backend APIs into a standard OpenAI format interface via a Node.js HTTP server. The project features a modern, modular architecture, supporting strategy and adapter patterns, complete with comprehensive test coverage and health check mechanisms. It's ready to use out-of-the-box: simply `npm install` and run. You can easily switch between model providers in the configuration file, allowing any OpenAI-compatible client or application to seamlessly use different large model capabilities through the same API address, eliminating the hassle of maintaining multiple configurations and dealing with incompatible interfaces for different services.
|
||||
|
||||
> [!NOTE]
|
||||
> Thanks to Ruan Yifeng for the recommendation in [Weekly Issue 359](https://www.ruanyifeng.com/blog/2025/08/weekly-issue-359.html).
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
`AIClient2API` 是一个多功能、轻量化的 API 代理,旨在提供极致的灵活性和易用性。它通过一个 Node.js HTTP 服务器,将 Google Gemini CLI 授权登录、OpenAI、Claude、Kiro 等多种后端 API 统一转换为标准的 OpenAI 格式接口。项目采用现代化的模块化架构,支持策略模式和适配器模式,具备完整的测试覆盖和健康检查机制,开箱即用,`npm install` 后即可直接运行。您只需在配置文件中轻松切换模型服务商,就能让任何兼容 OpenAI 的客户端或应用,通过同一个 API 地址,无缝地使用不同的大模型能力,彻底摆脱为不同服务维护多套配置和处理接口不兼容问题的烦恼。
|
||||
`AIClient2API` 是一个专为开发者打造的多功能、轻量化 API 代理,旨在提供大量免费的 API 请求额度,全面支持 Gemini、Qwen Code、Claude 等主流大模型。通过一个 Node.js HTTP 服务器,它将多种后端 API 统一转换为标准的 OpenAI 格式接口。项目采用现代化的模块化架构,支持策略模式和适配器模式,具备完整的测试覆盖和健康检查机制,开箱即用,`npm install` 后即可直接运行。您只需在配置文件中轻松切换模型服务商,就能让任何兼容 OpenAI 的客户端或应用,通过同一个 API 地址,无缝地使用不同的大模型能力,彻底摆脱为不同服务维护多套配置和处理接口不兼容问题的烦恼。
|
||||
|
||||
> [!NOTE]
|
||||
> 感谢阮一峰老师在[周刊359期](https://www.ruanyifeng.com/blog/2025/08/weekly-issue-359.html)的推荐。
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ export class QwenApiService {
|
|||
},
|
||||
});
|
||||
|
||||
const tools = [
|
||||
const defaultTools = [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
|
|
@ -386,7 +386,11 @@ export class QwenApiService {
|
|||
}
|
||||
}
|
||||
];
|
||||
const requestBody = isStream ? { ...body, stream: true, tools: tools } : { ...body, tools: tools };
|
||||
|
||||
// Merge tools if requestBody already has tools defined
|
||||
const mergedTools = body.tools ? [...defaultTools, ...body.tools] : defaultTools;
|
||||
|
||||
const requestBody = isStream ? { ...body, stream: true, tools: mergedTools } : { ...body, tools: mergedTools };
|
||||
const options = isStream ? { responseType: 'stream' } : {};
|
||||
const response = await this.currentAxiosInstance.post(endpoint, requestBody, options);
|
||||
return response.data;
|
||||
|
|
|
|||
Loading…
Reference in a new issue