mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: WIP openai rewrite
This commit is contained in:
parent
30f9c82d73
commit
a77a0e430f
5 changed files with 101 additions and 54 deletions
|
|
@ -59,6 +59,7 @@ import { ChatGPTAPI } from '../utils/openai/chatgpt-api.js'
|
|||
import { newFetch } from '../utils/proxy.js'
|
||||
import { ChatGLM4Client } from '../client/ChatGLM4Client.js'
|
||||
import { QwenApi } from '../utils/alibaba/qwen-api.js'
|
||||
import OpenAI from 'openai';
|
||||
|
||||
const roleMap = {
|
||||
owner: 'group owner',
|
||||
|
|
@ -872,7 +873,13 @@ class Core {
|
|||
// 如果配了proxy(或者不在国内),而且有反代,但是没开启强制反代,将baseurl删掉
|
||||
delete opts.apiBaseUrl
|
||||
}
|
||||
this.chatGPTApi = new ChatGPTAPI(opts)
|
||||
const client = new OpenAI({
|
||||
apiKey: Config.apiKey,
|
||||
baseURL: opts.apiBaseUrl,
|
||||
fetch: newFetch
|
||||
})
|
||||
|
||||
// this.chatGPTApi = new ChatGPTAPI(opts)
|
||||
let option = {
|
||||
timeoutMs: 600000,
|
||||
completionParams,
|
||||
|
|
@ -1054,7 +1061,7 @@ async function collectTools (e) {
|
|||
tools.push(...[new EliMusicTool(), new EliMovieTool()])
|
||||
} catch (err) {
|
||||
tools.push(...[new SendMusicTool(), new SearchMusicTool()])
|
||||
logger.debug(logger.green('【ChatGPT-Plugin】插件avocado-plugin未安装') + ',安装后可查看最近热映电影与体验可玩性更高的点歌工具。\n可前往 https://github.com/Qz-Sean/avocado-plugin 获取')
|
||||
// logger.debug(logger.green('【ChatGPT-Plugin】插件avocado-plugin未安装') + ',安装后可查看最近热映电影与体验可玩性更高的点歌工具。\n可前往 https://github.com/Qz-Sean/avocado-plugin 获取')
|
||||
}
|
||||
let systemAddition = ''
|
||||
if (e.isGroup) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue