diff --git a/src/api/base/file.ts b/src/api/base/file.ts new file mode 100644 index 0000000..9575ade --- /dev/null +++ b/src/api/base/file.ts @@ -0,0 +1,13 @@ +import { defHttp } from '@/utils/axios/index' +import type { AxiosProgressEvent } from 'axios' +import type { UploadFileParams } from '/#/axios' + +export function uploadApi(params: UploadFileParams, onUploadProgress: (progressEvent: AxiosProgressEvent) => void) { + return defHttp.uploadFile( + { + url: '/qn/iot-system/oss/endpoint/put-file', + onUploadProgress, + }, + params, + ) +} diff --git a/src/api/base/message.ts b/src/api/base/message.ts index 8f13928..aec5a9c 100644 --- a/src/api/base/message.ts +++ b/src/api/base/message.ts @@ -1,5 +1,6 @@ import { defHttp } from '@/utils/axios/index' import type { MenuTypeEnum } from '@/enums/menuEnum' +import type { ModelTypeEnum } from '@/enums/messageEnum' /** * @description 新建会话 @@ -7,6 +8,8 @@ import type { MenuTypeEnum } from '@/enums/menuEnum' export async function addMessage(data: { type: MenuTypeEnum title: string + sort: number + roleId?: string }) { return defHttp.post({ url: `/open-chat/chat/conversation/save`, @@ -42,6 +45,15 @@ export async function conversationList(type: number) { }) } +/** + * @description 对话列表置顶 + */ +export async function conversationToTop(conversationId: string) { + return defHttp.post({ + url: `/open-chat/chat/conversation/top?id=${conversationId}`, + }) +} + /** * @description 对话历史记录 */ @@ -56,17 +68,28 @@ export async function historyMessage(params: { }) } +/** + * @description 停止对话 + */ +export async function stopMessage(data: { conversationId: string }) { + return defHttp.post({ + url: `/open-chat/chat/stopGenerate`, + data, + }) +} + /** * @description 发送消息(文生文) */ export async function sendTextToText(data: { conversationId: string question: string + modelType: ModelTypeEnum }) { return defHttp.post({ url: `/open-chat/chat/session`, data, - timeout: 30 * 1000, + timeout: 60 * 1000, }) } @@ -80,7 +103,21 @@ export async function sendTextToImage(data: { return defHttp.post({ url: `/open-gpts/gpts/getDallEImages`, data, - timeout: 30 * 1000, + timeout: 60 * 1000, + }) +} + +/** + * @description 发送消息(知识库) + */ +export async function sendRepository(data: { + conversationId: string + question: string +}) { + return defHttp.post({ + url: `/open-gpts/gpts/getQanythingStreamChat`, + data, + timeout: 60 * 1000, }) } diff --git a/src/api/base/role.ts b/src/api/base/role.ts index dc49961..16535df 100644 --- a/src/api/base/role.ts +++ b/src/api/base/role.ts @@ -12,3 +12,12 @@ export function getAppList() { url: `/open-chat/roleInfo/app/group/list`, }) } + +/** + * @description: 获取角色描述 + */ +export function getRoleDecs(roleId: string) { + return defHttp.get({ + url: `/open-chat/roleInfo/getRoleDecs?id=${roleId}`, + }) +} diff --git a/src/assets/images/conversation/default_img2.png b/src/assets/images/conversation/default_img2.png new file mode 100644 index 0000000..2232014 Binary files /dev/null and b/src/assets/images/conversation/default_img2.png differ diff --git a/src/assets/images/conversation/default_img3.png b/src/assets/images/conversation/default_img3.png new file mode 100644 index 0000000..38151d0 Binary files /dev/null and b/src/assets/images/conversation/default_img3.png differ diff --git a/src/assets/svg/file.svg b/src/assets/svg/file.svg new file mode 100644 index 0000000..9b9ddf4 --- /dev/null +++ b/src/assets/svg/file.svg @@ -0,0 +1,22 @@ + + + wenjianjia 2 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/svg/image.svg b/src/assets/svg/image.svg new file mode 100644 index 0000000..aadfa13 --- /dev/null +++ b/src/assets/svg/image.svg @@ -0,0 +1,11 @@ + + + shangchuantupian + + + + + + + + \ No newline at end of file diff --git a/src/assets/svg/repository.svg b/src/assets/svg/repository.svg new file mode 100644 index 0000000..98dab3f --- /dev/null +++ b/src/assets/svg/repository.svg @@ -0,0 +1,14 @@ + + + zhishiku07 + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/svg/visual_analysis.svg b/src/assets/svg/visual_analysis.svg new file mode 100644 index 0000000..e9c2c96 --- /dev/null +++ b/src/assets/svg/visual_analysis.svg @@ -0,0 +1,12 @@ + + + tuxiangtianjia + + + + + + + + + \ No newline at end of file diff --git a/src/components/AppConversationDefault/index.d.ts b/src/components/AppConversationDefault/index.d.ts index 7bacb74..9de8263 100644 --- a/src/components/AppConversationDefault/index.d.ts +++ b/src/components/AppConversationDefault/index.d.ts @@ -1,3 +1,18 @@ +import type { TopPickItem } from '@/components/AppTopPicks/index.d' +import type { PictureType } from '@/components/AppPicture/index.d' + +export interface LeadData { + title: string + subTitles: string[] + image: string +} + export interface Props { - height?: string + isPick?: boolean + isHot?: boolean + height: string + leadData?: LeadData + topPickList?: TopPickItem[] + roleList?: PictureType[] + applyList?: PictureType[] } diff --git a/src/components/AppConversationDefault/index.vue b/src/components/AppConversationDefault/index.vue index 0e25d3c..605231a 100644 --- a/src/components/AppConversationDefault/index.vue +++ b/src/components/AppConversationDefault/index.vue @@ -1,9 +1,7 @@