Skip to main content

ExtraMap

Type Alias ExtraMap 

Source
pub type ExtraMap = Map<String, Value>;
Expand description

Portable JSON object used wherever anyllm needs an untyped, wire-shaped key/value bag.

ExtraMap is the library’s JSON-native escape hatch. It appears as the data field of ContentBlock::Other, the extensions field on messages and tools, the metadata and data fields on stream events, and the portable half of ResponseMetadata. Aliasing to serde_json::Map<String, serde_json::Value> (rather than Value) makes the “this is a key/value bag” constraint compile-time: a scalar or array will not fit.

For Rust-native typed configuration, use RequestOptions on the request side or ResponseMetadataType entries on the response side. Reach for ExtraMap only when the data is inherently JSON-shaped or when preserving a wire-level blob verbatim.

Aliased Type§

pub struct ExtraMap { /* private fields */ }