nat.plugins.langchain.langgraph_workflow#
Attributes#
Classes#
Input model for the LangGraph wrapper. |
|
Output model for the LangGraph wrapper. |
|
Configuration model for the LangGraph wrapper. |
|
Function for the LangGraph wrapper. |
Functions#
|
Module Contents#
- GraphDefType#
- logger#
- class LanggraphWrapperInput(/, **data: Any)#
Bases:
pydantic.BaseModelInput model for the LangGraph wrapper.
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.selfis explicitly positional-only to allowselfas a field name.- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- class LanggraphWrapperOutput(/, **data: Any)#
Bases:
pydantic.BaseModelOutput model for the LangGraph wrapper.
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.selfis explicitly positional-only to allowselfas a field name.- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- class LanggraphWrapperConfig(/, **data: Any)#
Bases:
nat.data_models.function.FunctionBaseConfigConfiguration model for the LangGraph wrapper.
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.selfis explicitly positional-only to allowselfas a field name.- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- class LanggraphWrapperFunction(
- *,
- config: LanggraphWrapperConfig,
- description: str | None = None,
- graph: langgraph.graph.state.CompiledStateGraph,
Bases:
nat.builder.function.Function[LanggraphWrapperInput,types.NoneType,LanggraphWrapperOutput]Function for the LangGraph wrapper.
Initialize the LangGraph wrapper function.
- Args:
config: The configuration for the LangGraph wrapper. description: The description of the LangGraph wrapper. graph: The graph to wrap.
- _graph#
- _convert_input(value: Any) LanggraphWrapperInput#
- async _ainvoke(value: LanggraphWrapperInput) LanggraphWrapperOutput#
- async _astream(
- value: LanggraphWrapperInput,
- static convert_to_str(value: LanggraphWrapperOutput) str#
Convert the output to a string.
- async register(
- config: LanggraphWrapperConfig,
- b: nat.builder.builder.Builder,