use super::types::KnowledgeDetailResponse;
use crate::client::ZaiClient;
pub struct KnowledgeRetrieveRequest {
id: String,
}
impl KnowledgeRetrieveRequest {
pub fn new(id: impl Into<String>) -> Self {
Self { id: id.into() }
}
pub async fn send_via(&self, client: &ZaiClient) -> crate::ZaiResult<KnowledgeDetailResponse> {
let route = crate::client::routes::KNOWLEDGE_GET;
let url = client.endpoints().resolve_route(route, &[&self.id])?;
client
.send_empty::<KnowledgeDetailResponse>(route.method(), url)
.await
}
}
pub type KnowledgeRetrieveResponse = KnowledgeDetailResponse;