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.

Focused reviews arrive as direct FocusedReview objects so native provider schemas can enforce their fields. The validated object is normalized back 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.