Interface AssistantMessageGuardRail

  • All Implemented Interfaces:
    com.embabel.agent.api.validation.ContentValidator , com.embabel.agent.api.validation.guardrails.GuardRail

    
    public interface AssistantMessageGuardRail
     implements GuardRail
                        

    Validates assistant responses after LLM execution.

    AssistantMessageGuardRails provide safety and quality checks on content that AI systems produce, ensuring that generated responses meet organizational standards for appropriateness, accuracy, compliance, and quality.

    This interface handles validation of both standard responses and thinking-enhanced responses that include internal reasoning content.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract ValidationResult validate(ThinkingResponse<?> response, Blackboard blackboard) Validate a thinking-enhanced response containing both result and reasoning.
      ValidationResult validate(AssistantMessage message, Blackboard blackboard) Validate a standard assistant message response.
      • Methods inherited from class com.embabel.agent.api.validation.ContentValidator

        getDescription, getName, validate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • validate

         abstract ValidationResult validate(ThinkingResponse<?> response, Blackboard blackboard)

        Validate a thinking-enhanced response containing both result and reasoning.

        This method provides access to the complete thinking response, allowing validators to examine both the final result and the internal thinking blocks. Implementations can validate the relationship between thinking and result, check for inappropriate reasoning, or ensure thinking quality standards.

        Parameters:
        response - the thinking response containing result and thinking blocks
        blackboard - the blackboard context
        Returns:

        validation result indicating success or failure

      • validate

         ValidationResult validate(AssistantMessage message, Blackboard blackboard)

        Validate a standard assistant message response.

        This method handles validation of typical chat-style responses from the assistant, checking content appropriateness and compliance.

        Default implementation validates the message content, but implementations can override to examine message metadata or perform more sophisticated conversation-aware validation.

        Parameters:
        message - the assistant message to validate
        blackboard - the blackboard context
        Returns:

        validation result indicating success or failure