Spaces:
Sleeping
Sleeping
| """Data models for the DocEdit Environment β structured document editing via XML-like operations.""" | |
| from typing import Optional | |
| from openenv.core.env_server.types import Action, Observation | |
| from pydantic import Field | |
| class DocEditAction(Action): | |
| """Agent sends an edit operation on the document.""" | |
| operation: str = Field( | |
| ..., | |
| description="Edit operation: 'replace', 'insert', or 'delete'", | |
| ) | |
| target: str = Field( | |
| default="", | |
| description="Text to find in the document (for replace/delete operations)", | |
| ) | |
| content: str = Field( | |
| default="", | |
| description="New content (replacement text for 'replace', new text for 'insert')", | |
| ) | |
| position: int = Field( | |
| default=-1, | |
| description="Paragraph index for 'insert' operation (-1 = append at end)", | |
| ) | |
| class DocEditObservation(Observation): | |
| """Observation returned after each step β current document state + task context.""" | |
| document: str = Field(default="", description="Current document content (XML-tagged paragraphs)") | |
| target_description: str = Field(default="", description="Natural language description of the editing goal") | |
| similarity: float = Field(default=0.0, description="Current similarity to target document (0.0β1.0)") | |
| task_name: str = Field(default="", description="Current task identifier") | |
| steps_remaining: int = Field(default=0, description="Steps left in this episode") | |