Expand description
Serializable effect requests, handler descriptions, outcomes, and recording data.
HandlerKey identifies a destination; EffectKind and Outcome describe
the exchange. Host-defined operations use CustomEffect.
use rig_core::effect::{EffectFamily, EffectRow, model_key};
let mut row = EffectRow::new();
row.insert(model_key("primary"), EffectFamily::Completion);
assert_eq!(row.len(), 1);Modules§
- family
- Type-level markers for built-in and host-defined effect families.
Structs§
- Delivery
- One delivery observed by a scheduled consumer. Entries are ordered by visibility, independently of dispatch ids and handler completion order.
- Effect
Id - The identity of one dispatch, minted by the dispatcher.
- Effect
Record - One recorded exchange: the effect, who served it, and the answer.
- Effect
Row - Required handler keys and their effect families, ordered by key.
Self::is_subset_ofvalidates the requirements against handler descriptors. - Handler
Descriptor - What a registered handler is: its key and its family-specific description.
- Handler
Key - String identifier for a registered handler, serializable without a live handle.
- Key
- A handler key tagged with its effect family. Serializes as the underlying
string without the family tag. Deserialization and
Self::new_uncheckeddo not validate a registration; hosts must ensure the key servesF. ImplementsSend + Syncindependently ofF. - KeyParts
- A key’s parts, by the grammar every key the tree mints follows:
- Rerank
Request - A reranking request: the query and documents a rerank model’s call orders.
- RowGap
- The first entry of a row a set of handlers does not serve: the key, the family the row needs, and what serves the key instead, if anything.
- Tool
Call Request - A tool call as a typed request: the name and the raw JSON arguments.
The context the tool runs with is not part of the request: it travels
beside the dispatch, attached by the driver to the handler’s sink
(
Dispatch::scope::<ToolContext>()), and what the tool publishes comes back the same way (crate::tool::PublishedContext). - Tool
Embedding Descriptor - The embedding context of a retrievable tool: what
ToolEmbeddingadvertises, as data.
Enums§
- Delivery
Kind - What a scheduled consumer collected at one observation boundary.
- Effect
Family - Effect classification used by typed binding and recording.
- Effect
Kind - One effect: what a handler is asked to do.
- Embed
Inputs - The inputs of an embedding request: the texts or images an embedding model’s call embeds.
- Embed
Modality - Which modality an embedding handler serves.
- Embed
Outputs - The answer to an
EmbedInputs. - Family
Descriptor - The family-keyed description of a handler. The variant is the family:
binding a typed view compares
Family::FAMILYagainstFamilyDescriptor::family. - Memory
Op - A conversation-memory operation: the transcription of
ConversationMemory. - Memory
Outcome - The answer to a
MemoryOp. - Outcome
- What a handler answered.
- Retrieve
Query - A retrieval: the transcription of
VectorStoreIndexover the dynamic filter. The typed result parameter oftop_n<T>stays on the client side. - Retrieved
Documents - The answer to a
RetrieveQuery. - RowDiff
- One difference between two rows.
Traits§
- Custom
Effect - A host’s own effect, typed the way a
ToolContextvalue is: a declared kind label and a declared answer type, both serde. The wire form isEffectKind::Custom/Outcome::Custom; the type never crosses it. - Family
- Sealed mapping between typed requests and answers and the wire’s
EffectKindandOutcome. Hosts extend the protocol throughCustomEffectandfamily::Custom, not new family implementations. - Served
- Sealed handler-family declaration. Typed families expose
Some(F::FAMILY);family::DynamicexposesNoneand requires runtime family checks.
Functions§
- embed_
key - A key for an embedding handler:
embed:<label>. - memory_
key - A key for a labelled memory handler:
memory:<label>. An agent’s own memory is registered under the barememorykey. - model_
key - A key for a model handler:
model:<label>. - rerank_
key - A key for a rerank handler:
rerank:<label>. - retrieve_
key - A key for a labelled retrieval handler:
retrieve:<label>. An agent’s own index is registered under the bareretrievekey. - tool_
key - A key for a tool handler:
tool:<name>.