Skip to content

Commit 7f9c680

Browse files
committed
fix tests
1 parent 3506199 commit 7f9c680

File tree

6 files changed

+84
-103
lines changed

6 files changed

+84
-103
lines changed

src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interactions:
1818
host:
1919
- api.openai.com
2020
user-agent:
21-
- AsyncOpenAI/Python 1.54.4
21+
- AsyncOpenAI/Python 1.45.0
2222
x-stainless-arch:
2323
- arm64
2424
x-stainless-async:
@@ -28,9 +28,7 @@ interactions:
2828
x-stainless-os:
2929
- MacOS
3030
x-stainless-package-version:
31-
- 1.54.4
32-
x-stainless-retry-count:
33-
- '0'
31+
- 1.45.0
3432
x-stainless-runtime:
3533
- CPython
3634
x-stainless-runtime-version:
@@ -39,66 +37,66 @@ interactions:
3937
uri: https://api.openai.com/v1/chat/completions
4038
response:
4139
body:
42-
string: 'data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}]}
40+
string: 'data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}]}
4341
4442
45-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"This"},"logprobs":null,"finish_reason":null}]}
43+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"This"},"logprobs":null,"finish_reason":null}]}
4644
4745
48-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
46+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
4947
is"},"logprobs":null,"finish_reason":null}]}
5048
5149
52-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
50+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
5351
a"},"logprobs":null,"finish_reason":null}]}
5452
5553
56-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
54+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
5755
test"},"logprobs":null,"finish_reason":null}]}
5856
5957
60-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
58+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
6159
6260
63-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
61+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
6462
this"},"logprobs":null,"finish_reason":null}]}
6563
6664
67-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
65+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
6866
is"},"logprobs":null,"finish_reason":null}]}
6967
7068
71-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
69+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
7270
a"},"logprobs":null,"finish_reason":null}]}
7371
7472
75-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
73+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
7674
test"},"logprobs":null,"finish_reason":null}]}
7775
7876
79-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
77+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
8078
8179
82-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
80+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
8381
this"},"logprobs":null,"finish_reason":null}]}
8482
8583
86-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
84+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
8785
is"},"logprobs":null,"finish_reason":null}]}
8886
8987
90-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
88+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
9189
a"},"logprobs":null,"finish_reason":null}]}
9290
9391
94-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
92+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
9593
test"},"logprobs":null,"finish_reason":null}]}
9694
9795
98-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}]}
96+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}]}
9997
10098
101-
data: {"id":"chatcmpl-AfUGyiyLhMxyQ7bE5ZmRJ8rDijY11","object":"chat.completion.chunk","created":1734451180,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
99+
data: {"id":"chatcmpl-AfUMEfTSy7r5MXMK4HG275fb30380","object":"chat.completion.chunk","created":1734451506,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
102100
103101
104102
data: [DONE]
@@ -109,13 +107,13 @@ interactions:
109107
CF-Cache-Status:
110108
- DYNAMIC
111109
CF-RAY:
112-
- 8f381f23caffe15c-MRS
110+
- 8f38271bdade1892-MRS
113111
Connection:
114112
- keep-alive
115113
Content-Type:
116114
- text/event-stream; charset=utf-8
117115
Date:
118-
- Tue, 17 Dec 2024 15:59:40 GMT
116+
- Tue, 17 Dec 2024 16:05:07 GMT
119117
Server:
120118
- cloudflare
121119
Set-Cookie: test_set_cookie
@@ -129,7 +127,7 @@ interactions:
129127
- h3=":443"; ma=86400
130128
openai-organization: test_openai_org_id
131129
openai-processing-ms:
132-
- '593'
130+
- '534'
133131
openai-version:
134132
- '2020-10-01'
135133
strict-transport-security:
@@ -147,7 +145,7 @@ interactions:
147145
x-ratelimit-reset-tokens:
148146
- 1ms
149147
x-request-id:
150-
- req_2c10ce5cfeea691c1aa466f566da73b0
148+
- req_742a264604e9185cd9e3c76af1596462
151149
status:
152150
code: 200
153151
message: OK

src/tests/openai/cassettes/test_async_image_generation.yaml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interactions:
2323
host:
2424
- api.openai.com
2525
user-agent:
26-
- AsyncOpenAI/Python 1.54.4
26+
- AsyncOpenAI/Python 1.45.0
2727
x-stainless-arch:
2828
- arm64
2929
x-stainless-async:
@@ -33,9 +33,7 @@ interactions:
3333
x-stainless-os:
3434
- MacOS
3535
x-stainless-package-version:
36-
- 1.54.4
37-
x-stainless-retry-count:
38-
- '0'
36+
- 1.45.0
3937
x-stainless-runtime:
4038
- CPython
4139
x-stainless-runtime-version:
@@ -44,26 +42,20 @@ interactions:
4442
uri: https://api.openai.com/v1/images/generations
4543
response:
4644
body:
47-
string: "{\n \"created\": 1734451207,\n \"data\": [\n {\n \"revised_prompt\":
48-
\"A delightful image of a small and adorable baby sea otter. This fluffy infant
49-
creature floats majestically on its back, its tiny webbed paws tucked appealingly
50-
over its fuzzy belly. Its large, round eyes, full of youthful curiosity, shine
51-
with innocence. As the otter contentedly floats on the serene, sparkling surface
52-
of the ocean bathed in the warm rays of a golden sunset, it tosses a gleaming
53-
sea shell from one paw to the other with a playful manner so characteristic
54-
of otters.\",\n \"url\": \"https://oaidalleapiprodscus.blob.core.windows.net/private/org-Bj6XXxxFgkJeYFnhs2nXl0nr/user-HqmprrkKKvVVzITKBT4hXs1S/img-RLtSZRmrobT6Xbu7FWPwiCeM.png?st=2024-12-17T15%3A00%3A07Z&se=2024-12-17T17%3A00%3A07Z&sp=r&sv=2024-08-04&sr=b&rscd=inline&rsct=image/png&skoid=d505667d-d6c1-4a0a-bac7-5c84a87759f8&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2024-12-17T09%3A42%3A14Z&ske=2024-12-18T09%3A42%3A14Z&sks=b&skv=2024-08-04&sig=7YKCfmRECvp90/JHQao6nknwrFpYxXrZ0gFR%2Bdey/z4%3D\"\n
45+
string: "{\n \"created\": 1734451534,\n \"data\": [\n {\n \"url\":
46+
\"https://oaidalleapiprodscus.blob.core.windows.net/private/org-Bj6XXxxFgkJeYFnhs2nXl0nr/user-HqmprrkKKvVVzITKBT4hXs1S/img-5sG1HIwdjoncMdci0m2fhzU6.png?st=2024-12-17T15%3A05%3A34Z&se=2024-12-17T17%3A05%3A34Z&sp=r&sv=2024-08-04&sr=b&rscd=inline&rsct=image/png&skoid=d505667d-d6c1-4a0a-bac7-5c84a87759f8&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2024-12-17T07%3A51%3A08Z&ske=2024-12-18T07%3A51%3A08Z&sks=b&skv=2024-08-04&sig=xGHROzavVMmM4pt4GKM7Pi/5OxWE9Cponih74mPCMFY%3D\"\n
5547
\ }\n ]\n}\n"
5648
headers:
5749
CF-Cache-Status:
5850
- DYNAMIC
5951
CF-RAY:
60-
- 8f381f754d7eee72-MXP
52+
- 8f38277f282be201-MRS
6153
Connection:
6254
- keep-alive
6355
Content-Type:
6456
- application/json
6557
Date:
66-
- Tue, 17 Dec 2024 16:00:07 GMT
58+
- Tue, 17 Dec 2024 16:05:34 GMT
6759
Server:
6860
- cloudflare
6961
Set-Cookie: test_set_cookie
@@ -76,16 +68,16 @@ interactions:
7668
alt-svc:
7769
- h3=":443"; ma=86400
7870
content-length:
79-
- '1059'
71+
- '545'
8072
openai-organization: test_openai_org_id
8173
openai-processing-ms:
82-
- '13967'
74+
- '11909'
8375
openai-version:
8476
- '2020-10-01'
8577
strict-transport-security:
8678
- max-age=31536000; includeSubDomains; preload
8779
x-request-id:
88-
- req_fa1aa7ee7cca31bd46bd020cae9e26c1
80+
- req_37e35da989e33251fb79085360b3d0ba
8981
status:
9082
code: 200
9183
message: OK

