MCPcopy Create free account
hub / github.com/AI45Lab/Code / send_with_attachments

Function send_with_attachments

core/src/agent_api/conversation_runtime.rs:45–60  ·  view source on GitHub ↗
(
    session: &AgentSession,
    prompt: &str,
    attachments: &[Attachment],
    history: Option<&[Message]>,
)

Source from the content-addressed store, hash-verified

43}
44
45pub(super) async fn send_with_attachments(
46 session: &AgentSession,
47 prompt: &str,
48 attachments: &[Attachment],
49 history: Option<&[Message]>,
50) -> Result<AgentResult> {
51 bail_if_closed(session)?;
52
53 // Build one user message containing text and images, then execute from the
54 // resulting message list so the loop does not append a duplicate prompt.
55 let input = ConversationInput::with_attachments(session, history, prompt, attachments);
56 let blocking_run = BlockingRunContext::start(session, prompt, input.persistence).await;
57 blocking_run
58 .execute_from_messages(input.messages, &session.session_id)
59 .await
60}
61
62pub(super) async fn stream_with_attachments(
63 session: &AgentSession,

Callers 1

send_with_attachmentsMethod · 0.85

Calls 2

bail_if_closedFunction · 0.85
execute_from_messagesMethod · 0.45

Tested by

no test coverage detected