MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / add_data_url_part

Method add_data_url_part

crates/opencode-session/src/prompt.rs:377–393  ·  view source on GitHub ↗
(
        &self,
        msg: &mut SessionMessage,
        raw_url: &str,
        filename: &str,
        mime: &str,
    )

Source from the content-addressed store, hash-verified

375 }
376
377 async fn add_data_url_part(
378 &self,
379 msg: &mut SessionMessage,
380 raw_url: &str,
381 filename: &str,
382 mime: &str,
383 ) {
384 if let Some(text) = Self::decode_data_url_text(raw_url, mime) {
385 msg.add_text(format!(
386 "Called the Read tool with the following input: {}",
387 serde_json::json!({ "filePath": filename })
388 ));
389 msg.add_text(text);
390 }
391
392 msg.add_file(raw_url.to_string(), filename.to_string(), mime.to_string());
393 }
394
395 async fn add_file_url_part(
396 &self,

Callers 1

add_file_partMethod · 0.80

Calls 2

add_textMethod · 0.80
add_fileMethod · 0.80

Tested by

no test coverage detected