Skip to main content

query_messages

Function query_messages 

Source
pub async fn query_messages(
    prompt: impl Into<String>,
    options: Option<ClaudeAgentOptions>,
) -> Result<Vec<Message>>
Expand description

Perform a one-shot query and return the full message sequence.

This is the Rust equivalent of the Python SDK’s query() async iterator, adapted to return the collected messages as a Vec<Message>.