mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 20:27:45 +00:00
4.6.4-alpha (#569)
This commit is contained in:
68
projects/app/src/global/core/chat/api.d.ts
vendored
68
projects/app/src/global/core/chat/api.d.ts
vendored
@@ -1,7 +1,75 @@
|
||||
import type { AppTTSConfigType } from '@fastgpt/global/core/module/type.d';
|
||||
import { ModuleItemType } from '../module/type';
|
||||
import { AdminFbkType, ChatItemType, moduleDispatchResType } from '@fastgpt/global/core/chat/type';
|
||||
|
||||
export type GetChatSpeechProps = {
|
||||
ttsConfig: AppTTSConfigType;
|
||||
input: string;
|
||||
shareId?: string;
|
||||
};
|
||||
|
||||
/* ---------- chat ----------- */
|
||||
export type InitChatProps = {
|
||||
appId?: string;
|
||||
chatId?: string;
|
||||
};
|
||||
export type InitOutLinkChatProps = {
|
||||
chatId?: string;
|
||||
shareId?: string;
|
||||
outLinkUid?: string;
|
||||
};
|
||||
export type InitChatResponse = {
|
||||
chatId?: string;
|
||||
appId: string;
|
||||
userAvatar?: string;
|
||||
title: string;
|
||||
variables: Record<string, any>;
|
||||
history: ChatItemType[];
|
||||
app: {
|
||||
userGuideModule?: ModuleItemType;
|
||||
chatModels?: string[];
|
||||
name: string;
|
||||
avatar: string;
|
||||
intro: string;
|
||||
canUse?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
/* ---------- history ----------- */
|
||||
export type getHistoriesProps = {
|
||||
appId?: string;
|
||||
// share chat
|
||||
shareId?: string;
|
||||
outLinkUid?: string; // authToken/uid
|
||||
};
|
||||
|
||||
export type UpdateHistoryProps = {
|
||||
chatId: string;
|
||||
customTitle?: string;
|
||||
top?: boolean;
|
||||
shareId?: string;
|
||||
outLinkUid?: string;
|
||||
};
|
||||
|
||||
export type DelHistoryProps = {
|
||||
chatId: string;
|
||||
shareId?: string;
|
||||
outLinkUid?: string;
|
||||
};
|
||||
export type ClearHistoriesProps = {
|
||||
appId?: string;
|
||||
shareId?: string;
|
||||
outLinkUid?: string;
|
||||
};
|
||||
|
||||
/* -------- chat item ---------- */
|
||||
export type DeleteChatItemProps = {
|
||||
chatId: string;
|
||||
contentId: string;
|
||||
shareId?: string;
|
||||
outLinkUid?: string;
|
||||
};
|
||||
|
||||
export type AdminUpdateFeedbackParams = AdminFbkType & {
|
||||
chatItemId: string;
|
||||
};
|
||||
|
15
projects/app/src/global/core/chat/constants.ts
Normal file
15
projects/app/src/global/core/chat/constants.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { InitChatResponse } from './api';
|
||||
|
||||
export const defaultChatData: InitChatResponse = {
|
||||
chatId: '',
|
||||
appId: '',
|
||||
app: {
|
||||
name: 'Loading',
|
||||
avatar: '/icon/logo.svg',
|
||||
intro: '',
|
||||
canUse: false
|
||||
},
|
||||
title: '新对话',
|
||||
variables: {},
|
||||
history: []
|
||||
};
|
@@ -33,9 +33,8 @@ export const Prompt_QuotePromptList: PromptTemplateItem[] = [
|
||||
"""
|
||||
回答要求:
|
||||
1. 优先使用知识库内容回答问题。
|
||||
2. 你可以回答我不知道。
|
||||
3. 不要提及你是从知识库获取的知识。
|
||||
4. 知识库包含 markdown 内容时,按 markdown 格式返回。
|
||||
2. 不要提及你是从知识库获取的知识。
|
||||
3. 知识库包含 markdown 内容时,按 markdown 格式返回。
|
||||
我的问题是:"{{question}}"`
|
||||
},
|
||||
{
|
||||
@@ -47,9 +46,8 @@ export const Prompt_QuotePromptList: PromptTemplateItem[] = [
|
||||
"""
|
||||
回答要求:
|
||||
1. 优先使用知识库内容回答问题,其中 instruction 是相关介绍,output 是预期回答或补充。
|
||||
2. 你可以回答我不知道。
|
||||
3. 不要提及你是从知识库获取的知识。
|
||||
4. 知识库包含 markdown 内容时,按 markdown 格式返回。
|
||||
2. 不要提及你是从知识库获取的知识。
|
||||
3. 知识库包含 markdown 内容时,按 markdown 格式返回。
|
||||
我的问题是:"{{question}}"`
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user