mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-06-27 18:04:15 +08:00
small fix
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { getUserConfig } from '../../config/index.mjs'
|
||||
import { getChatSystemPromptBase, pushRecord, setAbortController } from './shared.mjs'
|
||||
import { pushRecord, setAbortController } from './shared.mjs'
|
||||
import { getConversationPairs } from '../../utils/get-conversation-pairs.mjs'
|
||||
import { fetchSSE } from '../../utils/fetch-sse.mjs'
|
||||
import { isEmpty } from 'lodash-es'
|
||||
@@ -20,7 +20,6 @@ export async function generateAnswersWithAzureOpenaiApi(port, question, session)
|
||||
session.conversationRecords.slice(-config.maxConversationContextLength),
|
||||
false,
|
||||
)
|
||||
prompt.unshift({ role: 'system', content: await getChatSystemPromptBase() })
|
||||
prompt.push({ role: 'user', content: question })
|
||||
|
||||
let answer = ''
|
||||
|
||||
@@ -34,7 +34,6 @@ export async function generateAnswersWithCustomApi(
|
||||
session.conversationRecords.slice(-config.maxConversationContextLength),
|
||||
false,
|
||||
)
|
||||
// prompt.unshift({ role: 'system', content: await getCustomApiPromptBase() })
|
||||
prompt.push({ role: 'user', content: question })
|
||||
|
||||
let answer = ''
|
||||
|
||||
@@ -4,12 +4,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 {
|
||||
getChatSystemPromptBase,
|
||||
getCompletionPromptBase,
|
||||
pushRecord,
|
||||
setAbortController,
|
||||
} from './shared.mjs'
|
||||
import { getCompletionPromptBase, pushRecord, setAbortController } from './shared.mjs'
|
||||
import { getModelValue } from '../../utils/model-name-convert.mjs'
|
||||
|
||||
/**
|
||||
@@ -127,7 +122,6 @@ export async function generateAnswersWithChatgptApiCompat(
|
||||
session.conversationRecords.slice(-config.maxConversationContextLength),
|
||||
false,
|
||||
)
|
||||
prompt.unshift({ role: 'system', content: await getChatSystemPromptBase() })
|
||||
prompt.push({ role: 'user', content: question })
|
||||
|
||||
let answer = ''
|
||||
|
||||
@@ -38,6 +38,7 @@ export async function cropText(
|
||||
const userConfig = await getUserConfig()
|
||||
const k = modelNameToDesc(
|
||||
userConfig.apiMode ? apiModeToModelName(userConfig.apiMode) : userConfig.modelName,
|
||||
null,
|
||||
userConfig.customModelName,
|
||||
).match(/[- (]*([0-9]+)k/)?.[1]
|
||||
if (k) {
|
||||
|
||||
Reference in New Issue
Block a user