8000 openai - tests - document parametrized tests · strands-agents/sdk-python@beb84ef · GitHub
[go: up one dir, main page]

Skip to content

Commit beb84ef

Browse files
committed
openai - tests - document parametrized tests
1 parent 480fe3c commit beb84ef

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tests/strands/models/test_litellm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def test_update_config(model, model_id):
6262
@pytest.mark.parametrize(
6363
"content, exp_result",
6464
[
65+
# Case 1: Thinking
6566
(
6667
{
6768
"reasoningContent": {
@@ -77,6 +78,7 @@ def test_update_config(model, model_id):
7778
"type": "thinking",
7879
},
7980
),
81+
# Case 2: Video
8082
(
8183
{
8284
"video": {
@@ -91,6 +93,7 @@ def test_update_config(model, model_id):
9193
},
9294
},
9395
),
96+
# Case 3: Text
9497
(
9598
{"text": "hello"},
9699
{"type": "text", "text": "hello"},

tests/strands/types/models/test_openai.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def system_prompt():
6262
@pytest.mark.parametrize(
6363
"content, exp_result",
6464
[
65+
# Case 1: Image
6566
(
6667
{
6768
"image": {
@@ -78,10 +79,12 @@ def system_prompt():
7879
"type": "image_url",
7980
},
8081
),
82+
# Case 2: Text
8183
(
8284
{"text": "hello"},
8385
{"type": "text", "text": "hello"},
8486
),
87+
# Case 3: Other
8588
(
8689
{"other": {"a": 1}},
8790
{
@@ -243,10 +246,12 @@ def test_format_request(model, messages, tool_specs, system_prompt):
243246
@pytest 8000 .mark.parametrize(
244247
("event", "exp_chunk"),
245248
[
249+
# Case 1: Message start
246250
(
247251
{"chunk_type": "message_start"},
248252
{"messageStart": {"role": "assistant"}},
249253
),
254+
# Case 2: Content Start - Tool Use
250255
(
251256
{
252257
"chunk_type": "content_start",
@@ -255,10 +260,12 @@ def test_format_request(model, messages, tool_specs, system_prompt):
255260
},
256261
{"contentBlockStart": {"start": {"toolUse": {"name": "calculator", "toolUseId": "c1"}}}},
257262
),
263+
# Case 3: Content Start - Text
258264
(
259265
{"chunk_type": "content_start", "data_type": "text"},
260266
{"contentBlockStart": {"start": {}}},
261267
),
268+
# Case 4: Content Delta - Tool Use
262269
(
263270
{
264271
"chunk_type": "content_delta",
@@ -267,26 +274,32 @@ def test_format_request(model, messages, tool_specs, system_prompt):
267274
},
268275
{"contentBlockDelta": {"delta": {"toolUse": {"input": '{"expression": "2+2"}'}}}},
269276
),
277+
# Case 5: Content Delta - Text
270278
(
271279
{"chunk_type": "content_delta", "data_type": "text", "data": "hello"},
272280
{"contentBlockDelta": {"delta": {"text": "hello"}}},
273281
),
282+
# Case 6: Content Stop
274283
(
275284
{"chunk_type": "content_stop"},
276285
{"contentBlockStop": {}},
277286
),
287+
# Case 7: Message Stop - Tool Use
278288
(
279289
{"chunk_type": "message_stop", "data": "tool_calls"},
280290
{"messageStop": {"stopReason": "tool_use"}},
281291
),
292+
# Case 8: Message Stop - Max Tokens
282293
(
283294
{"chunk_type": "message_stop", "data": "length"},
284295
{"messageStop": {"stopReason": "max_tokens"}},
285296
),
297+
# Case 9: Message Stop - End Turn
286298
(
287299
{"chunk_type": "message_stop", "data": "stop"},
288300
{"messageStop": {"stopReason": "end_turn"}},
289301
),
302+
# Case 10: Metadata
290303
(
291304
{
292305
"chunk_type": "metadata",

0 commit comments

Comments
 (0)
0