Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- models.py +15 -16
- pre_validate.sh +1 -1
- sample_inference_official.py +2 -2
models.py
CHANGED
|
@@ -1,23 +1,22 @@
|
|
| 1 |
-
from
|
| 2 |
from pydantic import Field
|
| 3 |
-
from
|
| 4 |
|
| 5 |
class AuditAction(Action):
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
class AuditObservation(Observation):
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
done: bool = Field(default=False, description="Whether the episode is complete")
|
| 18 |
|
| 19 |
class AuditState(State):
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
# Required by base State (depending on library version, might require extra fields, but standard is dict-like or these fields)
|
|
|
|
| 1 |
+
from typing import List, Dict, Any, Optional
|
| 2 |
from pydantic import Field
|
| 3 |
+
from openenv.core.env_server import Action, Observation, State
|
| 4 |
|
| 5 |
class AuditAction(Action):
|
| 6 |
+
"""Action taken by the auditor agent."""
|
| 7 |
+
action_type: str = Field(..., description="Action to take: APPROVE, FLAG, or REQUEST_INFO")
|
| 8 |
+
target_id: str = Field(..., description="Identifier of the account or transaction being audited")
|
| 9 |
+
regulation_citation: Optional[str] = Field(None, description="Direct citation from the retrieved regulations (Required for Hard tasks)")
|
| 10 |
|
| 11 |
class AuditObservation(Observation):
|
| 12 |
+
"""Observation received by the agent after taking an action."""
|
| 13 |
+
transactions: List[Dict[str, Any]] = Field(..., description="Chronological list of recent transactions for the target entity")
|
| 14 |
+
account_metadata: Dict[str, Any] = Field(..., description="Metadata about the account (age, risk level, country)")
|
| 15 |
+
retrieved_regs: str = Field(..., description="Text-based regulatory context window providing relevant compliance clauses")
|
| 16 |
+
reward: float = Field(..., description="Immediate reward for the last taken action")
|
| 17 |
+
done: bool = Field(..., description="Episode completion flag")
|
|
|
|
| 18 |
|
| 19 |
class AuditState(State):
|
| 20 |
+
"""Current internal state of the environment server."""
|
| 21 |
+
step_count: int = Field(..., description="Current step in the audit episode")
|
| 22 |
+
current_tier: str = Field(..., description="Difficulty tier: easy, medium, or hard")
|
|
|
pre_validate.sh
CHANGED
|
@@ -13,7 +13,7 @@ hint() { log " TIP: $@"; }
|
|
| 13 |
stop_at() { log "\nStopped at ${BOLD}$1${NC}. Please fix the issue and try again."; exit 1; }
|
| 14 |
|
| 15 |
# Mocking variables for local check
|
| 16 |
-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X GET "https://armaan020-
|
| 17 |
REPO_DIR="."
|
| 18 |
DOCKER_BUILD_TIMEOUT=300
|
| 19 |
|
|
|
|
| 13 |
stop_at() { log "\nStopped at ${BOLD}$1${NC}. Please fix the issue and try again."; exit 1; }
|
| 14 |
|
| 15 |
# Mocking variables for local check
|
| 16 |
+
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X GET "https://armaan020-aegisopenenv.hf.space/health" || echo "000")
|
| 17 |
REPO_DIR="."
|
| 18 |
DOCKER_BUILD_TIMEOUT=300
|
| 19 |
|
sample_inference_official.py
CHANGED
|
@@ -28,8 +28,8 @@ def main():
|
|
| 28 |
api_key=api_key,
|
| 29 |
base_url=base_url,
|
| 30 |
default_headers={
|
| 31 |
-
"HTTP-Referer": "https://huggingface.co/spaces/armaan020/
|
| 32 |
-
"X-Title": "
|
| 33 |
} if "openrouter" in base_url.lower() else None
|
| 34 |
)
|
| 35 |
|
|
|
|
| 28 |
api_key=api_key,
|
| 29 |
base_url=base_url,
|
| 30 |
default_headers={
|
| 31 |
+
"HTTP-Referer": "https://huggingface.co/spaces/armaan020/AegisOpenEnv",
|
| 32 |
+
"X-Title": "AegisOpenEnv Official Sample check"
|
| 33 |
} if "openrouter" in base_url.lower() else None
|
| 34 |
)
|
| 35 |
|