Spaces:
Configuration error
Configuration error
Download Guardrails/Preprocessing.py from Jayandhan/Analyst_agent_v2: direct link, hf CLI and curl.
- Browser
- Download file 910 Bytes
-
https://huggingface.co/spaces/Jayandhan/Analyst_agent_v2/resolve/main/Guardrails/Preprocessing.py
- Command line
-
hf download hf://spaces/Jayandhan/Analyst_agent_v2/Guardrails/Preprocessing.py
-
curl -L -o Preprocessing.py https://huggingface.co/spaces/Jayandhan/Analyst_agent_v2/resolve/main/Guardrails/Preprocessing.py
910 Bytes
| from typing import List | |
| from pydantic import BaseModel, Field | |
| # Define the structure for a single preprocessing step | |
| class PreprocessingStep(BaseModel): | |
| column: str = Field(..., description="The name of the column to be processed.") | |
| action: str = Field(..., description="The specific, safe preprocessing command for this column.") | |
| # Define the complete, structured output we expect from the agent | |
| class StructuredPlanOutput(BaseModel): | |
| """The final structured output containing the preprocessing plan and its summary.""" | |
| plan: List[PreprocessingStep] = Field(..., description="The detailed, column-by-column preprocessing plan as a JSON array.") | |
| summary: str = Field(..., description="A concise, one-sentence summary of the plan, under 100 characters.") | |
| details: str = Field(..., description="A full, human-readable summary of all the preprocessing actions to be taken.") |