4.8.10 test (#2539)

* fix: i18n

* fix: null value

* fix: workflow refresh variables

* perf: copy data

* doc

* perf: run app code

* perf: variable store

* update doc

* perf: pay ui

* fix: log header ui

* fix: log header ui
This commit is contained in:
Archer
2024-08-27 19:48:42 +08:00
committed by GitHub
parent 454a479fd8
commit c9bb39d802
20 changed files with 87 additions and 118 deletions

View File

@@ -5,7 +5,6 @@ import { ChatItemValueTypeEnum, ChatRoleEnum } from '@fastgpt/global/core/chat/c
import { delFileByFileIdList, getGFSCollection } from '../../common/file/gridfs/controller';
import { BucketNameEnum } from '@fastgpt/global/common/file/constants';
import { MongoChat } from './chatSchema';
import { ChatSchema as ChatType } from '@fastgpt/global/core/chat/type.d';
export async function getChatItems({
appId,
@@ -37,24 +36,6 @@ export async function getChatItems({
return { histories };
}
export async function getChat({
appId,
chatId,
field
}: {
appId: string;
chatId?: string;
field: string;
}): Promise<{ chat: ChatType | null }> {
if (!chatId) {
return { chat: null };
}
const chat = await MongoChat.findOne({ appId, chatId }, field).lean();
return { chat };
}
/* Temporary adaptation for old conversation records */
export const adaptStringValue = (value: any): ChatItemValueItemType[] => {
if (typeof value === 'string') {

View File

@@ -357,7 +357,7 @@ async function streamResponse({
const responseChoice = part.choices?.[0]?.delta;
// console.log(responseChoice, '---===');
if (responseChoice.content) {
if (responseChoice?.content) {
const content = responseChoice?.content || '';
textAnswer += content;