From 660130a0bc52e10fb61ad4fd9cf8a98b8e666dae Mon Sep 17 00:00:00 2001 From: Stanislas Polu Date: Fri, 1 Sep 2023 15:06:38 +0200 Subject: [PATCH] move to folder --- front/types/assistant.ts | 119 --------------------------------------- 1 file changed, 119 deletions(-) delete mode 100644 front/types/assistant.ts diff --git a/front/types/assistant.ts b/front/types/assistant.ts deleted file mode 100644 index 3bc3e7e4f3bd..000000000000 --- a/front/types/assistant.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { ModelId } from "@app/lib/models"; - -import { UserProviderType, UserType } from "./user"; - -/** - * Mentions - */ - -export type AssistantAgentMention = { - assistantId: string; -}; - -export type AssistantUserMention = { - provider: UserProviderType; - providerId: string; -}; - -export type AssistantMention = AssistantAgentMention | AssistantUserMention; - -/** - * User messages - */ - -export type AssistantUserMessageType = { - id: ModelId; - sId: string; - status: "visible" | "deleted"; - parentMessageId: string; - user?: UserType; - mentions: AssistantMention[]; - message: string; - context: { - username: string; - timezone: string; - fullName?: string; - email?: string; - profilePictureUrl?: string; - }; -}; - -/** - * Retrieval action - */ - -export type AssistantUserFeedbackType = { - user: UserType; - value: "positive" | "negative" | null; - comment?: string; -}; - -export type AssistantRetrievalDocumentType = { - id: ModelId; - dataSourceId: string; - sourceUrl?: string; - documentId: string; - timestamp: number; - tags: string[]; - score: number; - chunks: { - text: string; - offset: number; - score: number; - }[]; -}; - -export type AssistantRetrievalActionType = { - id: ModelId; - params: { - query: string; - }; - documents: AssistantRetrievalDocumentType[]; -}; - -/** - * Agent messages - */ - -export type AssistantAgentActionType = AssistantRetrievalActionType; - -/** - * Both `action` and `message` are optional (we could have a no-op agent basically). - * - * Since `action` and `message` are bundled together, it means that we will only be able to retry - * them together in case of error of either. We store an error only here whether it's an error - * coming from the action or from the message generation. - */ -export type AssistantAgentMessageType = { - id: ModelId; - sId: string; - status: "visible" | "deleted"; - parentMessageId: string; - action?: AssistantAgentActionType; - message?: string; - feedbacks: AssistantUserFeedbackType[]; - error?: { - code: string; - message: string; - }; -}; - -/** - * Conversations - */ - -export type AssistantConversationVisibility = "private" | "workspace"; - -/** - * content [][] structure is intended to allow retries (of agent messages) or edits (of user - * messages). - */ -export type AssistantConversationType = { - id: ModelId; - created: number; - sId: string; - title?: string; - participants: UserType[]; - content: (AssistantUserMessageType[] | AssistantAgentMessageType[])[]; - visibility: AssistantConversationVisibility; -};