1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! `System` resource — cluster-level operations (`health`, `stats`).
use serde_json::Value;
use crate::error::Result;
use crate::http::HttpClient;
/// Cluster-level system operations.
///
/// Access via [`crate::Areev::system`].
pub struct System<'a> {
http: &'a HttpClient,
memory_id: String,
}
impl<'a> System<'a> {
/// Internal constructor — use [`crate::Areev::system`].
pub(crate) fn new(http: &'a HttpClient, memory_id: String) -> Self {
Self { http, memory_id }
}
/// Liveness check — returns the raw `{"status": "ok", …}` payload
/// or propagates the server error.
pub async fn health(&self) -> Result<Value> {
self.http._get("/health", None).await
}
/// App configuration surfaced to clients (feature flags, public
/// settings).
pub async fn config(&self) -> Result<Value> {
self.http._get("/config", None).await
}
/// Catalog of LLM models available to the caller's org.
pub async fn models(&self) -> Result<Value> {
self.http._get("/models", None).await
}
/// Memory-level statistics: grain counts, partitions, sizes.
pub async fn stats(&self) -> Result<Value> {
let path = format!("/memories/{}/stats", self.memory_id);
self.http._get(&path, None).await
}
}