Skip to content

Commit bc4285c

Browse files
test: Add translation_data to chat completions data. (#239)
1 parent 0236e86 commit bc4285c

1 file changed

Lines changed: 26 additions & 13 deletions

File tree

tests/lib/streaming/test_chat_completions_streaming.py

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def test_parse_nothing(client: Writer, respx_mock: MockRouter, monkeypatch: pyte
7070
parsed=None,
7171
refusal=None,
7272
role='assistant',
73-
tool_calls=None
73+
tool_calls=None,
74+
translation_data=None
7475
)
7576
)
7677
]
@@ -146,7 +147,8 @@ def test_parse_nothing(client: Writer, respx_mock: MockRouter, monkeypatch: pyte
146147
# parsed=Location(city='San Francisco', temperature=61.0, units='f'),
147148
# refusal=None,
148149
# role='assistant',
149-
# tool_calls=[]
150+
# tool_calls=[],
151+
# translation_data=None
150152
# )
151153
# )
152154
# ],
@@ -316,7 +318,8 @@ def test_parse_nothing(client: Writer, respx_mock: MockRouter, monkeypatch: pyte
316318
# parsed=Location(city='San Francisco', temperature=65.0, units='f'),
317319
# refusal=None,
318320
# role='assistant',
319-
# tool_calls=[]
321+
# tool_calls=[],
322+
# translation_data=None
320323
# )
321324
# ),
322325
# ParsedChatCompletionChoice[Location](
@@ -329,7 +332,8 @@ def test_parse_nothing(client: Writer, respx_mock: MockRouter, monkeypatch: pyte
329332
# parsed=Location(city='San Francisco', temperature=61.0, units='f'),
330333
# refusal=None,
331334
# role='assistant',
332-
# tool_calls=[]
335+
# tool_calls=[],
336+
# translation_data=None
333337
# )
334338
# ),
335339
# ParsedChatCompletionChoice[Location](
@@ -342,7 +346,8 @@ def test_parse_nothing(client: Writer, respx_mock: MockRouter, monkeypatch: pyte
342346
# parsed=Location(city='San Francisco', temperature=59.0, units='f'),
343347
# refusal=None,
344348
# role='assistant',
345-
# tool_calls=[]
349+
# tool_calls=[],
350+
# translation_data=None
346351
# )
347352
# )
348353
# ]
@@ -416,7 +421,8 @@ def test_parse_nothing(client: Writer, respx_mock: MockRouter, monkeypatch: pyte
416421
# parsed=None,
417422
# refusal="I'm sorry, I can't assist with that request.",
418423
# role='assistant',
419-
# tool_calls=[]
424+
# tool_calls=[],
425+
# translation_data=None
420426
# )
421427
# )
422428
# ]
@@ -487,7 +493,8 @@ def test_content_logprobs_events(client: Writer, respx_mock: MockRouter, monkeyp
487493
parsed=None,
488494
refusal=None,
489495
role='assistant',
490-
tool_calls=None
496+
tool_calls=None,
497+
translation_data=None
491498
)
492499
)
493500
]
@@ -579,7 +586,8 @@ def test_refusal_logprobs_events(client: Writer, respx_mock: MockRouter, monkeyp
579586
parsed=None,
580587
refusal="I'm very sorry, but I can't assist with that.",
581588
role='assistant',
582-
tool_calls=None
589+
tool_calls=None,
590+
translation_data=None
583591
)
584592
)
585593
]
@@ -637,7 +645,8 @@ class GetWeatherArgs(BaseModel):
637645
index=0,
638646
type='function'
639647
)
640-
]
648+
],
649+
translation_data=None
641650
)
642651
)
643652
]
@@ -669,7 +678,8 @@ class GetWeatherArgs(BaseModel):
669678
index=0,
670679
type='function'
671680
)
672-
]
681+
],
682+
translation_data=None
673683
)
674684
)
675685
]
@@ -751,7 +761,8 @@ class GetStockPrice(BaseModel):
751761
index=1,
752762
type='function'
753763
)
754-
]
764+
],
765+
translation_data=None
755766
)
756767
)
757768
]
@@ -894,7 +905,8 @@ def test_non_pydantic_response_format(client: Writer, respx_mock: MockRouter, mo
894905
parsed=None,
895906
refusal=None,
896907
role='assistant',
897-
tool_calls=None
908+
tool_calls=None,
909+
translation_data=None
898910
)
899911
)
900912
]
@@ -962,7 +974,8 @@ def test_allows_non_strict_tools_but_no_parsing(
962974
index=0,
963975
type='function'
964976
)
965-
]
977+
],
978+
translation_data=None
966979
)
967980
)
968981
]

0 commit comments

Comments
 (0)