pub struct AgUiInput(pub RunAgentInput);Expand description
The AG-UI run request, extracted from a JSON body.
Rejects with Error, which renders as a 4xx and a JSON body naming what
was wrong. The decoding warnings are discarded; a handler that wants them
takes the body as [Bytes] and calls decode_with_warnings.
§The Content-Type is required
The request must say its body is JSON: application/json, text/json or
a +json type, parameters allowed. Anything else is refused with 415,
and so is a request with no Content-Type at all — an unlabelled body is
not assumed to be JSON.
Requiring a JSON media type has a second effect: a browser will not send such a request from another origin without a CORS preflight, so whether a page elsewhere can start a run is up to your CORS policy. That is all it does. It is not authentication, and an endpoint that relies on cookies still needs its own CSRF protection.
For clients that send no header and cannot be changed,
AgentEndpoint::allow_missing_content_type
accepts an unlabelled body on a mounted endpoint. A hand-written handler
opts out the same way by taking [Bytes] and calling decode itself.
Either way, the effect above no longer holds.
Tuple Fields§
§0: RunAgentInputImplementations§
Source§impl AgUiInput
impl AgUiInput
Sourcepub fn into_inner(self) -> RunAgentInput
pub fn into_inner(self) -> RunAgentInput
Unwraps the input.