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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Provider abstraction layer
//!
//! ## Provider Strategy
//!
//! Nika uses [rig-core](https://github.com/0xPlaygrounds/rig) for LLM providers.
//!
//! | Component | Implementation |
//! |-----------|----------------|
//! | `agent:` verb | [`RigAgentLoop`](crate::runtime::RigAgentLoop) + rig-core |
//! | `infer:` verb | `RigProvider` + rig-core |
//! | Tool calling | `NikaMcpTool` (rig `ToolDyn`) |
//!
//! ## Cost Calculation
//!
//! The `cost` module provides pricing tables and cost calculation for all providers.
//!
//! ```rust,ignore
//! use nika::provider::cost::{calculate_cost, ProviderKind};
//!
//! let cost = calculate_cost(ProviderKind::Claude, "claude-sonnet-4-6", 1000, 500);
//! println!("Cost: ${:.4}", cost);
//! ```
//!
//! ## Example
//!
//! ```rust,ignore
//! use nika::runtime::RigAgentLoop;
//! use nika::ast::AgentParams;
//! use nika::event::EventLog;
//!
//! let params = AgentParams {
//! prompt: "Generate a landing page".to_string(),
//! mcp: vec!["novanet".to_string()],
//! max_turns: Some(5),
//! ..Default::default()
//! };
//! let mut agent = RigAgentLoop::new("task-1".into(), params, EventLog::new(), mcp_clients)?;
//! let result = agent.run_claude().await?;
//! ```
// Native inference via spn-native (requires native-inference feature)
// Re-export main types for convenience
pub use ;
pub use ;
// Re-export native runtime when feature is enabled
pub use ;
// Re-export storage types for model management
pub use ;