Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove active_browser_element / available_browser_elements from ActionEvent.to_prompt_dict #926

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions openadapt/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,6 @@ def to_prompt_dict(self) -> dict[str, Any]:
Returns:
dictionary containing relevant properties from the ActionEvent.
"""
if self.active_browser_element:
import ipdb

ipdb.set_trace()
action_dict = deepcopy(
{
key: val
Expand All @@ -518,6 +514,9 @@ def to_prompt_dict(self) -> dict[str, Any]:
action_dict["available_segment_descriptions"] = (
self.available_segment_descriptions
)

# TODO:
"""
if self.active_browser_element:
action_dict["active_browser_element"] = str(self.active_browser_element)
if self.available_browser_elements:
Expand All @@ -526,11 +525,7 @@ def to_prompt_dict(self) -> dict[str, Any]:
action_dict["available_browser_elements"] = str(
self.available_browser_elements
)

if self.active_browser_element:
import ipdb

ipdb.set_trace()
"""
return action_dict

@property
Expand Down
4 changes: 3 additions & 1 deletion openadapt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,9 +961,11 @@ def wrapper_retry(*args: tuple, **kwargs: dict[str, Any]) -> Any:
logger.warning(exc)
exceptions.append(str(exc))
retries += 1
last_exception = exc
# Raise the final exception with a detailed message and keep its traceback
raise RuntimeError(
f"Failed after {max_retries} retries with exceptions: {exceptions}"
)
) from last_exception

return wrapper_retry

Expand Down
Loading