Skip to content

Commit

Permalink
supporting tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieG committed Aug 16, 2024
1 parent 351725c commit 7a41ada
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions agentops/time_travel.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def fetch_completion_override_from_time_travel_cache(kwargs):

# NOTE: This is specific to the messages: [{'role': '...', 'content': '...'}, ...] format
def find_cache_hit(prompt_messages, completion_overrides):
if not isinstance(prompt_messages, list):
if not isinstance(prompt_messages, (list, tuple)):
print(

Check warning on line 66 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L66

Added line #L66 was not covered by tests
"Time Travel Error - unexpected type for prompt_messages. Expected 'list'. Got ",
"Time Travel Error - unexpected type for prompt_messages. Expected 'list' or 'tuple'. Got ",
type(prompt_messages),
)
return None

Check warning on line 70 in agentops/time_travel.py

View check run for this annotation

Codecov / codecov/patch

agentops/time_travel.py#L70

Added line #L70 was not covered by tests
Expand Down
6 changes: 3 additions & 3 deletions tests/core_manual_tests/time_travel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

try:
chat_completion_1 = client.chat.completions.create(
messages=(
messages=[
{
"content": "Come up with a random superpower that isn't time travel. Just return the superpower in the format: 'Superpower: [superpower]'",
"role": "user",
},
),
}
],
model="gpt-3.5-turbo-0125",
)
content1 = chat_completion_1.choices[0].message.content
Expand Down

0 comments on commit 7a41ada

Please sign in to comment.