mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-20 12:20:31 +08:00
allow filling in the API Key of CustomModel mode (#561, previously designed for local offline model or custom server, now you can also use it for regular openai API calls and freely fill in the model name(#563))
This commit is contained in:
@@ -9,7 +9,7 @@ import { getUserConfig } from '../../config/index.mjs'
|
||||
import { fetchSSE } from '../../utils/fetch-sse.mjs'
|
||||
import { getConversationPairs } from '../../utils/get-conversation-pairs.mjs'
|
||||
import { isEmpty } from 'lodash-es'
|
||||
import { getCustomApiPromptBase, pushRecord, setAbortController } from './shared.mjs'
|
||||
import { pushRecord, setAbortController } from './shared.mjs'
|
||||
|
||||
/**
|
||||
* @param {Browser.Runtime.Port} port
|
||||
@@ -26,7 +26,7 @@ export async function generateAnswersWithCustomApi(port, question, session, apiK
|
||||
session.conversationRecords.slice(-config.maxConversationContextLength),
|
||||
false,
|
||||
)
|
||||
prompt.unshift({ role: 'system', content: await getCustomApiPromptBase() })
|
||||
// prompt.unshift({ role: 'system', content: await getCustomApiPromptBase() })
|
||||
prompt.push({ role: 'user', content: question })
|
||||
const apiUrl = config.customModelApiUrl
|
||||
|
||||
|
||||
Reference in New Issue
Block a user