Skip to main content

zai_rs/knowledge/
capacity.rs

1use super::types::KnowledgeCapacityResponse;
2use crate::client::ZaiClient;
3
4/// Knowledge capacity request (GET /llm-application/open/knowledge/capacity)
5///
6/// Credentials and transport live on the [`ZaiClient`], passed to
7/// [`send_via`](Self::send_via).
8#[allow(clippy::new_without_default)]
9#[derive(Default)]
10pub struct KnowledgeCapacityRequest {
11    _body: (),
12}
13
14impl KnowledgeCapacityRequest {
15    /// Build a capacity request.
16    pub fn new() -> Self {
17        Self { _body: () }
18    }
19
20    /// Send via a [`ZaiClient`] and parse the typed response.
21    pub async fn send_via(
22        &self,
23        client: &ZaiClient,
24    ) -> crate::ZaiResult<KnowledgeCapacityResponse> {
25        let route = crate::client::routes::KNOWLEDGE_CAPACITY;
26        let url = client.endpoints().resolve_route(route, &[])?;
27        client
28            .send_empty::<KnowledgeCapacityResponse>(route.method(), url)
29            .await
30    }
31}