2025-08-25 18:01:04 +08:00
|
|
|
import type { Ref } from 'vue';
|
|
|
|
|
import type { BubbleListProps } from '@/components/xt-chat/xt-bubble/types';
|
|
|
|
|
|
|
|
|
|
// 定义角色常量
|
2025-08-26 17:59:42 +08:00
|
|
|
export const LOADING_ROLE = 'loading'; // 加载中
|
|
|
|
|
export const INTELLECTUAL_THINKING_ROLE = 'intellectual_thinking'; // 智能思考标题
|
2025-08-27 18:07:36 +08:00
|
|
|
export const QUESTION_ROLE = 'question'; // 问题
|
|
|
|
|
export const ANSWER_ROLE = 'answer'; // 回答
|
|
|
|
|
export const REMOTE_USER_ROLE = 'user'; // 接口返回用户
|
|
|
|
|
export const REMOTE_ASSISTANT_ROLE = 'assistant'; // 接口返回智能体
|
2025-08-25 18:01:04 +08:00
|
|
|
|
|
|
|
|
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 {
|
2025-08-27 17:41:10 +08:00
|
|
|
roles?: BubbleListProps['roles'];
|
2025-08-28 14:13:59 +08:00
|
|
|
generateTeamRunTaskId?: Ref<string | null>;
|
2025-08-27 17:41:10 +08:00
|
|
|
handleMessage?: (parsedData: { event: string; data: MESSAGE.Answer }) => void;
|
|
|
|
|
handleOpen?: (data: Response) => void;
|
|
|
|
|
generateLoading?: Ref<boolean>;
|
|
|
|
|
conversationList?: Ref<any[]>;
|
|
|
|
|
showRightView?: Ref<boolean>;
|
2025-08-28 12:03:52 +08:00
|
|
|
rightViewData?: Ref<any>;
|
2025-08-27 17:41:10 +08:00
|
|
|
senderRef?: Ref<null>
|
2025-08-26 17:59:42 +08:00
|
|
|
}
|
|
|
|
|
export enum EnumTeamRunStatus {
|
2025-08-27 12:04:23 +08:00
|
|
|
TeamRunStarted = 'TeamRunStarted', // 对话开始
|
|
|
|
|
TeamRunResponseContent = 'TeamRunResponseContent', // 对话执行中
|
|
|
|
|
TeamRunCompleted = 'TeamRunCompleted', // 对话完成
|
|
|
|
|
RunStarted = 'RunStarted', // l2开始运行
|
|
|
|
|
RunResponseContent = 'RunResponseContent', // l2执行中
|
|
|
|
|
RunCompleted = 'RunCompleted', // l2完成
|
2025-08-25 18:01:04 +08:00
|
|
|
}
|
2025-08-27 17:18:47 +08:00
|
|
|
|
|
|
|
|
export const FILE_TYPE = {
|
|
|
|
|
topic_only: 'topic_only', // 排期&选题
|
|
|
|
|
topic_with_content: 'topic_with_content', // 选题&内容稿件
|
|
|
|
|
content_only: 'content_only', // 内容稿件
|
|
|
|
|
}
|
|
|
|
|
export const FILE_TYPE_MAP = {
|
|
|
|
|
[FILE_TYPE.topic_only]: '排期&选题',
|
|
|
|
|
[FILE_TYPE.topic_with_content]: '选题&内容稿件',
|
|
|
|
|
[FILE_TYPE.content_only]: '内容稿件',
|
|
|
|
|
}
|