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

Method execute

core/src/agent/execution_entry.rs:12–20  ·  view source on GitHub ↗

Execute the agent loop for a prompt Takes the conversation history and a new user prompt. Returns the agent result and updated message history. When event_tx is provided, uses streaming LLM API for real-time text output.

(
        &self,
        history: &[Message],
        prompt: &str,
        event_tx: Option<mpsc::Sender<AgentEvent>>,
    )

Source from the content-addressed store, hash-verified

10 /// Returns the agent result and updated message history.
11 /// When event_tx is provided, uses streaming LLM API for real-time text output.
12 pub async fn execute(
13 &self,
14 history: &[Message],
15 prompt: &str,
16 event_tx: Option<mpsc::Sender<AgentEvent>>,
17 ) -> Result<AgentResult> {
18 self.execute_with_session(history, prompt, None, event_tx, None)
19 .await
20 }
21
22 /// Execute the agent loop with pre-built messages (user message already included).
23 ///

Callers 15

read_fileMethod · 0.45
globMethod · 0.45
grepMethod · 0.45
callMethod · 0.45
test_agent_hitl_approvedFunction · 0.45

Calls 1

execute_with_sessionMethod · 0.80