pub struct AxonFlowClient { /* private fields */ }Implementations§
Source§impl AxonFlowClient
impl AxonFlowClient
pub fn new(config: AxonFlowConfig) -> Result<Self, AxonFlowError>
pub async fn proxy_llm_call( &self, user_token: &str, query: &str, request_type: &str, context: HashMap<String, Value>, ) -> Result<ClientResponse, AxonFlowError>
pub async fn list_connectors( &self, ) -> Result<Vec<ConnectorMetadata>, AxonFlowError>
pub async fn get_connector( &self, connector_id: &str, ) -> Result<ConnectorMetadata, AxonFlowError>
pub async fn get_connector_health( &self, connector_id: &str, ) -> Result<ConnectorHealthStatus, AxonFlowError>
pub async fn install_connector( &self, req: ConnectorInstallRequest, ) -> Result<(), AxonFlowError>
pub async fn query_connector( &self, user_token: &str, connector_name: &str, query: &str, params: HashMap<String, Value>, ) -> Result<ConnectorResponse, AxonFlowError>
pub async fn generate_plan( &self, query: &str, domain: &str, user_token: Option<&str>, ) -> Result<PlanResponse, AxonFlowError>
pub async fn execute_plan( &self, plan_id: &str, user_token: Option<&str>, ) -> Result<PlanExecutionResponse, AxonFlowError>
pub async fn get_plan_status( &self, plan_id: &str, ) -> Result<PlanExecutionResponse, AxonFlowError>
pub async fn cancel_plan( &self, plan_id: &str, reason: Option<&str>, ) -> Result<CancelPlanResponse, AxonFlowError>
pub async fn audit_llm_call( &self, req: &AuditRequest, ) -> Result<AuditResult, AxonFlowError>
Source§impl AxonFlowClient
impl AxonFlowClient
Sourcepub async fn explain_decision(
&self,
decision_id: &str,
) -> Result<DecisionExplanation, AxonFlowError>
pub async fn explain_decision( &self, decision_id: &str, ) -> Result<DecisionExplanation, AxonFlowError>
Fetches the full explanation for a previously-made policy decision.
The caller must either own the decision (X-User-Email match) or belong to the same tenant as the decision (X-Tenant-ID match). Returns an error wrapping HTTP 404 when the decision is past the tier’s audit retention window.
§Example
let client = AxonFlowClient::new(AxonFlowConfig::new("http://localhost:8080"))?;
let exp = client.explain_decision("dec_wf123_step4").await?;
if exp.override_available {
// Surface a "request override" UI affordance
}Sourcepub async fn list_decisions(
&self,
opts: ListDecisionsOptions,
) -> Result<Vec<DecisionSummary>, AxonFlowError>
pub async fn list_decisions( &self, opts: ListDecisionsOptions, ) -> Result<Vec<DecisionSummary>, AxonFlowError>
Lists recent policy decisions for the caller’s tenant.
Returns the slim 5-field DecisionSummary page; the platform
applies a tier-gated cap (5/24h on Free + Community, 100/30d on
Pro + Evaluation, 1000/full on Enterprise). Requesting a limit
above the tier cap yields a 429 with the V1 upgrade envelope —
surfaced here as AxonFlowError::RateLimited so callers can
branch on envelope.upgrade.{tier,compare_url,buy_url} without
re-parsing the body.
Filters compose: passing decision = Some("deny") AND
policy_id = Some("pol-sqli") returns only deny decisions
matching that policy. since is RFC3339 (chrono DateTime<Utc>).
§Example
let client = AxonFlowClient::new(AxonFlowConfig::new("http://localhost:8080"))?;
let opts = ListDecisionsOptions {
decision: Some("deny".into()),
limit: Some(10),
..Default::default()
};
let decisions = client.list_decisions(opts).await?;
for d in decisions {
println!("{} {} {}", d.decision_id, d.decision, d.timestamp);
}Trait Implementations§
Source§impl Clone for AxonFlowClient
impl Clone for AxonFlowClient
Source§fn clone(&self) -> AxonFlowClient
fn clone(&self) -> AxonFlowClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more