UNPKG

@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

21 lines (20 loc) • 1.33 kB
/** * Shared Gemini adapter onto the agentic loop engine. * * Lives in `core/` rather than inside either provider's folder because two * providers use it: Google AI Studio (Task 9) and Vertex Gemini (Task 10). * Both issue the same wire call — `models.generateContentStream` — and consume * the same response shape, so one `executeStep` serves four hand-rolled loops * (each provider has a streaming one and a near-duplicate inside `generate()`). * * Function-name sanitization stays entirely on this side of the engine * boundary, which is the design decision Task 7 recorded rather than a * shortcut. Google requires function names to match a restricted pattern, so * declarations are built with sanitized names and the model calls back with * those same sanitized names. The engine only ever sees plain string names, so * this adapter translates sanitized -> original before returning `toolCalls`, * and original -> sanitized when writing `functionResponse` parts. Neither the * engine nor any other adapter needs to know sanitization happened. */ import type { AgenticLoopAdapter, GeminiLoopAdapterConfig, GeminiStepRaw, GeminiTurnContent } from "../types/index.js"; export declare function createGeminiLoopAdapter(config: GeminiLoopAdapterConfig): AgenticLoopAdapter<GeminiTurnContent[], GeminiStepRaw>;