Skip to content

Commit

Permalink
Update env.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kripper committed Feb 12, 2025
1 parent 921f1e1 commit 6d53e60
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions browsergym/core/src/browsergym/core/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ def send_message_to_user(text: str):
raise ValueError(f"Forbidden value: {text} is not a string")
self.chat.add_message(role="assistant", msg=text)

def add_observation(obs: dict):
if not isinstance(obs, dict):
raise ValueError(f"Forbidden value: {obj} is not a dict")
self.obs = obs

def report_infeasible_instructions(reason: str):
if not isinstance(reason, str):
raise ValueError(f"Forbidden value: {reason} is not a string")
Expand All @@ -401,6 +406,7 @@ def report_infeasible_instructions(reason: str):
code,
self.page,
send_message_to_user=send_message_to_user,
add_observation=add_observation,
report_infeasible_instructions=report_infeasible_instructions,
)
self.last_action_error = ""
Expand Down

0 comments on commit 6d53e60

Please sign in to comment.