haive.core.graph.state_graph.serializable¶
from typing import Any, Dict. Serialization support for BaseGraph.
This module provides serialization and deserialization utilities for BaseGraph, enabling graphs to be stored, loaded, and exchanged with minimal information loss.
Classes¶
Serializable representation of a Branch. |
|
Serializable representation of the BaseGraph. |
|
Serializable representation of a Node. |
|
Reference to a type that can be serialized. |
Module Contents¶
- class haive.core.graph.state_graph.serializable.SerializableBranch(/, **data)¶
Bases:
pydantic.BaseModelSerializable representation of a Branch.
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)
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class haive.core.graph.state_graph.serializable.SerializableGraph(/, **data)¶
Bases:
pydantic.BaseModelSerializable representation of the BaseGraph.
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)
- classmethod from_graph(graph)¶
Create a serializable representation from a BaseGraph.
- Return type:
Any
- classmethod from_json(json_str)¶
Create from JSON string.
- Return type:
Any
- to_dict()¶
Convert to a dictionary for serialization.
- Return type:
Any
- to_graph()¶
Convert serializable representation back to a BaseGraph.
- Return type:
Any
- to_json(**kwargs)¶
Convert to JSON string.
- Return type:
Any
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class haive.core.graph.state_graph.serializable.SerializableNode(/, **data)¶
Bases:
pydantic.BaseModelSerializable representation of a Node.
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)
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class haive.core.graph.state_graph.serializable.TypeReference(/, **data)¶
Bases:
pydantic.BaseModelReference to a type that can be serialized.
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)
- classmethod from_type(type_obj)¶
From Type.
- Parameters:
type_obj – [TODO: Add description]
- Returns:
Add return description]
- Return type:
[TODO
- resolve()¶
Resolve the reference back to a type.
- Return type:
Any
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].