[BREAKING] Python: Move single-config fluent methods to constructor parameters (#3693)

* Move single-config fluent methods to constructor parameters

* Updates

* Adjust magentic and group chat
This commit is contained in:
Evan Mattson
2026-02-07 15:01:52 +09:00
committed by GitHub
Unverified
parent 5d355ac507
commit 74ac470a56
132 changed files with 1341 additions and 2386 deletions
@@ -137,12 +137,6 @@ class DeclarativeWorkflowBuilder:
Raises:
ValueError: If no actions are defined (empty workflow), or validation fails
"""
builder = WorkflowBuilder(name=self._workflow_id)
# Enable checkpointing if storage is provided
if self._checkpoint_storage:
builder.with_checkpointing(self._checkpoint_storage)
actions = self._yaml_def.get("actions", [])
if not actions:
# Empty workflow - raise an error since we need at least one executor
@@ -152,6 +146,13 @@ class DeclarativeWorkflowBuilder:
if self._validate:
self._validate_workflow(actions)
# Use a placeholder for start_executor; it will be overwritten below via _set_start_executor
builder = WorkflowBuilder(
start_executor="_declarative_placeholder",
name=self._workflow_id,
checkpoint_storage=self._checkpoint_storage,
)
# First pass: create all executors
entry_executor = self._create_executors_for_actions(actions, builder)
@@ -164,11 +165,11 @@ class DeclarativeWorkflowBuilder:
# Create an entry passthrough node and wire to the structure's branches
entry_node = JoinExecutor({"kind": "Entry"}, id="_workflow_entry")
self._executors[entry_node.id] = entry_node
builder.set_start_executor(entry_node)
builder._set_start_executor(entry_node)
# Use _add_sequential_edge which knows how to wire to structures
self._add_sequential_edge(builder, entry_node, entry_executor)
else:
builder.set_start_executor(entry_executor)
builder._set_start_executor(entry_executor)
else:
raise ValueError("Failed to create any executors from actions.")