zai_rs/knowledge/
retrieve.rs1use super::types::KnowledgeDetailResponse;
2use crate::client::ZaiClient;
3
4pub struct KnowledgeRetrieveRequest {
9 id: String,
10}
11
12impl KnowledgeRetrieveRequest {
13 pub fn new(id: impl Into<String>) -> Self {
15 Self { id: id.into() }
16 }
17
18 pub async fn send_via(&self, client: &ZaiClient) -> crate::ZaiResult<KnowledgeDetailResponse> {
20 let route = crate::client::routes::KNOWLEDGE_GET;
21 let url = client.endpoints().resolve_route(route, &[&self.id])?;
22 client
23 .send_empty::<KnowledgeDetailResponse>(route.method(), url)
24 .await
25 }
26}
27
28pub type KnowledgeRetrieveResponse = KnowledgeDetailResponse;