Public declaration syntax from forge-rs/harness-runtime/src/planes/inference.rs Original source SHA-256: dbae4a4e743b6d0d814017894549bf2bdb5eaf3d817743ddb99a6aaf8a9ed876 Function bodies and constant values are omitted. This is not the complete implementation. Source line 12 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct InferenceRequest { /// The task (or packed context frame) the call is grounded in. pub task: String, /// The loop transcript so far (actions and observations, oldest /// first). pub transcript: Vec, /// Optional output-token cap for this call. pub max_output_tokens: Option } Source line 24 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct TranscriptEntry { /// Whether this entry is an action the loop took or an observation it /// received back. pub role: TranscriptRole, /// Entry content. pub content: String } Source line 35 #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum TranscriptRole { /// Something the loop did (a tool call, an answer attempt). Action, /// What came back (tool output, denials, errors). Observation, } Source line 48 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(tag = "kind", rename_all = "snake_case")] pub enum ModelOutput { /// A text completion (the loop's final answer candidate). Completion { /// The completion text. text: String, }, /// A request to invoke a tool. ToolCall { /// The `/` tool identifier. tool: String, /// Opaque tool input (plane-defined encoding). input: String, }, } Source line 66 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] pub struct InferenceUsage { /// Prompt/input tokens. pub input_tokens: u64, /// Completion/output tokens. pub output_tokens: u64, /// USD cost of this call. pub cost_usd: f64 } Source line 77 pub fn total_tokens(&self) -> u64; Source line 84 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct InferenceResponse { /// Structured model output. pub output: ModelOutput, /// Metered usage for the call. pub usage: InferenceUsage } Source line 93 #[async_trait] pub trait InferencePlane: Plane { /// Run one model call through the binding. Routes resolve per /// `[inference].route_policy` (ยง5.8: live catalog by default; pins /// fail closed when no longer offered). async fn complete(&self, request: InferenceRequest) -> Result; }