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

Method add_file

crates/opencode-session/src/message.rs:192–208  ·  view source on GitHub ↗
(
        &mut self,
        url: impl Into<String>,
        filename: impl Into<String>,
        mime: impl Into<String>,
    )

Source from the content-addressed store, hash-verified

190 }
191
192 pub fn add_file(
193 &mut self,
194 url: impl Into<String>,
195 filename: impl Into<String>,
196 mime: impl Into<String>,
197 ) {
198 self.parts.push(MessagePart {
199 id: format!("prt_{}", uuid::Uuid::new_v4()),
200 part_type: PartType::File {
201 url: url.into(),
202 filename: filename.into(),
203 mime: mime.into(),
204 },
205 created_at: Utc::now(),
206 message_id: None,
207 });
208 }
209
210 pub fn add_agent(&mut self, name: impl Into<String>) {
211 self.parts.push(MessagePart {

Callers 4

add_file_partMethod · 0.80
add_mcp_resource_partMethod · 0.80
add_data_url_partMethod · 0.80
add_file_url_partMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected