Compare commits

..

No commits in common. "master" and "0.0.21" have entirely different histories.

2 changed files with 3 additions and 9 deletions

View File

@ -80,7 +80,6 @@ async function removeConversation(convId: string, ticket: string) {
async function createCompletion(
model = MODEL_NAME,
messages: any[],
searchType: string = '',
ticket: string,
refConvId = '',
retryCount = 0
@ -130,8 +129,7 @@ async function createCompletion(
sessionType: "text_chat",
parentMsgId,
params: {
"fileUploadBatchId": util.uuid(),
"searchType": searchType,
"fileUploadBatchId": util.uuid()
},
contents: messagesPrepare(messages, refs, !!refConvId),
})
@ -175,7 +173,6 @@ async function createCompletion(
async function createCompletionStream(
model = MODEL_NAME,
messages: any[],
searchType: string = '',
ticket: string,
refConvId = '',
retryCount = 0
@ -223,8 +220,7 @@ async function createCompletionStream(
sessionType: "text_chat",
parentMsgId,
params: {
"fileUploadBatchId": util.uuid(),
"searchType": searchType,
"fileUploadBatchId": util.uuid()
},
contents: messagesPrepare(messages, refs, !!refConvId),
})

View File

@ -17,12 +17,11 @@ export default {
const tokens = chat.tokenSplit(request.headers.authorization);
// 随机挑选一个ticket
const token = _.sample(tokens);
const { model, conversation_id: convId, messages, search_type, stream } = request.body;
const { model, conversation_id: convId, messages, stream } = request.body;
if (stream) {
const stream = await chat.createCompletionStream(
model,
messages,
search_type,
token,
convId
);
@ -33,7 +32,6 @@ export default {
return await chat.createCompletion(
model,
messages,
search_type,
token,
convId
);