pub struct Client { /* private fields */ }Expand description
Client for Compose Inference
Canonical contract for Compose model discovery and Responses-only model execution. Payment and session primitives are owned by the Compose x402 contract.
Version: 0.8.6
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(baseurl: &str) -> Self
pub fn new(baseurl: &str) -> Self
Create a new client.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Sourcepub fn new_with_client(baseurl: &str, client: Client) -> Self
pub fn new_with_client(baseurl: &str, client: Client) -> Self
Construct a new client with an existing reqwest::Client,
allowing more control over its configuration.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Source§impl Client
impl Client
Sourcepub fn check(&self) -> Check<'_>
pub fn check(&self) -> Check<'_>
Sends a GET request to /health
let response = client.check()
.send()
.await;Sourcepub fn modality_list(&self) -> ModalityList<'_>
pub fn modality_list(&self) -> ModalityList<'_>
Sends a GET request to /v1/modalities
let response = client.modality_list()
.send()
.await;Sourcepub fn modality_get(&self) -> ModalityGet<'_>
pub fn modality_get(&self) -> ModalityGet<'_>
Sends a GET request to /v1/modalities/{modality}
let response = client.modality_get()
.modality(modality)
.send()
.await;Sourcepub fn operations_list(&self) -> OperationsList<'_>
pub fn operations_list(&self) -> OperationsList<'_>
Sends a GET request to /v1/modalities/{modality}/operations
let response = client.operations_list()
.modality(modality)
.send()
.await;Sourcepub fn operation_models_list(&self) -> OperationModelsList<'_>
pub fn operation_models_list(&self) -> OperationModelsList<'_>
Sends a GET request to /v1/modalities/{modality}/operations/{operation}/models
let response = client.operation_models_list()
.modality(modality)
.operation(operation)
.cursor(cursor)
.limit(limit)
.provider(provider)
.q(q)
.streaming(streaming)
.send()
.await;Sourcepub fn list(&self) -> List<'_>
pub fn list(&self) -> List<'_>
Sends a GET request to /v1/models
let response = client.list()
.limit(limit)
.modality(modality)
.provider(provider)
.send()
.await;Sourcepub fn list_all(&self) -> ListAll<'_>
pub fn list_all(&self) -> ListAll<'_>
Sends a GET request to /v1/models/all
let response = client.list_all()
.send()
.await;Sourcepub fn search(&self) -> Search<'_>
pub fn search(&self) -> Search<'_>
Sends a POST request to /v1/models/search
let response = client.search()
.body(body)
.send()
.await;Sourcepub fn get(&self) -> Get<'_>
pub fn get(&self) -> Get<'_>
Sends a GET request to /v1/models/{model}
let response = client.get()
.model(model)
.provider(provider)
.send()
.await;Sourcepub fn params_get(&self) -> ParamsGet<'_>
pub fn params_get(&self) -> ParamsGet<'_>
Sends a GET request to /v1/models/{model}/params
let response = client.params_get()
.model(model)
.provider(provider)
.send()
.await;Sourcepub fn responses_create(&self) -> ResponsesCreate<'_>
pub fn responses_create(&self) -> ResponsesCreate<'_>
Sends a POST request to /v1/responses
let response = client.responses_create()
.x_chain_id(x_chain_id)
.x_idempotency_key(x_idempotency_key)
.x_session_user_address(x_session_user_address)
.x_x402_max_amount_wei(x_x402_max_amount_wei)
.body(body)
.send()
.await;Sourcepub fn responses_get(&self) -> ResponsesGet<'_>
pub fn responses_get(&self) -> ResponsesGet<'_>
Sends a GET request to /v1/responses/{responseId}
let response = client.responses_get()
.response_id(response_id)
.send()
.await;Sourcepub fn responses_cancel(&self) -> ResponsesCancel<'_>
pub fn responses_cancel(&self) -> ResponsesCancel<'_>
Sends a POST request to /v1/responses/{responseId}/cancel
let response = client.responses_cancel()
.response_id(response_id)
.send()
.await;Sourcepub fn responses_input_items_list(&self) -> ResponsesInputItemsList<'_>
pub fn responses_input_items_list(&self) -> ResponsesInputItemsList<'_>
Sends a GET request to /v1/responses/{responseId}/input_items
let response = client.responses_input_items_list()
.response_id(response_id)
.send()
.await;