|
|
import type { Request } from "express"; |
|
|
|
|
|
import { ProxyReqManager } from "./proxy-req-manager"; |
|
|
export { |
|
|
createPreprocessorMiddleware, |
|
|
createEmbeddingsPreprocessorMiddleware, |
|
|
} from "./preprocessor-factory"; |
|
|
|
|
|
|
|
|
export { applyQuotaLimits } from "./preprocessors/apply-quota-limits"; |
|
|
export { blockZoomerOrigins } from "./preprocessors/block-zoomer-origins"; |
|
|
export { countPromptTokens } from "./preprocessors/count-prompt-tokens"; |
|
|
export { languageFilter } from "./preprocessors/language-filter"; |
|
|
export { setApiFormat } from "./preprocessors/set-api-format"; |
|
|
export { transformOutboundPayload } from "./preprocessors/transform-outbound-payload"; |
|
|
export { validateContextSize } from "./preprocessors/validate-context-size"; |
|
|
export { validateModelFamily } from "./preprocessors/validate-model-family"; |
|
|
export { validateVision } from "./preprocessors/validate-vision"; |
|
|
|
|
|
|
|
|
export { addKey, addKeyForEmbeddingsRequest } from "./mutators/add-key"; |
|
|
export { addAzureKey } from "./mutators/add-azure-key"; |
|
|
export { finalizeBody } from "./mutators/finalize-body"; |
|
|
export { finalizeSignedRequest } from "./mutators/finalize-signed-request"; |
|
|
export { signAwsRequest } from "./mutators/sign-aws-request"; |
|
|
export { signGcpRequest } from "./mutators/sign-vertex-ai-request"; |
|
|
export { stripHeaders } from "./mutators/strip-headers"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export type RequestPreprocessor = (req: Request) => void | Promise<void>; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export type ProxyReqMutator = ( |
|
|
changeManager: ProxyReqManager |
|
|
) => void | Promise<void>; |
|
|
|