aw.preparing¶
Preparation agent for transforming data to meet target requirements.
Implements ReAct pattern with functional validation (try-the-purpose approach).
Functions
|
Factory function to create a preparation agent. |
Classes
|
Agent that prepares data to meet target requirements. |
- class aw.preparing.PreparationAgent(config=None, target='generic', target_validator=None)[source]¶
Bases:
objectAgent that prepares data to meet target requirements.
Uses ReAct loop with functional validation:
Thought: Analyze current data state vs. requirements
Action: Generate transformation code
Observe: Execute code and capture result
Validate: Try to use data for its purpose (e.g., visualization)
Repeat or finish
Example
>>> agent = PreparationAgent(target='cosmo-ready') >>> context = Context({'loading': {'df': df}}) >>> prepared_df, metadata = agent.execute(df, context)
- aw.preparing.create_preparation_agent(target='generic', validator=None, llm=None, max_retries=3)[source]¶
Factory function to create a preparation agent.
- Parameters:
- Return type:
- Returns:
Configured PreparationAgent
Example
>>> agent = create_preparation_agent( ... target='cosmo-ready', ... validator=cosmo_validator, ... max_retries=5 ... )