Skip to main content
Version: 0.7.2

Functions

aggregateCompletion​

function aggregateCompletion(raw: AsyncIterable<{ tokenId: number; scores: Map<number, number> }>, tokenizer: TokenizerAdapter, request: CompletionRequest, promptIds: readonly number[], eosTokenIds: readonly number[] = tokenizer.eosTokenIds): AsyncGenerator<CompletionStreamChunk>

Convert a raw stream to compatibility chunks with input and output word relevance.

Source: js/src/completions.ts:138

createClientWithTokenizer​

function createClientWithTokenizer(options: InveraClientOptions, tokenizer: TokenizerAdapter): InveraClient

Create a high-level client with an advanced host-managed tokenizer.

Source: js/src/client.ts:219

createHuggingFaceTokenizer​

function createHuggingFaceTokenizer(identity: TokenizerIdentity): Promise<TokenizerAdapter>

Load the exact Hugging Face tokenizer revision and accept it only if its fingerprint matches.

See the Node.js and Docker deployment guide for native runtime, dynamic-import, and cache requirements.

Source: js/src/completions.ts:74

decodeRawAttributionChunk​

function decodeRawAttributionChunk(payload: unknown): { tokenId: number; scores: Map<number, number> }

Decode a streamed raw-attribution object into token relevance positions.

Source: js/src/completions.ts:20

parseQwenToolCalls​

function parseQwenToolCalls(chunks: AsyncIterable<CompletionStreamChunk>, toolParser: string): AsyncGenerator<CompletionStreamChunk>

Split Qwen <tool_call> markers into typed compatibility chunks. toolParser is one of SUPPORTED_TOOL_PARSERS: the Engine's sdk_hints.recommended_tool_parser for the model that produced chunks.

Source: js/src/completions.ts:196

streamEvidence​

function streamEvidence(chunks: AsyncIterable<CompletionStreamChunk>, request: CompletionRequest, options: EvidenceOptions = {}, toolParser: string | null): AsyncGenerator<EvidenceStreamEvent>

Add claim and tool-call evidence to an attributed completion stream. toolParser names the format of the tool calls in chunks: the Engine's sdk_hints.recommended_tool_parser for the model that produced them, one of SUPPORTED_TOOL_PARSERS. null (the model recommends no parser) accepts only streams without tool calls.

Source: js/src/evidence.ts:57