mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🔧 refactor: 优化 OpenaiBuilder 类超时设置和响应数据处理
- 调整 utils/openai-builder.js 中的 axios 超时时间从 10000 毫秒增加到 100000 毫秒 - 更新 utils/openai-builder.js 中的响应数据处理逻辑,以匹配新的 API 响应结构 - 确保代码清晰和功能正常运行,提升代码可维护性 - 优化 API 交互流程,提高响应效率和稳定性
This commit is contained in:
parent
75d10fbd45
commit
85da3f04f1
@ -39,7 +39,7 @@ export class OpenaiBuilder {
|
|||||||
// 创建客户端
|
// 创建客户端
|
||||||
this.client = axios.create({
|
this.client = axios.create({
|
||||||
baseURL: this.baseURL,
|
baseURL: this.baseURL,
|
||||||
timeout: 10000,
|
timeout: 100000,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Authorization": "Bearer " + this.apiKey
|
"Authorization": "Bearer " + this.apiKey
|
||||||
@ -65,7 +65,7 @@ export class OpenaiBuilder {
|
|||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
"model": "月之暗面 Kimi",
|
"model": "月之暗面 Kimi",
|
||||||
"ans": completion.choices[0].message.content
|
"ans": completion.data.choices[0].message.content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user