UNPKG

mongodb-chatbot-server

Version:

A chatbot server for retrieval augmented generation (RAG).

23 lines 979 B
import { Request as ExpressRequest, Response as ExpressResponse } from "express"; /** Checks for req-id Request Header. Returns an empty string if the header is not a truthy string. @param req */ export declare function getRequestId<T extends ExpressRequest>(req: T): string; export interface LogRequestParams { reqId: string; message: string; type?: "info" | "error" | "warn"; } export declare const logRequest: ({ reqId, message, type, }: LogRequestParams) => void; export interface ErrorResponseParams { reqId: string; res: ExpressResponse; httpStatus: number; errorMessage: string; errorDetails?: string; } export declare const sendErrorResponse: ({ reqId, res, httpStatus, errorMessage, errorDetails, }: ErrorResponseParams) => ExpressResponse<any, Record<string, any>> | undefined; export declare function retryAsyncOperation<T>(promise: Promise<T>, retries?: number, delayMs?: number): Promise<T>; //# sourceMappingURL=utils.d.ts.map