@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
29 lines (28 loc) • 1.46 kB
TypeScript
/**
* LiveKit Agents agent definition — realtime (speech-to-speech).
*
* `defineRealtimeVoiceAgent` returns the agent object placed as the default
* export of a worker entry file. Unlike the cascaded `defineVoiceAgent`
* (Silero VAD → STT → NeuroLink → TTS), here a single realtime model (Gemini
* Live on Vertex, or xAI Grok Voice) does STT + reasoning + TTS + turn
* detection over one connection. The backend is chosen by `VOICE_REALTIME_BACKEND`
* or the `backend` option; Gemini Live is the default.
*
* `@livekit/agents`, the backend's LiveKit plugin (see `realtimeModel.ts`),
* `@livekit/rtc-node`, and `@google/genai` are imported dynamically so the core
* package does not require them unless the realtime agent is used. Type-only
* imports are erased at build.
*
* See docs/features/livekit-voice-agent.md.
*/
import type { AgentDefinition } from "@livekit/agents";
import type { RealtimeVoiceAgentConfig } from "../../types/index.js";
/**
* Define a realtime (speech-to-speech) LiveKit voice agent: Gemini Live by
* default, xAI Grok Voice with `VOICE_REALTIME_BACKEND=xai` or `backend: "xai"`.
*
* Place the result as the default export of the worker entry file and launch it
* with `startRealtimeVoiceAgentWorker`. With no `config` everything is resolved
* from the environment (see `resolveRealtimeVoiceConfig`).
*/
export declare function defineRealtimeVoiceAgent(config?: RealtimeVoiceAgentConfig): AgentDefinition;