Expand description
The operations a Wire can perform.
Each operation declares its request, event, end and response types and
the fold one reply goes through. Completion streams events; most
others answer with one whole document, folded by Whole. Listings
follow their cursors above the driver: each page is one call.
use rig_core::operation::{Completion, Embedding};
use rig_core::wire::Operation;
fn streams<Op: Operation>() {}
streams::<Completion>();
streams::<Embedding>();Structs§
- Audio
Generation audio - Generating speech.
- Cached
Content Fold - The reply’s one answer: a reply with no body at all ends as
CachedContentReply::Acknowledged. Finishing never fails. - Call
Fragment - What one fragment of a buffered tool call carries.
- Call
Part - An open tool call of one reply. It has its id and its name, and becomes visible when it closes.
- Completion
- Generating an assistant turn, unary or streamed.
- Context
Cache - Creates, reads, lists, updates expiry, or deletes explicit context caches.
Requests use
CachedContentRequest; a listing reads one page per call. - Embedding
- Embedding a batch of texts.
- Finish
- What the provider sends when it ends a completion reply.
- Image
Embedding - Embedding a batch of images from their encoded file bytes.
- Image
Generation image - Generating an image.
- Model
Listing - Lists provider models, one page per call.
- Model
Page - One page of a model listing, and the cursor of the page after it.
- Reasoning
Part - An open reasoning part of one reply.
- Rerank
- Ordering documents by relevance to a query.
- Rerank
Request - A reranking request: the query, the documents to order, and the batch limit’s subject.
- Seal
- How a closed reasoning part ends: its provider id, a signature, or the provider’s whole restatement of it.
- Text
Part - An open text part of one reply. Only opening the part gives one, so a fragment cannot precede its part’s start:
- Transcription
- Transcribes audio using provider-specific request encoding.
- Turn
- The completion fold. The driver and the bus writer build it; no other code can feed one.
- Verify
- Checks credentials using response status. HTTP 401/403 indicate invalid authentication; status-only decoders do not interpret the response body.
- Verify
Decoder - Accepts any body, including an empty one, after driver status validation. Endpoints requiring body validation must use another decoder.
- Whole
- The fold of an operation whose reply is one whole answer: it has no events, and the provider’s end is the response. The stamp writes what the driver learned about the reply onto it.
Enums§
- IfMalformed
- What to do with a call whose arguments do not parse when it closes.