Skip to main content

jamjet_core/
agent_tool.rs

1use serde::{Deserialize, Serialize};
2
3/// Specifies which agent to invoke as a tool.
4#[derive(Debug, Clone, Serialize, Deserialize)]
5#[serde(rename_all = "snake_case")]
6pub enum AgentTarget {
7    /// Explicit agent URI, e.g. `"jamjet://org/classifier-agent"`.
8    Explicit(String),
9    /// Auto-resolve via the coordinator at compile time.
10    Auto,
11}
12
13/// Invocation mode for an agent tool call.
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15#[serde(rename_all = "snake_case")]
16pub enum AgentToolMode {
17    /// Single request/response (default).
18    #[default]
19    Sync,
20    /// Streamed output with support for early termination.
21    Streaming,
22    /// Multi-turn conversational exchange.
23    Conversational {
24        max_turns: u32,
25        max_tokens_per_turn: Option<u32>,
26    },
27}
28
29/// Spending / token budget constraints for an agent tool invocation.
30#[derive(Debug, Clone, Serialize, Deserialize)]
31pub struct AgentToolBudget {
32    pub max_cost_usd: Option<f64>,
33    pub max_tokens: Option<u32>,
34}
35
36/// Wire protocol used to call the target agent.
37#[derive(Debug, Clone, Serialize, Deserialize)]
38#[serde(rename_all = "snake_case")]
39pub enum InvocationProtocol {
40    LocalGrpc,
41    A2a,
42    Mcp,
43}