armaan020 commited on
Commit
dbf6460
·
verified ·
1 Parent(s): a83207d

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. models.py +15 -16
  2. pre_validate.sh +1 -1
  3. sample_inference_official.py +2 -2
models.py CHANGED
@@ -1,23 +1,22 @@
1
- from openenv.core.env_server import Action, Observation, State
2
  from pydantic import Field
3
- from typing import List, Dict, Any
4
 
5
  class AuditAction(Action):
6
- action_type: str = Field(description="One of: ['APPROVE', 'FLAG', 'REQUEST_INFO']")
7
- target_id: str = Field(description="The ID of the account or transaction being evaluated.")
8
- regulation_citation: str = Field(description="The specific regulation clause cited.")
 
9
 
10
  class AuditObservation(Observation):
11
- transactions: List[Dict[str, Any]] = Field(description="List of transaction dicts")
12
- account_metadata: Dict[str, Any] = Field(description="Account metadata")
13
- retrieved_regs: str = Field(description="RAG-retrieved sections of guidelines")
14
-
15
- # Official OpenEnv returns these properties directly on the Observation
16
- reward: float = Field(default=0.0, description="Reward gained in the step")
17
- done: bool = Field(default=False, description="Whether the episode is complete")
18
 
19
  class AuditState(State):
20
- step_count: int = Field(description="Current step of the episode")
21
- current_tier: str = Field(description="The compliance tier active for the episode")
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-aegisgym.hf.space/health" || echo "000")
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/AegisGym",
32
- "X-Title": "AegisGym Official Sample check"
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