import { BadRequestException, NotFoundException } from '@nestjs/common'; import { AiPromptRole } from '@prisma/client'; import { CurrentUser } from '../../core/auth'; import { PermissionService } from '../../core/workspaces/permission'; import { FileUpload, MutexService, TooManyRequest } from '../../fundamentals'; import { PromptService } from './prompt'; import { ChatSessionService } from './session'; import { CopilotStorage } from './storage'; import { AvailableModels, type ListHistoriesOptions, SubmittedMessage } from './types'; export declare const COPILOT_LOCKER = "copilot"; declare class CreateChatSessionInput { workspaceId: string; docId: string; promptName: string; } declare class ForkChatSessionInput { workspaceId: string; docId: string; sessionId: string; latestMessageId: string; } declare class DeleteSessionInput { workspaceId: string; docId: string; sessionIds: string[]; } declare class CreateChatMessageInput implements Omit { sessionId: string; content: string | undefined; attachments: string[] | undefined; blobs: Promise[] | undefined; params: Record | undefined; } declare class QueryChatHistoriesInput implements Partial { action: boolean | undefined; fork: boolean | undefined; limit: number | undefined; skip: number | undefined; messageOrder: 'asc' | 'desc' | undefined; sessionOrder: 'asc' | 'desc' | undefined; sessionId: string | undefined; } declare class CopilotPromptConfigType { jsonMode: boolean | null; frequencyPenalty: number | null; presencePenalty: number | null; temperature: number | null; topP: number | null; } declare class CopilotPromptMessageType { role: AiPromptRole; content: string; params: Record | null; } export declare class CopilotType { workspaceId: string | undefined; } export declare class CopilotResolver { private readonly permissions; private readonly mutex; private readonly chatSession; private readonly storage; constructor(permissions: PermissionService, mutex: MutexService, chatSession: ChatSessionService, storage: CopilotStorage); getQuota(user: CurrentUser): Promise<{ limit: number | undefined; used: number; }>; chats(copilot: CopilotType, user: CurrentUser): Promise; actions(copilot: CopilotType, user: CurrentUser): Promise; histories(copilot: CopilotType, user: CurrentUser, docId?: string, options?: QueryChatHistoriesInput): Promise<{ messages: ({ content: string; role: "user" | "system" | "assistant"; params?: Record | string[]> | null | undefined; attachments?: string[] | null | undefined; } | { content: string; createdAt: Date; role: "user" | "system" | "assistant"; id?: string | undefined; params?: Record | string[]> | null | undefined; attachments?: string[] | null | undefined; })[]; createdAt: Date; sessionId: string; tokens: number; action?: string | undefined; }[]>; createCopilotSession(user: CurrentUser, options: CreateChatSessionInput): Promise; forkCopilotSession(user: CurrentUser, options: ForkChatSessionInput): Promise; cleanupCopilotSession(user: CurrentUser, options: DeleteSessionInput): Promise; createCopilotMessage(user: CurrentUser, options: CreateChatMessageInput): Promise; } export declare class UserCopilotResolver { private readonly permissions; constructor(permissions: PermissionService); copilot(user: CurrentUser, workspaceId?: string): Promise<{ workspaceId: string | undefined; }>; } declare class CreateCopilotPromptInput { name: string; model: AvailableModels; action: string | null; config: CopilotPromptConfigType | null; messages: CopilotPromptMessageType[]; } export declare class PromptsManagementResolver { private readonly promptService; constructor(promptService: PromptService); listCopilotPrompts(): Promise<{ name: string; messages: { content: string; params: import(".prisma/client").Prisma.JsonValue; role: import(".prisma/client").$Enums.AiPromptRole; }[]; config: import(".prisma/client").Prisma.JsonValue; action: string | null; model: string; }[]>; createCopilotPrompt(input: CreateCopilotPromptInput): Promise; updateCopilotPrompt(name: string, messages: CopilotPromptMessageType[]): Promise; } export {}; //# sourceMappingURL=resolver.d.ts.map