mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
fix: api stream
This commit is contained in:
parent
5e0c1f58f6
commit
ae7d86720d
2 changed files with 2 additions and 3 deletions
|
|
@ -134,7 +134,6 @@ const newFetch = (url, options = {}) => {
|
||||||
export class chatgpt extends plugin {
|
export class chatgpt extends plugin {
|
||||||
constructor (e) {
|
constructor (e) {
|
||||||
let toggleMode = Config.toggleMode
|
let toggleMode = Config.toggleMode
|
||||||
let apiStream = Config.apiStream
|
|
||||||
super({
|
super({
|
||||||
/** 功能名称 */
|
/** 功能名称 */
|
||||||
name: 'ChatGpt 对话',
|
name: 'ChatGpt 对话',
|
||||||
|
|
@ -292,7 +291,6 @@ export class chatgpt extends plugin {
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
this.toggleMode = toggleMode
|
this.toggleMode = toggleMode
|
||||||
this.apiStream = apiStream
|
|
||||||
this.reply = async (msg, quote, data) => {
|
this.reply = async (msg, quote, data) => {
|
||||||
let handler = e.runtime?.handler || {}
|
let handler = e.runtime?.handler || {}
|
||||||
const btns = await handler.call('chatgpt.button.post', this.e, data)
|
const btns = await handler.call('chatgpt.button.post', this.e, data)
|
||||||
|
|
@ -2312,7 +2310,7 @@ export class chatgpt extends plugin {
|
||||||
let option = {
|
let option = {
|
||||||
timeoutMs: 600000,
|
timeoutMs: 600000,
|
||||||
completionParams,
|
completionParams,
|
||||||
stream: this.apiStream,
|
stream: Config.apiStream,
|
||||||
onProgress: (data) => {
|
onProgress: (data) => {
|
||||||
if (Config.debug) {
|
if (Config.debug) {
|
||||||
logger.info(data?.text || data.functionCall || data)
|
logger.info(data?.text || data.functionCall || data)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ const defaultConfig = {
|
||||||
openAiBaseUrl: defaultOpenAIReverseProxy,
|
openAiBaseUrl: defaultOpenAIReverseProxy,
|
||||||
OpenAiPlatformRefreshToken: '',
|
OpenAiPlatformRefreshToken: '',
|
||||||
openAiForceUseReverse: false,
|
openAiForceUseReverse: false,
|
||||||
|
apiStream: false,
|
||||||
drawCD: 30,
|
drawCD: 30,
|
||||||
model: '',
|
model: '',
|
||||||
temperature: 0.8,
|
temperature: 0.8,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue