Skip to content

Commit 5faa395

Browse files
committed
small fix
1 parent 524f154 commit 5faa395

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

src/services/apis/azure-openai-api.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getUserConfig } from '../../config/index.mjs'
2-
import { getChatSystemPromptBase, pushRecord, setAbortController } from './shared.mjs'
2+
import { pushRecord, setAbortController } from './shared.mjs'
33
import { getConversationPairs } from '../../utils/get-conversation-pairs.mjs'
44
import { fetchSSE } from '../../utils/fetch-sse.mjs'
55
import { isEmpty } from 'lodash-es'
@@ -20,7 +20,6 @@ export async function generateAnswersWithAzureOpenaiApi(port, question, session)
2020
session.conversationRecords.slice(-config.maxConversationContextLength),
2121
false,
2222
)
23-
prompt.unshift({ role: 'system', content: await getChatSystemPromptBase() })
2423
prompt.push({ role: 'user', content: question })
2524

2625
let answer = ''

src/services/apis/custom-api.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export async function generateAnswersWithCustomApi(
3434
session.conversationRecords.slice(-config.maxConversationContextLength),
3535
false,
3636
)
37-
// prompt.unshift({ role: 'system', content: await getCustomApiPromptBase() })
3837
prompt.push({ role: 'user', content: question })
3938

4039
let answer = ''

src/services/apis/openai-api.mjs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ import { getUserConfig } from '../../config/index.mjs'
44
import { fetchSSE } from '../../utils/fetch-sse.mjs'
55
import { getConversationPairs } from '../../utils/get-conversation-pairs.mjs'
66
import { isEmpty } from 'lodash-es'
7-
import {
8-
getChatSystemPromptBase,
9-
getCompletionPromptBase,
10-
pushRecord,
11-
setAbortController,
12-
} from './shared.mjs'
7+
import { getCompletionPromptBase, pushRecord, setAbortController } from './shared.mjs'
138
import { getModelValue } from '../../utils/model-name-convert.mjs'
149

1510
/**
@@ -127,7 +122,6 @@ export async function generateAnswersWithChatgptApiCompat(
127122
session.conversationRecords.slice(-config.maxConversationContextLength),
128123
false,
129124
)
130-
prompt.unshift({ role: 'system', content: await getChatSystemPromptBase() })
131125
prompt.push({ role: 'user', content: question })
132126

133127
let answer = ''

src/utils/crop-text.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export async function cropText(
3838
const userConfig = await getUserConfig()
3939
const k = modelNameToDesc(
4040
userConfig.apiMode ? apiModeToModelName(userConfig.apiMode) : userConfig.modelName,
41+
null,
4142
userConfig.customModelName,
4243
).match(/[- (]*([0-9]+)k/)?.[1]
4344
if (k) {

0 commit comments

Comments
 (0)