@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
18 lines (17 loc) • 811 B
TypeScript
/**
* Local `wrapLanguageModel`.
*
* Upstream is a reduce over the middleware array that returns a model whose
* `doGenerate` / `doStream` route through `transformParams` and the optional
* `wrapGenerate` / `wrapStream` hooks. Reproduced here so the middleware
* factory no longer needs the ai package.
*
* The OpenAI-compatible streaming path also uses this wrapper. Other native
* streaming implementations must opt in explicitly; exposing a middleware
* option or a model-shaped handle alone does not apply the chain.
*/
import type { LanguageModelV3, LanguageModelV3Middleware } from "../types/index.js";
export declare const wrapLanguageModel: ({ model, middleware, }: {
model: LanguageModelV3;
middleware: LanguageModelV3Middleware | LanguageModelV3Middleware[];
}) => LanguageModelV3;