src/tests/openai/cassettes/test_chat_completion.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interactions:
1818
host:
1919
- api.openai.com
2020
user-agent:
21-
- OpenAI/Python 1.54.4
21+
- OpenAI/Python 1.45.0
2222
x-stainless-arch:
2323
- arm64
2424
x-stainless-async:
@@ -28,9 +28,7 @@ interactions:
2828
x-stainless-os:
2929
- MacOS
3030
x-stainless-package-version:
31-
- 1.54.4
32-
x-stainless-retry-count:
33-
- '0'
31+
- 1.45.0
3432
x-stainless-runtime:
3533
- CPython
3634
x-stainless-runtime-version:
@@ -39,8 +37,8 @@ interactions:
3937
uri: https://api.openai.com/v1/chat/completions
4038
response:
4139
body:
42-
string: "{\n \"id\": \"chatcmpl-AfUGvwtr6mZr8LYkW4eWopTigyfMu\",\n \"object\":
43-
\"chat.completion\",\n \"created\": 1734451177,\n \"model\": \"gpt-4-0613\",\n
40+
string: "{\n \"id\": \"chatcmpl-AfUMABiILvC9G3CLL48bkigCzdunc\",\n \"object\":
41+
\"chat.completion\",\n \"created\": 1734451502,\n \"model\": \"gpt-4-0613\",\n
4442
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
4543
\"assistant\",\n \"content\": \"This is a test. This is a test. This
4644
is a test.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n
@@ -54,13 +52,13 @@ interactions:
5452
CF-Cache-Status:
5553
- DYNAMIC
5654
CF-RAY:
57-
- 8f381f0eea310d76-MRS
55+
- 8f382701ff91e214-MRS
5856
Connection:
5957
- keep-alive
6058
Content-Type:
6159
- application/json
6260
Date:
63-
- Tue, 17 Dec 2024 15:59:38 GMT
61+
- Tue, 17 Dec 2024 16:05:04 GMT
6462
Server:
6563
- cloudflare
6664
Set-Cookie: test_set_cookie
@@ -76,7 +74,7 @@ interactions:
7674
- '775'
7775
openai-organization: test_openai_org_id
7876
openai-processing-ms:
79-
- '1080'
77+
- '2359'
8078
openai-version:
8179
- '2020-10-01'
8280
strict-transport-security:
@@ -94,7 +92,7 @@ interactions:
9492
x-ratelimit-reset-tokens:
9593
- 1ms
9694
x-request-id:
97-
- req_579c343e5003db6374cb44f220bf9101
95+
- req_0b3fb77de89cb0aead6c74871fa0e31d
9896
status:
9997
code: 200
10098
message: OK

0 commit comments

Comments
 (0)