Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

Bytes-level dispatch from a resolved TransformPair to its typed pair functions. [content] holds the 12 content-generation pairs (M2); [other] holds count_tokens/models/embeddings/images/compact (M2.5). Streaming is wired for content pairs only.

Functionsยง

is_wired
Whether the bytes dispatch has arms for this pair.
request_bytes
Convert a request body (inbound wire JSON โ†’ upstream wire JSON).
response_bytes
Convert a response body (upstream wire JSON โ†’ inbound wire JSON). The pair here is the REVERSE pair (resolve(upstream_key, inbound_key)).
stream_event_value
Convert one decoded stream event (upstream wire JSON value โ†’ inbound wire JSON value). Same reverse-pair convention as response_bytes. Only content-generation pairs stream; the other groups are buffered.