Spaces:
Sleeping
Sleeping
File size: 951 Bytes
d0b1123 88ce22e d0b1123 88ce22e d0b1123 88ce22e d0b1123 88ce22e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | """
Models for the Data Extraction Environment.
Self-contained — no openenv dependency needed at runtime.
"""
from pydantic import BaseModel, Field
class ExtractionAction(BaseModel):
"""What the LLM sends back — a JSON dict of extracted fields."""
extracted_data: dict = Field(
...,
description="A dictionary mapping field names to extracted values"
)
class ExtractionObservation(BaseModel):
"""What the environment shows the agent."""
task_id: str = Field(default="")
difficulty: str = Field(default="easy")
raw_text: str = Field(default="")
fields_to_extract: list = Field(default_factory=list)
extraction_hints: str = Field(default="")
feedback: str = Field(default="")
fields_correct: int = Field(default=0)
fields_total: int = Field(default=0)
field_scores: dict = Field(default_factory=dict)
reward: float = Field(default=0.0)
done: bool = Field(default=False) |