Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit 11edade

Browse files
committed
chore: update test cassetes and imports
1 parent ee6f78f commit 11edade

18 files changed

Lines changed: 485 additions & 558 deletions

notdiamond/llms/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222

2323
# Details: https://python.langchain.com/v0.1/docs/guides/development/pydantic_compatibility/
24-
from pydantic.v1 import BaseModel
24+
from pydantic import BaseModel
2525
from pydantic_partial import create_partial_model
2626

2727
from notdiamond import settings

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/test_components/test_llms/cassettes/test_llm_request/test_async_llm_invoke_with_latency_tracking_success.yaml

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ interactions:
66
null}], "metric": "accuracy", "max_model_depth": 1, "hash_content": false}'
77
headers:
88
User-Agent:
9-
- Python-SDK/0.3.41
9+
- Python-SDK/0.4.2
1010
content-type:
1111
- application/json
1212
method: POST
1313
uri: https://staging-api.notdiamond.ai/v2/modelRouter/modelSelect
1414
response:
1515
body:
16-
string: '{"providers":[{"provider":"openai","model":"gpt-3.5-turbo"}],"session_id":"9d8c1977-c521-414d-ad32-9b4c69269fed"}'
16+
string: '{"providers":[{"provider":"openai","model":"gpt-3.5-turbo"}],"session_id":"a6c4cc9a-990f-4602-837c-61f9cc65f641"}'
1717
headers:
1818
CF-RAY:
19-
- 925cfc694d5d5a59-VIE
19+
- 92a07723aa105b8d-VIE
2020
Connection:
2121
- keep-alive
2222
Content-Type:
2323
- application/json
2424
Date:
25-
- Tue, 25 Mar 2025 08:19:55 GMT
25+
- Wed, 02 Apr 2025 12:52:47 GMT
2626
Server:
2727
- cloudflare
2828
Transfer-Encoding:
@@ -36,16 +36,14 @@ interactions:
3636
content-length:
3737
- '113'
3838
rndr-id:
39-
- 3dd2bf47-6e7c-4d95
39+
- cf1e8d4d-d176-4709
4040
x-render-origin-server:
4141
- uvicorn
4242
status:
4343
code: 200
4444
message: OK
4545
- request:
46-
body: '{"messages": [{"content": "Prompt: Tell me a joke.", "role": "user"}],
47-
"model": "gpt-3.5-turbo", "max_tokens": 10, "n": 1, "stream": false, "temperature":
48-
0.7}'
46+
body: '{"messages":[{"content":"Prompt: Tell me a joke.","role":"user"}],"model":"gpt-3.5-turbo","stream":false}'
4947
headers:
5048
accept:
5149
- application/json
@@ -54,13 +52,13 @@ interactions:
5452
connection:
5553
- keep-alive
5654
content-length:
57-
- '159'
55+
- '105'
5856
content-type:
5957
- application/json
6058
host:
6159
- api.openai.com
6260
user-agent:
63-
- AsyncOpenAI/Python 1.68.2
61+
- AsyncOpenAI/Python 1.60.2
6462
x-stainless-arch:
6563
- x64
6664
x-stainless-async:
@@ -70,9 +68,7 @@ interactions:
7068
x-stainless-os:
7169
- Linux
7270
x-stainless-package-version:
73-
- 1.68.2
74-
x-stainless-read-timeout:
75-
- '120.0'
71+
- 1.60.2
7672
x-stainless-retry-count:
7773
- '0'
7874
x-stainless-runtime:
@@ -83,34 +79,34 @@ interactions:
8379
uri: https://api.openai.com/v1/chat/completions
8480
response:
8581
body:
86-
string: "{\n \"id\": \"chatcmpl-BEtnnWjXmdkH9MGiaCSrzAPWPKofR\",\n \"object\":
87-
\"chat.completion\",\n \"created\": 1742890795,\n \"model\": \"gpt-3.5-turbo-0125\",\n
82+
string: "{\n \"id\": \"chatcmpl-BHrsGFnVhe9JvTv5cTyMAXRDnkhhX\",\n \"object\":
83+
\"chat.completion\",\n \"created\": 1743598368,\n \"model\": \"gpt-3.5-turbo-0125\",\n
8884
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
89-
\"assistant\",\n \"content\": \"Why couldn't the bicycle stand up by
90-
itself?\\n\\n\",\n \"refusal\": null,\n \"annotations\": []\n
91-
\ },\n \"logprobs\": null,\n \"finish_reason\": \"length\"\n
85+
\"assistant\",\n \"content\": \"Why did the scarecrow win an award?\\nBecause
86+
he was outstanding in his field!\",\n \"refusal\": null,\n \"annotations\":
87+
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
9288
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 14,\n \"completion_tokens\":
93-
10,\n \"total_tokens\": 24,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
89+
18,\n \"total_tokens\": 32,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
9490
0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
9591
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
9692
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
9793
\"default\",\n \"system_fingerprint\": null\n}\n"
9894
headers:
9995
CF-RAY:
100-
- 925cfc6dfaf25acf-VIE
96+
- 92a0772869bfd0f2-SOF
10197
Connection:
10298
- keep-alive
10399
Content-Type:
104100
- application/json
105101
Date:
106-
- Tue, 25 Mar 2025 08:19:55 GMT
102+
- Wed, 02 Apr 2025 12:52:48 GMT
107103
Server:
108104
- cloudflare
109105
Set-Cookie:
110-
- __cf_bm=27OqbJBi6rbSwSFakwNrnXdTx4amaL5Q5NBo5ITiOyM-1742890795-1.0.1.1-vnLFmpWppCuaIVsI32nRgwfpdQVtcZ855roW3Aa9TLU9CANLQhprKag2YZmVk1kF90Z8nJgJCFZonZsmjJwJ4i8o__Ff27WimZnWQ4bhZIg;
111-
path=/; expires=Tue, 25-Mar-25 08:49:55 GMT; domain=.api.openai.com; HttpOnly;
106+
- __cf_bm=prCQkj6QaXaNCcoJQihkW2Bij8KD3r5V93SDPloGzTY-1743598368-1.0.1.1-dVbJRn1vgFoSmHLYYQAXxmnzhM7ZHtl.wmAUPZc3MwBjS38D9AMOLxiiLBDfySNbyBJICDd9UvZoYX7TUy0eW3l7l3ZFBxGyHkntXsBeQCM;
107+
path=/; expires=Wed, 02-Apr-25 13:22:48 GMT; domain=.api.openai.com; HttpOnly;
112108
Secure; SameSite=None
113-
- _cfuvid=Q3pvjMF3pfyC3NCFMhS61FBlhDPgCbniTqiw2nUJYVA-1742890795568-0.0.1.1-604800000;
109+
- _cfuvid=RMfE4HeYit80e_VzMK5IFqbHsGAl1BUpiwEEOr.nEqs-1743598368623-0.0.1.1-604800000;
114110
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
115111
Transfer-Encoding:
116112
- chunked
@@ -123,11 +119,11 @@ interactions:
123119
cf-cache-status:
124120
- DYNAMIC
125121
content-length:
126-
- '842'
122+
- '869'
127123
openai-organization:
128124
- not-diamond-bdz8cg
129125
openai-processing-ms:
130-
- '232'
126+
- '402'
131127
openai-version:
132128
- '2020-10-01'
133129
strict-transport-security:
@@ -145,15 +141,15 @@ interactions:
145141
x-ratelimit-reset-tokens:
146142
- 0s
147143
x-request-id:
148-
- req_387f06b77cf31e7f9668ef3ad08161d8
144+
- req_4c614b950feb80d71f814b52153867bf
149145
status:
150146
code: 200
151147
message: OK
152148
- request:
153-
body: '{"session_id": "9d8c1977-c521-414d-ad32-9b4c69269fed", "provider": {"provider":
149+
body: '{"session_id": "a6c4cc9a-990f-4602-837c-61f9cc65f641", "provider": {"provider":
154150
"openai", "model": "gpt-3.5-turbo", "is_custom": false, "context_length": null,
155151
"input_price": null, "output_price": null, "latency": null}, "feedback": {"tokens_per_second":
156-
34.713605035147786}}'
152+
24.643946395404058}}'
157153
headers:
158154
Accept:
159155
- '*/*'
@@ -164,24 +160,24 @@ interactions:
164160
Content-Length:
165161
- '275'
166162
User-Agent:
167-
- Python-SDK/0.3.41
163+
- Python-SDK/0.4.2
168164
content-type:
169165
- application/json
170166
method: POST
171167
uri: https://staging-api.notdiamond.ai/v2/report/metrics/latency
172168
response:
173169
body:
174-
string: '{"detail":"requestID=80afc164-0f1d-4c56, Session 9d8c1977-c521-414d-ad32-9b4c69269fed
170+
string: '{"detail":"requestID=731fc3fe-1403-4396, Session a6c4cc9a-990f-4602-837c-61f9cc65f641
175171
does not belong to user d6b6f4db-9cd9-4a33-b885-506685cd2d34."}'
176172
headers:
177173
CF-RAY:
178-
- 925cfc710b24d0ce-SOF
174+
- 92a0772caf0fd0da-SOF
179175
Connection:
180176
- keep-alive
181177
Content-Type:
182178
- application/json
183179
Date:
184-
- Tue, 25 Mar 2025 08:19:56 GMT
180+
- Wed, 02 Apr 2025 12:52:49 GMT
185181
Server:
186182
- cloudflare
187183
Transfer-Encoding:
@@ -191,7 +187,7 @@ interactions:
191187
cf-cache-status:
192188
- DYNAMIC
193189
rndr-id:
194-
- 80afc164-0f1d-4c56
190+
- 731fc3fe-1403-4396
195191
vary:
196192
- Accept-Encoding
197193
x-render-origin-server:

0 commit comments

Comments
 (0)