Generated from crates/node/typed.d.ts.
Import from nemo-relay-node/typed.
Typed wrappers for NeMo Relay Node.js execute APIs.
JsonObjectA JSON object with recursively JSON-serializable values.
JsonArrayA JSON array with recursively JSON-serializable values.
LlmRequestShapeCanonical JSON shape for an opaque LLM request payload.
LlmCodecA codec for annotating and unwrapping LLM JSON request payloads.
Use when an LLM integration needs custom request parsing or normalization before the raw payload is passed through the NeMo Relay LLM middleware pipeline.
LlmResponseCodecA codec for normalizing and decoding raw LLM responses into JsonValue.
Use when model output requires custom parsing or normalization before the response is consumed as plain JSON by the library.
CodecA codec that converts between a typed value T and a JSON-serializable representation (JsonValue by default).
TypedToolExecuteOptionsOptions for typedToolExecute.
TypedLlmExecuteOptionsOptions for typedLlmExecute.
TypedLlmStreamExecuteOptionsOptions for typedLlmStreamExecute.
JsonPassthroughA passthrough codec that performs no conversion. Use when arguments or results are already plain JSON objects.
typedToolExecuteExecute a typed tool call through the JSON middleware pipeline.
Converts args to JSON, runs the native tool execution lifecycle, and decodes the final JSON result back into the caller’s typed result shape.
Parameters
name: Tool name.args: Typed tool arguments.func: The tool implementation.argsCodec: Codec for args serialization/deserialization.resultCodec: Codec for result serialization/deserialization.options: Optional scope handle, attributes, data, metadata.Returns
A promise resolving to the decoded typed tool result.
Remarks
The wrapper accepts both synchronous and promise-returning tool implementations; codec failures and native execution errors propagate to the returned promise.
typedLlmExecuteExecute a typed LLM call through the JSON middleware pipeline.
Forwards the JSON-shaped request payload into the native LLM lifecycle and decodes the final response with the supplied response codec before resolving.
Parameters
name: Model/provider name.request: The LLM request object ({headers, content}).func: The LLM implementation.responseCodec: Codec for response serialization/deserialization.options: Optional scope handle, attributes, data, metadata, modelName.Returns
A promise resolving to the decoded typed LLM response.
Remarks
options.responseCodec only affects annotated response event payloads; failures while decoding those event payloads are downgraded to debug logging and do not rewrite the caller-visible response.
typedLlmStreamExecuteExecute a typed streaming LLM call through the JSON middleware pipeline.
Chunks yielded by func are converted to JSON via chunkCodec.toJson before entering the middleware pipeline. After interception, chunks are converted back via chunkCodec.fromJson before reaching collector. The finalizer result is converted via responseCodec.toJson.
Parameters
name: Model/provider name.request: The LLM request object ({headers, content}).func: Async iterable producer for typed stream chunks.collector: Callback invoked with each decoded typed chunk.finalizer: Callback that returns the final typed aggregate response.chunkCodec: Codec for stream chunk serialization/deserialization.responseCodec: Codec for final response serialization/deserialization.options: Optional scope handle, attributes, data, metadata, modelName.Returns
A promise resolving to the native LlmStream handle.
Remarks
The wrapper bridges async iteration back into the native stream lifecycle and closes the stream even when the source iterator throws.
JsonPrimitiveOne JSON scalar value accepted by the typed wrapper APIs.
JsonValueAny JSON-serializable value accepted by the typed wrapper APIs.