Skip to main content

Crate agentai_core

Crate agentai_core 

Source
Expand description

§AgentAI Core

Shared building blocks of the AgentAI crates.

  • message and prompt: the conversation types (Message, Part, Media, ToolOutput, Prompt, …), re-exported by agentai.
  • storage: MediaStorage (MediaRead + MediaSave), a blob storage for images and other files, with MemoryStorage.
  • HTTP: the HttpClient trait hides the HTTP stack, so crates such as agentai-image send their requests without depending on a particular client. ReqwestClient implements it with reqwest; another environment (for example WebAssembly) can provide its own.
  • tls: the TLS backend is chosen with the rustls-ring (default), rustls-aws-lc and native-tls features.

§Features

Available features for agentai-core crate.

Features list:

  • reqwest (enabled by default) — Enables ReqwestClient, the HttpClient on top of reqwest
  • rustls-ring (enabled by default) — TLS with rustls and the ring crypto provider, checking certificates against the OS trust store. Install the provider with tls::install_crypto_provider before you build your own reqwest client.
  • rustls-aws-lc — TLS with rustls and the aws-lc-rs crypto provider (builds the aws-lc-sys C library).
  • native-tls — TLS of the operating system (OpenSSL, SChannel or Security Framework). It cannot be combined with a rustls-* feature: set default-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§

message
Conversation messages
prompt
Prompts
storage
Storage for media: images, audio and other files, kept under an ID.
tls
TLS backend.

Structs§

HttpRequest
A request sent with a HttpClient. The body is always plain bytes, so a client only has to send them.
HttpResponse
A response returned by a HttpClient, with the whole body read.
Multipart
A multipart/form-data body, built in memory.
ReqwestClient
HttpClient on top of reqwest.

Enums§

HttpError
Errors of a HttpClient and of building or reading a request.
Method
HTTP method of a HttpRequest.

Traits§

HttpClient
Sends HTTP requests.