| 12345678910111213141516171819202122232425262728293031323334 |
- import generateClientUniqueId from '../../utils/generate-client-unique-id';
- import { getIcon4Question } from './get-icon-4-dialog';
- /**
- * 组装客户端用户提问的数据
- */
- export default function formatDialogQuestionByClient(text, client_file_list, agentInfo) {
- const cur_stamp = Date.now();
- const icon_src = getIcon4Question(agentInfo);
- return {
- /**
- * 此项的类别
- * a 智能体的回答
- * q 客户端的提问
- */
- client_custom_item_type: 'q', // 提问
- client_custom_create_time: cur_stamp, // 创建的时间戳
- client_custom_unique_id: generateClientUniqueId(text + cur_stamp),
- /**
- * 客户端上传的文件列表
- * 如果有此参数,则需要在问题处进行展示
- */
- client_custom_upload_file_list: client_file_list,
- // 图标
- client_custom_icon: icon_src,
- question: text
- };
- }
|