@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
27 lines (26 loc) • 1.51 kB
TypeScript
import type { RequestKind, RequestKindInput } from "../types/index.js";
/**
* The dispatch decision for "what kind of request is this" — text, image,
* video, music, avatar, direct TTS synthesis, or PPT generation — at the
* CORE call sites: neurolink.ts's maybeHandleEarlyGenerateResult
* (music/avatar/ppt/workflow routing) and baseProvider.ts's
* stream()/runGenerateInActiveContext (image/video/tts-direct routing) call
* this instead of independently re-deriving the decision.
*
* Also the only copy at the provider-override level: replicate.ts's
* generate() override and googleVertex/client.ts's generate()/stream()
* overrides (which bypass BaseProvider's paths) call this too, so an edit
* to this precedence table reaches every dispatch site.
*
* Precedence, checked in order:
* 1. output.mode (music/avatar/video/ppt) — an explicit mode always wins.
* 2. an image-generation model, unless the caller explicitly asked for a
* non-image output.format (json/structured/text) — this lets dual-mode
* models like gemini-3.1-flash-image-preview still perform text or
* structured generation when requested.
* 3. tts.enabled without tts.useAiResponse — direct synthesis, bypassing
* the LLM turn entirely (useAiResponse means the LLM's own text
* response gets synthesized afterward, which is NOT this branch).
* 4. otherwise, "text".
*/
export declare function resolveRequestKind(options: RequestKindInput, modelName?: string): RequestKind;