agents.base.smart_output_parsing¶
Smart Output Parsing with Post-Hooks Integration.
This module demonstrates how to use GenericEngineNodeConfig and post-hooks to handle specific output parsing in a smart, flexible manner.
Classes¶
CallableNodeConfig specialized for output parsing with smart routing. |
|
Enhanced GenericEngineNodeConfig with smart output parsing. |
|
Mixin to add smart output parsing capabilities to agents. |
Functions¶
|
Create a smart generic engine node with output parsing. |
|
Create a smart callable parser with content detection. |
|
Example content type detection function. |
|
Example JSON parsing function. |
|
Example structured content parsing function. |
Module Contents¶
- class agents.base.smart_output_parsing.SmartCallableOutputParser(/, **data)¶
Bases:
haive.core.graph.node.callable_node.CallableNodeConfig
CallableNodeConfig specialized for output parsing with smart routing.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class agents.base.smart_output_parsing.SmartGenericEngineNode¶
Bases:
haive.core.graph.node.engine_node_generic.GenericEngineNodeConfig
[TInput
,TOutput
]Enhanced GenericEngineNodeConfig with smart output parsing.
- class agents.base.smart_output_parsing.SmartOutputParsingMixin(*args, **kwargs)¶
Mixin to add smart output parsing capabilities to agents.
Init .
- agents.base.smart_output_parsing.create_smart_engine_node(engine, name, input_schema=None, output_schema=None, parsing_strategies=None, **kwargs)¶
Create a smart generic engine node with output parsing.
- agents.base.smart_output_parsing.create_smart_parsing_callable(parsing_functions, detection_function, name='smart_parser', **kwargs)¶
Create a smart callable parser with content detection.
- Parameters:
parsing_functions (dict[str, collections.abc.Callable])
detection_function (collections.abc.Callable)
name (str)
- Return type:
- agents.base.smart_output_parsing.detect_content_type(state)¶
Example content type detection function.
- Return type:
- agents.base.smart_output_parsing.parse_json_content(state)¶
Example JSON parsing function.
- Return type: