@@ -701,14 +701,17 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
701
701
with pytest .raises (APITimeoutError ):
702
702
self .client .post (
703
703
"/chat/completions" ,
704
- body = dict (
705
- messages = [
706
- {
707
- "role" : "user" ,
708
- "content" : "Say this is a test" ,
709
- }
710
- ],
711
- model = "gpt-3.5-turbo" ,
704
+ body = cast (
705
+ object ,
706
+ dict (
707
+ messages = [
708
+ {
709
+ "role" : "user" ,
710
+ "content" : "Say this is a test" ,
711
+ }
712
+ ],
713
+ model = "gpt-3.5-turbo" ,
714
+ ),
712
715
),
713
716
cast_to = httpx .Response ,
714
717
options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }},
@@ -724,14 +727,17 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
724
727
with pytest .raises (APIStatusError ):
725
728
self .client .post (
726
729
"/chat/completions" ,
727
- body = dict (
728
- messages = [
729
- {
730
- "role" : "user" ,
731
- "content" : "Say this is a test" ,
732
- }
733
- ],
734
- model = "gpt-3.5-turbo" ,
730
+ body = cast (
731
+ object ,
732
+ dict (
733
+ messages = [
734
+ {
735
+ "role" : "user" ,
736
+ "content" : "Say this is a test" ,
737
+ }
738
+ ],
739
+ model = "gpt-3.5-turbo" ,
740
+ ),
735
741
),
736
742
cast_to = httpx .Response ,
737
743
options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }},
@@ -1410,14 +1416,17 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
1410
1416
with pytest .raises (APITimeoutError ):
1411
1417
await self .client .post (
1412
1418
"/chat/completions" ,
1413
- body = dict (
1414
- messages = [
1415
- {
1416
- "role" : "user" ,
1417
- "content" : "Say this is a test" ,
1418
- }
1419
- ],
1420
- model = "gpt-3.5-turbo" ,
1419
+ body = cast (
1420
+ object ,
1421
+ dict (
1422
+ messages = [
1423
+ {
1424
+ "role" : "user" ,
1425
+ "content" : "Say this is a test" ,
1426
+ }
1427
+ ],
1428
+ model = "gpt-3.5-turbo" ,
1429
+ ),
1421
1430
),
1422
1431
cast_to = httpx .Response ,
1423
1432
options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }},
@@ -1433,14 +1442,17 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
1433
1442
with pytest .raises (APIStatusError ):
1434
1443
await self .client .post (
1435
1444
"/chat/completions" ,
1436
- body = dict (
1437
- messages = [
1438
- {
1439
- "role" : "user" ,
1440
- "content" : "Say this is a test" ,
1441
- }
1442
- ],
1443
- model = "gpt-3.5-turbo" ,
1445
+ body = cast (
1446
+ object ,
1447
+ dict (
1448
+ messages = [
1449
+ {
1450
+ "role" : "user" ,
1451
+ "content" : "Say this is a test" ,
1452
+ }
1453
+ ],
1454
+ model = "gpt-3.5-turbo" ,
1455
+ ),
1444
1456
),
1445
1457
cast_to = httpx .Response ,
1446
1458
options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }},
0 commit comments