Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieG committed Jul 31, 2024
1 parent ed903ea commit 0ac699a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions agentops/time_travel.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def fetch_time_travel_id(ttd_id):
with open("agentops_time_travel.json", "w") as file:
json.dump(prompt_to_returns_map, file, indent=4)

Check warning on line 54 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L54

Added line #L54 was not covered by tests

set_time_travel_active_state("on")
set_time_travel_active_state(True)

Check warning on line 56 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L56

Added line #L56 was not covered by tests
except ApiServerException as e:
manage_time_travel_state(activated=False, error=e)
except Exception as e:
Expand Down Expand Up @@ -94,15 +94,15 @@ def check_time_travel_active():
return False

Check warning on line 94 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L94

Added line #L94 was not covered by tests


def set_time_travel_active_state(active_setting):
def set_time_travel_active_state(is_active: bool):
config_path = ".agentops_time_travel.yaml"
try:

Check warning on line 99 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L98-L99

Added lines #L98 - L99 were not covered by tests
with open(config_path, "r") as config_file:
config = yaml.safe_load(config_file) or {}
except FileNotFoundError:
config = {}

Check warning on line 103 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L101-L103

Added lines #L101 - L103 were not covered by tests

config["Time_Travel_Debugging_Active"] = True if active_setting == "on" else False
config["Time_Travel_Debugging_Active"] = is_active

Check warning on line 105 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L105

Added line #L105 was not covered by tests

with open(config_path, "w") as config_file:
try:
Expand All @@ -113,7 +113,7 @@ def set_time_travel_active_state(active_setting):
)
return

Check warning on line 114 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L114

Added line #L114 was not covered by tests

if active_setting == "on":
if is_active:
manage_time_travel_state(activated=True)
print("AgentOps: Time Travel Activated")

Check warning on line 118 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L117-L118

Added lines #L117 - L118 were not covered by tests
else:
Expand All @@ -135,4 +135,4 @@ def manage_time_travel_state(activated=False, error=None):
else:
reset_terminal()

Check warning on line 136 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L136

Added line #L136 was not covered by tests
if error is not None:
print(f"Deactivating Time Travel. Error with configuration: {error}")
print(f"🖇 Deactivating Time Travel. Error with configuration: {error}")

Check warning on line 138 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L138

Added line #L138 was not covered by tests

0 comments on commit 0ac699a

Please sign in to comment.