UNPKG

mongodb-chatbot-server

Version:

A chatbot server for retrieval augmented generation (RAG).

69 lines 2.39 kB
import { ConversationsService } from "mongodb-rag-core"; import { Request as ExpressRequest, Response as ExpressResponse } from "express"; import { ApiConversation } from "./utils"; import { z } from "zod"; export type GetConversationRequest = z.infer<typeof GetConversationRequest>; export declare const GetConversationRequest: z.ZodObject<z.objectUtil.extendShape<{ headers: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>; params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>; query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>; body: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>; }, { 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; }>; }>, "strip", z.ZodTypeAny, { params: { conversationId: string; }; headers: { "req-id": string; }; query?: {} | undefined; body?: {} | undefined; }, { params: { conversationId: string; }; headers: { "req-id": string; }; query?: {} | undefined; body?: {} | undefined; }>; export interface GetConversationRouteParams { conversations: ConversationsService; } export declare function makeGetConversationRoute({ conversations, }: GetConversationRouteParams): (req: ExpressRequest, res: ExpressResponse<ApiConversation>) => Promise<ExpressResponse<{ createdAt: number; _id: string; messages: { role: "function" | "user" | "assistant" | "system"; id: string; content: string; createdAt: number; rating?: boolean | undefined; metadata?: Record<string, unknown> | undefined; references?: { url: string; title: string; metadata?: z.objectOutputType<{ sourceName: z.ZodOptional<z.ZodString>; sourceType: z.ZodOptional<z.ZodString>; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough"> | undefined; }[] | undefined; }[]; }, Record<string, any>> | undefined>; //# sourceMappingURL=getConversation.d.ts.map