Expand description
§AgentAI Core
Shared building blocks of the AgentAI crates.
messageandprompt: the conversation types (Message,Part,Media,ToolOutput,Prompt, …), re-exported byagentai.history:HistoryProcessorchanges the messages sent to the model,HistoryPruningremoves media and reasoning from finished turns.mime: one table of MIME types and file extensions (mime::extension,mime::from_path,mime::with_extension), also behindMedia::extensionandMedia::file_name.base64:base64::encodeandbase64::decode, the encoding ofMediabytes and data URLs (Media::to_url).storage:MediaStorage(MediaRead+MediaSave), a blob storage for images and other files, withMemoryStorage.- HTTP: the
HttpClienttrait hides the HTTP stack, so crates such asagentai-imagesend their requests without depending on a particular client.ReqwestClientimplements it withreqwest; another environment (for example WebAssembly) can provide its own. With thetest-supportfeature,mock::MockHttprecords requests and answers with prepared responses, for tests of providers. tls: the TLS backend is chosen with therustls-ring(default),rustls-aws-lcandnative-tlsfeatures.
§Features
Available features for agentai-core crate.
Features list:
reqwest(enabled by default) — EnablesReqwestClient, theHttpClienton top ofreqwesttest-support—mock::MockHttp, aHttpClientthat records requests and answers with prepared responses, for the tests of provider crates. Enable it in[dev-dependencies]only.rustls-ring(enabled by default) — TLS with rustls and the ring crypto provider, checking certificates against the OS trust store. Install the provider withtls::install_crypto_providerbefore you build your ownreqwestclient.rustls-aws-lc— TLS with rustls and the aws-lc-rs crypto provider (builds theaws-lc-sysC library).native-tls— TLS of the operating system (OpenSSL, SChannel or Security Framework). It cannot be combined with arustls-*feature: setdefault-features = false.system-proxy(enabled by default) — Reads the macOS and Windows system proxy settings. Proxy environment variables (HTTP_PROXY,HTTPS_PROXY,NO_PROXY) work without it.
Modules§
- base64
- Base64 (standard alphabet, with padding), the encoding of
MediaSource::Base64and of data URLs. - history
- Processing the history before it is sent
- message
- Conversation messages
- mime
- MIME types and file extensions of images, audio and video.
- prompt
- Prompts
- storage
- Storage for media: images, audio and other files, kept under an ID.
- tls
- TLS backend.
Structs§
- Http
Request - A request sent with a
HttpClient. The body is always plain bytes, so a client only has to send them. - Http
Response - A response returned by a
HttpClient, with the whole body read. - Multipart
- A
multipart/form-databody, built in memory. - Reqwest
Client HttpClienton top ofreqwest.
Enums§
- Http
Error - Errors of a
HttpClientand of building or reading a request. - Method
- HTTP method of a
HttpRequest.
Traits§
- Http
Client - Sends HTTP requests.
Functions§
- percent_
encode - Percent-encodes
valuefor use as one path segment or query value of a URL: everything but the unreserved characters of RFC 3986 (letters, digits,-,.,_,~) is escaped.