Skip to main content

parse_protocol_response_strict

Function parse_protocol_response_strict 

Source
pub fn parse_protocol_response_strict(
    raw: &str,
    profile: ProtocolRequestProfile,
) -> Result<AgentResponse, AgentResponseParseError>
Expand description

Parses one response against the schema selected for its request profile.

Reviews and metadata arrive as direct task objects so native provider schemas can enforce their fields. The validated object is normalized into AgentResponse::answer for existing application consumers.

§Errors

Returns AgentResponseParseError when the response is empty or does not match the profile’s structured response schema.