diff --git a/api/swagger.yaml b/api/swagger.yaml index fb0013b..9ac90dc 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -83,6 +83,8 @@ definitions: type: object entity.ChatMessage: properties: + assistant: + $ref: '#/definitions/entity.Assistant' assistant_id: description: AssistantId 可以让同一个对话中,使用不同的助手来处理消息 type: integer @@ -119,6 +121,46 @@ definitions: user_file_id: type: integer type: object + entity.ChatMessageList: + properties: + assistant: + properties: + id: + type: integer + name: + type: string + type: object + assistant_id: + type: integer + chat_id: + type: integer + completion_tokens: + type: integer + content: + type: string + created_at: + type: string + file: + $ref: '#/definitions/entity.File' + file_id: + type: integer + hidden: + type: boolean + id: + type: integer + prompt_tokens: + type: integer + role: + type: string + total_tokens: + type: integer + updated_at: + type: string + user_file: + $ref: '#/definitions/entity.UserFile' + user_file_id: + type: integer + type: object entity.Document: properties: chunked: @@ -1619,7 +1661,7 @@ paths: - properties: data: items: - $ref: '#/definitions/entity.ChatMessage' + $ref: '#/definitions/entity.ChatMessageList' type: array type: object "400": diff --git a/src/api/api.ts b/src/api/api.ts index c761e62..988924a 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -383,6 +383,37 @@ export interface ApiV1ChatsIdFilesPostRequest { */ 'file'?: File; } +/** + * + * @export + * @interface ApiV1ChatsIdMessagesGet200Response + */ +export interface ApiV1ChatsIdMessagesGet200Response { + /** + * + * @type {Array} + * @memberof ApiV1ChatsIdMessagesGet200Response + */ + 'data'?: Array; + /** + * + * @type {string} + * @memberof ApiV1ChatsIdMessagesGet200Response + */ + 'error'?: string; + /** + * + * @type {string} + * @memberof ApiV1ChatsIdMessagesGet200Response + */ + 'message'?: string; + /** + * + * @type {boolean} + * @memberof ApiV1ChatsIdMessagesGet200Response + */ + 'success'?: boolean; +} /** * * @export @@ -832,6 +863,12 @@ export interface EntityChat { * @interface EntityChatMessage */ export interface EntityChatMessage { + /** + * + * @type {EntityAssistant} + * @memberof EntityChatMessage + */ + 'assistant'?: EntityAssistant; /** * AssistantId 可以让同一个对话中,使用不同的助手来处理消息 * @type {number} @@ -923,6 +960,128 @@ export interface EntityChatMessage { */ 'user_file_id'?: number; } +/** + * + * @export + * @interface EntityChatMessageList + */ +export interface EntityChatMessageList { + /** + * + * @type {EntityChatMessageListAssistant} + * @memberof EntityChatMessageList + */ + 'assistant'?: EntityChatMessageListAssistant; + /** + * + * @type {number} + * @memberof EntityChatMessageList + */ + 'assistant_id'?: number; + /** + * + * @type {number} + * @memberof EntityChatMessageList + */ + 'chat_id'?: number; + /** + * + * @type {number} + * @memberof EntityChatMessageList + */ + 'completion_tokens'?: number; + /** + * + * @type {string} + * @memberof EntityChatMessageList + */ + 'content'?: string; + /** + * + * @type {string} + * @memberof EntityChatMessageList + */ + 'created_at'?: string; + /** + * + * @type {EntityFile} + * @memberof EntityChatMessageList + */ + 'file'?: EntityFile; + /** + * + * @type {number} + * @memberof EntityChatMessageList + */ + 'file_id'?: number; + /** + * + * @type {boolean} + * @memberof EntityChatMessageList + */ + 'hidden'?: boolean; + /** + * + * @type {number} + * @memberof EntityChatMessageList + */ + 'id'?: number; + /** + * + * @type {number} + * @memberof EntityChatMessageList + */ + 'prompt_tokens'?: number; + /** + * + * @type {string} + * @memberof EntityChatMessageList + */ + 'role'?: string; + /** + * + * @type {number} + * @memberof EntityChatMessageList + */ + 'total_tokens'?: number; + /** + * + * @type {string} + * @memberof EntityChatMessageList + */ + 'updated_at'?: string; + /** + * + * @type {EntityUserFile} + * @memberof EntityChatMessageList + */ + 'user_file'?: EntityUserFile; + /** + * + * @type {number} + * @memberof EntityChatMessageList + */ + 'user_file_id'?: number; +} +/** + * + * @export + * @interface EntityChatMessageListAssistant + */ +export interface EntityChatMessageListAssistant { + /** + * + * @type {number} + * @memberof EntityChatMessageListAssistant + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof EntityChatMessageListAssistant + */ + 'name'?: string; +} /** * * @export @@ -3814,7 +3973,7 @@ export const ChatMessageApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiV1ChatsIdMessagesGet(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async apiV1ChatsIdMessagesGet(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1ChatsIdMessagesGet(id, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ChatMessageApi.apiV1ChatsIdMessagesGet']?.[localVarOperationServerIndex]?.url; @@ -3886,7 +4045,7 @@ export const ChatMessageApiFactory = function (configuration?: Configuration, ba * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiV1ChatsIdMessagesGet(id: number, options?: RawAxiosRequestConfig): AxiosPromise { + apiV1ChatsIdMessagesGet(id: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.apiV1ChatsIdMessagesGet(id, options).then((request) => request(axios, basePath)); }, /** diff --git a/src/components/AssistantMenu.vue b/src/components/AssistantMenu.vue index 1c12f1c..5e6c294 100644 --- a/src/components/AssistantMenu.vue +++ b/src/components/AssistantMenu.vue @@ -3,7 +3,7 @@ - - {{ a.name }} - +
+
+ {{ a.name }} +
+
+ + + +
+
@@ -23,6 +30,7 @@ import { useUserStore } from "../stores/user"; import { updateAll } from "../plugins/update/update"; import { useAssistantStore } from "../stores/assistants"; import { useChatStore } from "@/stores/chat"; +import { CheckmarkOutline } from "@vicons/ionicons5"; const loaded = ref(false); const userStore = useUserStore(); diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 82ad6ae..034e50c 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -20,19 +20,10 @@