1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Wire envelope for the Agent Engine dispatch protocol.
//!
//! # Casing exception
//!
//! This envelope is **snake_case**, not the workspace's usual camelCase for
//! REST payloads. The platform's container contract dispatches
//! `{"class_method": ..., "input": ...}` because adk-python resolves the
//! method with `getattr` — the field names are Python identifiers on the
//! wire (confirmed by verification task V14). Do not "fix" this to
//! camelCase; it would break every host-side caller.
use Deserialize;
use ;
/// A dispatch request as delivered by the Agent Engine host to the container.
///
/// Sent to both `POST /api/reasoning_engine` (unary) and
/// `POST /api/stream_reasoning_engine` (streaming).
///
/// # Example
///
/// ```rust
/// use adk_server::agent_engine::DispatchRequest;
///
/// let req: DispatchRequest = serde_json::from_str(
/// r#"{"class_method": "async_stream_query", "input": {"user_id": "u", "message": "hi"}}"#,
/// )
/// .unwrap();
/// assert_eq!(req.class_method, "async_stream_query");
/// ```
/// Wraps a unary handler result in the platform's `{"output": ...}` envelope.
pub