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

Function send

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

Source from the content-addressed store, hash-verified

24}
25
26pub(super) async fn send(
27 session: &AgentSession,
28 prompt: &str,
29 history: Option<&[Message]>,
30) -> Result<AgentResult> {
31 bail_if_closed(session)?;
32
33 if let Some(result) = command_runtime::dispatch_blocking(session, prompt, history).await? {
34 return Ok(result);
35 }
36
37 warn_deferred_init(session);
38 let input = ConversationInput::from_history(session, history);
39 let blocking_run = BlockingRunContext::start(session, prompt, input.persistence).await;
40 blocking_run
41 .execute_with_prompt(&input.messages, prompt, &session.session_id)
42 .await
43}
44
45pub(super) async fn send_with_attachments(
46 session: &AgentSession,

Callers 1

sendMethod · 0.50

Calls 4

bail_if_closedFunction · 0.85
dispatch_blockingFunction · 0.85
warn_deferred_initFunction · 0.85
execute_with_promptMethod · 0.80

Tested by

no test coverage detected