MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / add_tool_result

Method add_tool_result

crates/opencode-session/src/message.rs:174–190  ·  view source on GitHub ↗
(
        &mut self,
        tool_call_id: impl Into<String>,
        content: impl Into<String>,
        is_error: bool,
    )

Source from the content-addressed store, hash-verified

172 }
173
174 pub fn add_tool_result(
175 &mut self,
176 tool_call_id: impl Into<String>,
177 content: impl Into<String>,
178 is_error: bool,
179 ) {
180 self.parts.push(MessagePart {
181 id: format!("prt_{}", uuid::Uuid::new_v4()),
182 part_type: PartType::ToolResult {
183 tool_call_id: tool_call_id.into(),
184 content: content.into(),
185 is_error,
186 },
187 created_at: Utc::now(),
188 message_id: None,
189 });
190 }
191
192 pub fn add_file(
193 &mut self,

Calls

no outgoing calls