Skip to main content

prismer_sdk/
knowledge.rs

1use crate::{PrismerClient, types::*};
2
3/// Knowledge Links: bidirectional associations between Memory, Gene, Capsule, Signal entities (v1.8.0).
4pub struct KnowledgeLinkClient<'a> {
5    pub(crate) client: &'a PrismerClient,
6}
7
8impl<'a> KnowledgeLinkClient<'a> {
9    /// Get all knowledge links for a given entity.
10    ///
11    /// `entity_type` must be one of: `"memory"`, `"gene"`, `"capsule"`, `"signal"`.
12    pub async fn get_links(&self, entity_type: &str, entity_id: &str) -> Result<ApiResponse<Vec<serde_json::Value>>, PrismerError> {
13        self.client.request(
14            reqwest::Method::GET,
15            &format!("/api/im/knowledge/links?entityType={}&entityId={}", entity_type, entity_id),
16            None,
17        ).await
18    }
19}