MCPcopy Index your code
hub / github.com/AI45Lab/Code / js_attachments_to_rust

Function js_attachments_to_rust

sdk/node/src/lib.rs:5679–5684  ·  view source on GitHub ↗

Convert JS AttachmentObject array to Rust Attachment vec.

(attachments: &[AttachmentObject])

Source from the content-addressed store, hash-verified

5677
5678/// Convert JS AttachmentObject array to Rust Attachment vec.
5679fn js_attachments_to_rust(attachments: &[AttachmentObject]) -> Vec<a3s_code_core::llm::Attachment> {
5680 attachments
5681 .iter()
5682 .map(|a| a3s_code_core::llm::Attachment::new(a.data.to_vec(), a.media_type.clone()))
5683 .collect()
5684}
5685
5686fn js_messages_to_rust(messages: &[MessageObject]) -> napi::Result<Vec<RustMessage>> {
5687 Ok(messages

Callers 2

send_with_attachmentsMethod · 0.85

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected