Home / Class/ StructuredOutputValidationError Class — langchain Architecture

StructuredOutputValidationError Class — langchain Architecture

Architecture documentation for the StructuredOutputValidationError class in structured_output.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  401ad6d7_e124_f0bd_f962_febd376a0a8d["StructuredOutputValidationError"]
  e116611b_2ad2_e3dc_b8ed_0c4a94d5b747["StructuredOutputError"]
  401ad6d7_e124_f0bd_f962_febd376a0a8d -->|extends| e116611b_2ad2_e3dc_b8ed_0c4a94d5b747
  c2936c24_74cd_6911_037b_0f67eebfefee["structured_output.py"]
  401ad6d7_e124_f0bd_f962_febd376a0a8d -->|defined in| c2936c24_74cd_6911_037b_0f67eebfefee
  2808b469_8f34_bf25_a1fb_b0bdff43f594["__init__()"]
  401ad6d7_e124_f0bd_f962_febd376a0a8d -->|method| 2808b469_8f34_bf25_a1fb_b0bdff43f594

Relationship Graph

Source Code

libs/langchain_v1/langchain/agents/structured_output.py lines 60–74

class StructuredOutputValidationError(StructuredOutputError):
    """Raised when structured output tool call arguments fail to parse according to the schema."""

    def __init__(self, tool_name: str, source: Exception, ai_message: AIMessage) -> None:
        """Initialize `StructuredOutputValidationError`.

        Args:
            tool_name: The name of the tool that failed.
            source: The exception that occurred.
            ai_message: The AI message that contained the invalid structured output.
        """
        self.tool_name = tool_name
        self.source = source
        self.ai_message = ai_message
        super().__init__(f"Failed to parse structured output for tool '{tool_name}': {source}.")

Frequently Asked Questions

What is the StructuredOutputValidationError class?
StructuredOutputValidationError is a class in the langchain codebase, defined in libs/langchain_v1/langchain/agents/structured_output.py.
Where is StructuredOutputValidationError defined?
StructuredOutputValidationError is defined in libs/langchain_v1/langchain/agents/structured_output.py at line 60.
What does StructuredOutputValidationError extend?
StructuredOutputValidationError extends StructuredOutputError.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free