This commit is contained in:
Xuan Son Nguyen 2024-12-17 22:28:53 +01:00
parent d4b9ec098b
commit 101e772c73

View file

@ -131,8 +131,8 @@ def test_same_prompt_give_same_result():
@pytest.mark.parametrize( @pytest.mark.parametrize(
"content,n_tokens", "content,n_tokens",
[ [
("I believe the meaning of life is", 7), ("I believe the meaning of life is", 9),
("This is a test", 4), ("This is a test", 6),
] ]
) )
def test_embedding_usage_single(content, n_tokens): def test_embedding_usage_single(content, n_tokens):
@ -155,4 +155,4 @@ def test_embedding_usage_multiple():
}) })
assert res.status_code == 200 assert res.status_code == 200
assert res.body['usage']['prompt_tokens'] == res.body['usage']['total_tokens'] assert res.body['usage']['prompt_tokens'] == res.body['usage']['total_tokens']
assert res.body['usage']['prompt_tokens'] == 2 * 7 assert res.body['usage']['prompt_tokens'] == 2 * 9