41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import type { Ref } from 'vue';
|
|
import type { BubbleListProps } from '@/components/xt-chat/xt-bubble/types';
|
|
|
|
// 定义角色常量
|
|
export const LOADING_ROLE = 'loading'; // 加载中
|
|
export const INTELLECTUAL_THINKING_ROLE = 'intellectual_thinking'; // 智能思考标题
|
|
export const QUESTION_ROLE = 'question';
|
|
export const ANSWER_ROLE = 'text';
|
|
export const FILE_ROLE = 'file';
|
|
export const THOUGHT_ROLE = 'thought';
|
|
|
|
export const ROLE_STYLE = {
|
|
width: '600px',
|
|
margin: '0 auto',
|
|
};
|
|
|
|
export const ANSWER_STYLE = {
|
|
...ROLE_STYLE,
|
|
paddingLeft: '12px',
|
|
borderLeft: '1px solid #E6E6E8',
|
|
position: 'relative',
|
|
left: '6px',
|
|
};
|
|
|
|
export interface UseChatHandlerReturn {
|
|
roles: BubbleListProps['roles'];
|
|
currentTaskId: Ref<string | null>;
|
|
handleMessage: (parsedData: { event: string; data: MESSAGE.Answer }) => void;
|
|
handleOpen: (data: Response) => void;
|
|
generateLoading: Ref<boolean>;
|
|
conversationList: Ref<any[]>;
|
|
showRightView: Ref<boolean>;
|
|
rightViewInfo: Ref<any>;
|
|
senderRef: Ref<null>
|
|
}
|
|
export enum EnumTeamRunStatus {
|
|
TeamRunStarted = 'TeamRunStarted', // 开始
|
|
TeamRunResponseContent = 'TeamRunResponseContent', // 执行中
|
|
TeamRunCompleted = 'TeamRunCompleted', // 完成
|
|
}
|