Skip to content

Commit

Permalink
don't know how that changed
Browse files Browse the repository at this point in the history
  • Loading branch information
recursix committed Sep 20, 2024
1 parent 1454fe1 commit 8cef8fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions browsergym/experiments/src/browsergym/experiments/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def count_messages_token(messages, model="gpt-4"):
for message in messages:
if hasattr(message, "content"):
message = message.content
elif isinstance(message, dict) and "content" in message:
message = message["content"]

if isinstance(message, str):
token_count += count_tokens(message, model)
Expand Down

0 comments on commit 8cef8fe

Please sign in to comment.