mongodb-chatbot-server
Version:
A chatbot server for retrieval augmented generation (RAG).
68 lines • 2.21 kB
TypeScript
import { ConversationsService } from "mongodb-rag-core";
import { Request as ExpressRequest, Response as ExpressResponse, NextFunction } from "express";
import { z } from "zod";
import { UpdateTraceFunc } from "./UpdateTraceFunc";
import { Logger } from "mongodb-rag-core/braintrust";
export type RateMessageRequest = z.infer<typeof RateMessageRequest>;
export declare const RateMessageRequest: 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;
messageId: z.ZodString;
}, "strip", z.ZodTypeAny, {
conversationId: string;
messageId: string;
}, {
conversationId: string;
messageId: string;
}>;
body: z.ZodObject<{
rating: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
rating: boolean;
}, {
rating: boolean;
}>;
}>, "strip", z.ZodTypeAny, {
params: {
conversationId: string;
messageId: string;
};
headers: {
"req-id": string;
};
body: {
rating: boolean;
};
query?: {} | undefined;
}, {
params: {
conversationId: string;
messageId: string;
};
headers: {
"req-id": string;
};
body: {
rating: boolean;
};
query?: {} | undefined;
}>;
export interface RateMessageRouteParams {
conversations: ConversationsService;
updateTrace?: UpdateTraceFunc;
braintrustLogger?: Logger<true>;
}
export declare function makeRateMessageRoute({ conversations, updateTrace, braintrustLogger, }: RateMessageRouteParams): (req: ExpressRequest, res: ExpressResponse<void>, next: NextFunction) => Promise<ExpressResponse<any, Record<string, any>> | undefined>;
//# sourceMappingURL=rateMessage.d.ts.map