Skip to content

Commit 7f66caa

Browse files
Output tests
1 parent 4634680 commit 7f66caa

File tree

3 files changed

+60
-109
lines changed

3 files changed

+60
-109
lines changed
Lines changed: 39 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,41 @@
11
{
2-
"id": "chatcmpl-B71qqu4Y7m1ZVuF5YGqxz7LXzgf0Y",
3-
"created": 1741015112,
4-
"model": "gpt-4o-mini-2024-07-18",
5-
"object": "chat.completion",
6-
"system_fingerprint": "fp_7fcd609668",
7-
"choices": [
8-
{
9-
"finish_reason": "stop",
10-
"index": 0,
11-
"message": {
12-
"content": "Arrr, matey! What ye be seein’ in this here image is a grand pathway, made of wooden planks, weavin' its way through a lush and green landscape. The verdant grass sways in the gentle breeze, and the sky above be a brilliant blue, decorated with fluffy white clouds. Ye can spot trees and bushes on either side, makin' it a perfect setting for a stroll amongst nature. A peaceful place for a pirate at heart, aye!",
13-
"role": "assistant",
14-
"tool_calls": null,
15-
"function_call": null
16-
}
17-
}
18-
],
19-
"provider_time": 3692885792,
20-
"edenai_time": null,
21-
"usage": {
22-
"completion_tokens": 99,
23-
"prompt_tokens": 1170,
24-
"total_tokens": 1269,
25-
"completion_tokens_details": [
26-
[
27-
"accepted_prediction_tokens",
28-
0
29-
],
30-
[
31-
"audio_tokens",
32-
0
33-
],
34-
[
35-
"reasoning_tokens",
36-
0
37-
],
38-
[
39-
"rejected_prediction_tokens",
40-
0
41-
],
42-
[
43-
"text_tokens",
44-
null
45-
]
46-
],
47-
"prompt_tokens_details": [
48-
[
49-
"audio_tokens",
50-
0
51-
],
52-
[
53-
"cached_tokens",
54-
1024
55-
],
56-
[
57-
"text_tokens",
58-
null
59-
],
60-
[
61-
"image_tokens",
62-
null
63-
]
64-
]
65-
},
66-
"service_tier": "default",
67-
"cost": 0.0002349
2+
"id": "chatcmpl-B71RkHwax2QEWCrZXYl3mZh20fC5y",
3+
"created": 1741013556,
4+
"model": "gpt-4o-mini-2024-07-18",
5+
"object": "chat.completion",
6+
"system_fingerprint": "fp_7fcd609668",
7+
"choices": [
8+
{
9+
"finish_reason": "stop",
10+
"index": 0,
11+
"message": {
12+
"content": "Arrr matey! In this fine image, ye be seein' a wooden pathway leadin' through a grand expanse of green grass and wild foliage. The sky above be painted in shades of blue, with fluffy clouds driftin' lazily. The boardwalk be settin' sail through this scenic wonder, invitin' ye to wander and explore the treasures of nature that lie ahead. Aye, 'tis a sight to behold for any landlubber or sea dog!",
13+
"role": "assistant",
14+
"tool_calls": null,
15+
"function_call": null
16+
}
17+
}
18+
],
19+
"provider_time": 3751955066,
20+
"edenai_time": null,
21+
"usage": {
22+
"completion_tokens": 100,
23+
"prompt_tokens": 1170,
24+
"total_tokens": 1270,
25+
"completion_tokens_details": {
26+
"accepted_prediction_tokens": 0,
27+
"audio_tokens": 0,
28+
"reasoning_tokens": 0,
29+
"rejected_prediction_tokens": 0,
30+
"text_tokens": null
31+
},
32+
"prompt_tokens_details": {
33+
"audio_tokens": 0,
34+
"cached_tokens": 0,
35+
"text_tokens": null,
36+
"image_tokens": null
37+
}
38+
},
39+
"service_tier": "default",
40+
"cost": 0.00023549999999999998
6841
}

edenai_apis/features/llm/chat/chat_response.json

Lines changed: 13 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,46 +22,19 @@
2222
"completion_tokens": 100,
2323
"prompt_tokens": 1170,
2424
"total_tokens": 1270,
25-
"completion_tokens_details": [
26-
[
27-
"accepted_prediction_tokens",
28-
0
29-
],
30-
[
31-
"audio_tokens",
32-
0
33-
],
34-
[
35-
"reasoning_tokens",
36-
0
37-
],
38-
[
39-
"rejected_prediction_tokens",
40-
0
41-
],
42-
[
43-
"text_tokens",
44-
null
45-
]
46-
],
47-
"prompt_tokens_details": [
48-
[
49-
"audio_tokens",
50-
0
51-
],
52-
[
53-
"cached_tokens",
54-
0
55-
],
56-
[
57-
"text_tokens",
58-
null
59-
],
60-
[
61-
"image_tokens",
62-
null
63-
]
64-
]
25+
"completion_tokens_details": {
26+
"accepted_prediction_tokens": 0,
27+
"audio_tokens": 0,
28+
"reasoning_tokens": 0,
29+
"rejected_prediction_tokens": 0,
30+
"text_tokens": null
31+
},
32+
"prompt_tokens_details": {
33+
"audio_tokens": 0,
34+
"cached_tokens": 0,
35+
"text_tokens": null,
36+
"image_tokens": null
37+
}
6538
},
6639
"service_tier": "default",
6740
"cost": 0.00023549999999999998

edenai_apis/tests/features/test_sync_features.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,14 @@ def test_feature_saved_output(self, provider, feature, subfeature):
5757
)
5858

5959
# Step 2 (Action) :
60-
standardized = compare_responses(
61-
feature, subfeature, saved_output["standardized_response"]
62-
)
60+
if feature != "llm":
61+
standardized = compare_responses(
62+
feature, subfeature, saved_output["standardized_response"]
63+
)
64+
else:
65+
standardized = compare_responses(
66+
feature, subfeature, saved_output
67+
)
6368

6469
# Step 3 (Assert) :
6570
assert standardized, "The output is not standardized"

0 commit comments

Comments
 (0)