import { Request as ExpressRequest, Response as ExpressResponse } from "express"; import { SystemMessage } from "mongodb-rag-core"; import { ConversationsService, ChatLlm } from "mongodb-rag-core"; import { ApiMessage } from "./utils"; import { z } from "zod"; import { AddCustomDataFunc, ConversationsRouterLocals } from "./conversationsRouter"; import { GenerateUserPromptFunc } from "../../processors/GenerateUserPromptFunc"; import { FilterPreviousMessages } from "../../processors/FilterPreviousMessages"; import { Logger } from "mongodb-rag-core/braintrust"; import { UpdateTraceFunc } from "./UpdateTraceFunc"; export declare const DEFAULT_MAX_INPUT_LENGTH = 3000; export declare const DEFAULT_MAX_USER_MESSAGES_IN_CONVERSATION = 7; export type AddMessageRequestBody = z.infer; export declare const AddMessageRequestBody: z.ZodObject<{ message: z.ZodString; clientContext: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, "strip", z.ZodTypeAny, { message: string; clientContext?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; }, { message: string; clientContext?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; }>; export declare const AddMessageRequest: z.ZodObject>; params: z.ZodOptional>; query: z.ZodOptional>; body: z.ZodOptional>; }, { headers: z.ZodObject<{ "req-id": z.ZodString; }, "strip", z.ZodTypeAny, { "req-id": string; }, { "req-id": string; }>; params: z.ZodObject<{ conversationId: z.ZodString; }, "strip", z.ZodTypeAny, { conversationId: string; }, { conversationId: string; }>; query: z.ZodObject<{ stream: z.ZodOptional; }, "strip", z.ZodTypeAny, { stream?: string | undefined; }, { stream?: string | undefined; }>; body: z.ZodObject<{ message: z.ZodString; clientContext: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, "strip", z.ZodTypeAny, { message: string; clientContext?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; }, { message: string; clientContext?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; }>; }>, "strip", z.ZodTypeAny, { params: { conversationId: string; }; headers: { "req-id": string; }; query: { stream?: string | undefined; }; body: { message: string; clientContext?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; }; }, { params: { conversationId: string; }; headers: { "req-id": string; }; query: { stream?: string | undefined; }; body: { message: string; clientContext?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; }; }>; export type AddMessageRequest = z.infer; export interface AddMessageToConversationRouteParams { conversations: ConversationsService; llm: ChatLlm; generateUserPrompt?: GenerateUserPromptFunc; filterPreviousMessages?: FilterPreviousMessages; maxInputLengthCharacters?: number; maxUserMessagesInConversation?: number; addMessageToConversationCustomData?: AddCustomDataFunc; /** If present, the route will create a new conversation when given the `conversationIdPathParam` in the URL. */ createConversation?: { /** Create a new conversation when the `conversationId` is the string "null". */ createOnNullConversationId: boolean; /** The custom data to add to the new conversation when it is created. */ addCustomData?: AddCustomDataFunc; /** The system message to add to the new conversation when it is created. */ systemMessage?: SystemMessage; }; /** Custom function to update the Braintrust tracing after the response has been sent to the user. Can add additional tags, scores, etc. */ updateTrace?: UpdateTraceFunc; braintrustLogger?: Logger; } export declare function makeAddMessageToConversationRoute({ conversations, llm, generateUserPrompt, maxInputLengthCharacters, maxUserMessagesInConversation, filterPreviousMessages, addMessageToConversationCustomData, createConversation, updateTrace, }: AddMessageToConversationRouteParams): (req: ExpressRequest, res: ExpressResponse) => Promise | undefined; references?: { url: string; title: string; metadata?: z.objectOutputType<{ sourceName: z.ZodOptional; /** Create a new conversation when the `conversationId` is the string "null". */ sourceType: z.ZodOptional; tags: z.ZodOptional>; }, z.ZodTypeAny, "passthrough"> | undefined; }[] | undefined; }, ConversationsRouterLocals> | undefined>; //# sourceMappingURL=addMessageToConversation.d.ts.map