graflo.architecture.actor_config¶
Pydantic models for actor configuration.
These models define the structure of YAML configuration files for the actor-based graph transformation system. They provide validation, type safety, and explicit format support (pipeline, transform/map/to_vertex, create_edge/edge with from/to).
These replace the implicit type inference in ActorWrapper.init() with explicit Pydantic discriminated unions.
DescendActorConfig
¶
Bases: ConfigBaseModel
Configuration for a DescendActor. Uses 'pipeline' (alias 'apply') and optional 'into' (alias 'key').
Source code in graflo/architecture/actor_config.py
EdgeActorConfig
¶
Bases: EdgeBase
Configuration for an EdgeActor. Extends EdgeBase; supports 'from'/'to' and 'source'/'target'.
Source code in graflo/architecture/actor_config.py
TransformActorConfig
¶
Bases: ConfigBaseModel
Configuration for a TransformActor.
Explicit format: transform with map and to_vertex (target vertex for output).
Source code in graflo/architecture/actor_config.py
VertexActorConfig
¶
Bases: ConfigBaseModel
Configuration for a VertexActor.
Source code in graflo/architecture/actor_config.py
normalize_actor_step(data)
¶
Normalize a raw step dict so it has 'type' and flat structure for validation.
Supports explicit format: - {"vertex": "user"} -> {"type": "vertex", "vertex": "user"} - {"transform": {"map": {...}, "to_vertex": "x"}} -> {"type": "transform", "map": {...}, "to_vertex": "x"} - {"edge": {"from": "a", "to": "b"}} or {"create_edge": {...}} -> {"type": "edge", "from": "a", "to": "b"} - {"descend": {"into": "k", "pipeline": [...]}} or {"apply": [...]} / {"pipeline": [...]}
Source code in graflo/architecture/actor_config.py
parse_root_config(*args, **kwargs)
¶
Parse root input into a single ActorConfig (single step or descend pipeline).
Accepts the same shapes as ActorWrapper: - Single step dict: e.g. {"vertex": "user"} or **kwargs - Pipeline: list of steps, or kwargs with "apply"/"pipeline"
Returns:
| Type | Description |
|---|---|
VertexActorConfig | TransformActorConfig | EdgeActorConfig | DescendActorConfig
|
Validated ActorConfig. For pipeline input, returns a DescendActorConfig |
VertexActorConfig | TransformActorConfig | EdgeActorConfig | DescendActorConfig
|
with into=None and pipeline=[...]. |
Source code in graflo/architecture/actor_config.py
validate_actor_step(data)
¶
Validate a normalized step dict as ActorConfig (discriminated union).