aw.orchestration¶
Orchestration and workflow management for agentic steps.
Provides utilities to chain multiple agentic steps together and manage the overall workflow.
Functions
|
Create a workflow specifically for cosmograph preparation. |
|
Factory to create a data preparation workflow. |
|
Convenience function to load and prepare data in one call. |
|
Load and prepare data specifically for cosmograph visualization. |
Classes
|
Orchestrates a chain of agentic steps. |
|
Workflow with human-in-the-loop capabilities. |
- class aw.orchestration.AgenticWorkflow(context=None)[source]¶
Bases:
objectOrchestrates a chain of agentic steps.
Manages the execution of multiple steps in sequence, handling context/artifact passing between steps.
Example
>>> workflow = AgenticWorkflow() >>> workflow.add_step('loading', loading_agent) >>> workflow.add_step('preparing', preparing_agent) >>> result = workflow.run(source_uri)
- add_step(name, step)[source]¶
Add a step to the workflow.
- Parameters:
name (
str) – Name/identifier for the stepstep (
AgenticStep) – Agent or step implementation
- Return type:
- Returns:
Self for chaining
- class aw.orchestration.InteractiveWorkflow(context=None)[source]¶
Bases:
AgenticWorkflowWorkflow with human-in-the-loop capabilities.
Pauses execution to request human input/approval at configured points.
Example
>>> workflow = InteractiveWorkflow() >>> workflow.add_step('loading', agent, require_approval=True) >>> result = workflow.run_interactive(source_uri)
- add_step(name, step, require_approval=False)[source]¶
Add step with optional approval requirement.
- Return type:
- aw.orchestration.create_cosmo_prep_workflow(cosmo_validator=None, max_retries=3)[source]¶
Create a workflow specifically for cosmograph preparation.
- Parameters:
- Return type:
- Returns:
Configured workflow
Example
>>> workflow = create_cosmo_prep_workflow() >>> prepared_df, metadata = workflow.run('data.csv')
- aw.orchestration.create_data_prep_workflow(loading_config=None, preparing_config=None, target='generic')[source]¶
Factory to create a data preparation workflow.
Creates a workflow with LoadingAgent -> PreparationAgent.
- Parameters:
loading_config (
StepConfig) – Configuration for loading agentpreparing_config (
StepConfig) – Configuration for preparing agenttarget (
str) – Target format for preparation
- Return type:
- Returns:
Configured workflow
Example
>>> workflow = create_data_prep_workflow(target='cosmo-ready') >>> df, metadata = workflow.run('/path/to/data.csv')
- aw.orchestration.load_and_prepare(source_uri, target='generic', validator=None, max_retries=3)[source]¶
Convenience function to load and prepare data in one call.
- Parameters:
- Return type:
- Returns:
Tuple of (prepared_dataframe, metadata)
Example
>>> df, meta = load_and_prepare('data.csv', target='cosmo-ready')
- aw.orchestration.load_for_cosmo(source_uri, max_retries=3, strict=False)[source]¶
Load and prepare data specifically for cosmograph visualization.
- Parameters:
- Return type:
- Returns:
Tuple of (prepared_dataframe, metadata)
Example
>>> df, meta = load_for_cosmo('data.csv') >>> from cosmograph import cosmo >>> cosmo(df, **meta['preparing']['metadata']['validation_result']['params'])