Skip to content

Commit

Permalink
Patched /tmp/tmphsidd8lz/tests/metagpt/utils/test_token_counter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
patched.codes[bot] committed Oct 9, 2024
1 parent 796e9d3 commit 7aa26ef
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/metagpt/utils/test_token_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@


def test_count_message_tokens():
"""
Test the count_input_tokens function for message token counting.
Args:
None
Returns:
None: This test function uses assertions to verify the behavior of count_input_tokens.
"""Tests the count_input_tokens function with messages including a 'name' field.

Args:
None

Returns:
None: This test function uses assertions to verify the behavior of count_input_tokens.
"""
"""
messages = [
{"role": "user", "content": "Hello"},
{"role": "assistant", "content": "Hi there!"},
Expand All @@ -25,6 +42,18 @@ def test_count_message_tokens_with_name():
]
assert count_input_tokens(messages) == 17

"""
Test the count_input_tokens function for GPT-4 model.
This function verifies that the count_input_tokens function correctly calculates
the number of tokens in a given list of messages for the GPT-4 model.
Args:
None
Returns:
None: This test function uses assertions and does not return a value.
"""

def test_count_message_tokens_empty_input():
"""Empty input should return 3 tokens"""
Expand Down

0 comments on commit 7aa26ef

Please sign in to comment.