Skip to content

Commit 0e2c71f

Browse files
authored
feat(vcr): add more pre-recorded cassettes for testing (#214)
Adds a slate of new cassettes that can be served for unit testing in dd-trace-js and dd-trace-py (to cut down on cassettes that live locally in each of those repositories). No release note as we'll release this with the initial vcr implementation, so this should all ship together.
1 parent 9349315 commit 0e2c71f

File tree

46 files changed

+7152
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+7152
-0
lines changed

.github/workflows/main.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,25 @@ jobs:
3333
run: pip install .[testing]
3434
- run: |
3535
riot run -p --pass-env ${{ matrix.python-version}} test
36+
cassettes-size:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Check VCR cassettes size
41+
run: |
42+
CASSETTES_SIZE=$(du -sb vcr-cassettes/ 2>/dev/null | cut -f1 || echo "0")
43+
44+
MAX_SIZE=2097152
45+
46+
echo "VCR cassettes size: ${CASSETTES_SIZE} bytes ($((CASSETTES_SIZE / 1024 / 1024))MB)"
47+
echo "Maximum allowed size: ${MAX_SIZE} bytes (2MB)"
48+
49+
if [ "$CASSETTES_SIZE" -gt "$MAX_SIZE" ]; then
50+
echo "❌ VCR cassettes directory is larger than 2MB!"
51+
echo "Current size: $((CASSETTES_SIZE / 1024 / 1024))MB"
52+
echo "Please review and clean up large cassette files."
53+
exit 1
54+
else
55+
echo "✅ VCR cassettes directory size is within limits"
56+
fi
57+
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
interactions:
2+
- request:
3+
body: "{\n \"model\": \"deepseek-chat\",\n \"messages\": [\n {\n \"role\":
4+
\"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n
5+
\ \"role\": \"user\",\n \"content\": \"Hello, OpenAI!\"\n }\n ],\n
6+
\ \"temperature\": 0.5,\n \"stream\": false,\n \"max_tokens\": 100,\n \"n\":
7+
1,\n \"user\": \"dd-trace-test\"\n}"
8+
headers:
9+
Accept:
10+
- application/json
11+
Accept-Encoding:
12+
- gzip,deflate
13+
Connection:
14+
- keep-alive
15+
Content-Length:
16+
- '303'
17+
Content-Type:
18+
- application/json
19+
User-Agent:
20+
- OpenAI/JS 4.0.0
21+
X-Stainless-Arch:
22+
- arm64
23+
X-Stainless-Lang:
24+
- js
25+
X-Stainless-Os:
26+
- MacOS
27+
X-Stainless-Package-Version:
28+
- 4.0.0
29+
X-Stainless-Runtime:
30+
- node
31+
X-Stainless-Runtime-Version:
32+
- v22.13.1
33+
method: POST
34+
uri: https://api.deepseek.com/chat/completions
35+
response:
36+
body:
37+
string: "{\n \"id\": \"chatcmpl-BkZxQcJvaxbyldxLmrNffCobBnd84\",\n \"object\":
38+
\"chat.completion\",\n \"created\": 1750441008,\n \"model\": \"deepseek-chat\",\n
39+
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
40+
\"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n
41+
\ \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\":
42+
null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
43+
21,\n \"completion_tokens\": 9,\n \"total_tokens\": 30,\n \"prompt_tokens_details\":
44+
{\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
45+
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
46+
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
47+
\"default\",\n \"system_fingerprint\": \"fp_07871e2ad8\"\n}\n"
48+
headers:
49+
CF-RAY:
50+
- 952d93a97f810f6f-EWR
51+
Connection:
52+
- keep-alive
53+
Content-Length:
54+
- '111'
55+
Content-Type:
56+
- application/json
57+
Date:
58+
- Fri, 20 Jun 2025 19:12:17 GMT
59+
Server:
60+
- cloudflare
61+
Set-Cookie:
62+
- __cf_bm=OVJpDC4uunjsiV8_fYewKdBcNb7Lh25RKaoIltEW3kI-1750446737-1.0.1.1-lRGs1fPN.cl7rWoNdw0jH0rMPmx3S8uA1jM71WtdVfi62cHgK9IXbg.AxCYHXFsIIHd01lpXSGIZV5p5pkHPhfKhPhwhXOOPtDvCY0bNVDg;
63+
path=/; expires=Fri, 20-Jun-25 19:42:17 GMT; domain=.deepseek.com; HttpOnly;
64+
Secure; SameSite=None
65+
Strict-Transport-Security:
66+
- max-age=31536000; includeSubDomains; preload
67+
X-Content-Type-Options:
68+
- nosniff
69+
access-control-allow-credentials:
70+
- 'true'
71+
cf-cache-status:
72+
- DYNAMIC
73+
vary:
74+
- origin, access-control-request-method, access-control-request-headers
75+
x-ds-trace-id:
76+
- 40ea0f5519c26ab95e6ffaf4badd4c3a
77+
status:
78+
code: 200
79+
message: OK
80+
version: 1

vcr-cassettes/openai/openai_audio_transcriptions_post_71305a25.yaml

Lines changed: 1319 additions & 0 deletions
Large diffs are not rendered by default.

vcr-cassettes/openai/openai_audio_translations_post_d5b5b8d6.yaml

Lines changed: 1076 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
interactions:
2+
- request:
3+
body: '{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"What is
4+
the weather in New York City?"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get
5+
the weather in a given city","parameters":{"type":"object","properties":{"city":{"type":"string","description":"The
6+
city to get the weather for"}}}}}],"tool_choice":"auto","stream":false}'
7+
headers:
8+
Accept:
9+
- application/json, text/plain, */*
10+
Accept-Encoding:
11+
- gzip, deflate
12+
Connection:
13+
- keep-alive
14+
Content-Length:
15+
- '371'
16+
Content-Type:
17+
- application/json
18+
User-Agent:
19+
- OpenAI/NodeJS/3.3.0
20+
method: POST
21+
uri: https://api.openai.com/v1/chat/completions
22+
response:
23+
body:
24+
string: "{\n \"id\": \"chatcmpl-BkXxzVZJidYwUN9O92szsgtTFdaDm\",\n \"object\":
25+
\"chat.completion\",\n \"created\": 1750433355,\n \"model\": \"gpt-3.5-turbo-0125\",\n
26+
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
27+
\"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n
28+
\ \"id\": \"call_H1u2zgdjr7Ha5bQoYHq9i763\",\n \"type\":
29+
\"function\",\n \"function\": {\n \"name\": \"get_weather\",\n
30+
\ \"arguments\": \"{\\\"city\\\":\\\"New York City\\\"}\"\n }\n
31+
\ }\n ],\n \"refusal\": null,\n \"annotations\":
32+
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n
33+
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 65,\n \"completion_tokens\":
34+
16,\n \"total_tokens\": 81,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
35+
0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
36+
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
37+
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
38+
\"default\",\n \"system_fingerprint\": null\n}\n"
39+
headers:
40+
CF-RAY:
41+
- 952c4cf54a978fea-BOS
42+
Connection:
43+
- keep-alive
44+
Content-Encoding:
45+
- gzip
46+
Content-Type:
47+
- application/json
48+
Date:
49+
- Fri, 20 Jun 2025 15:29:15 GMT
50+
Server:
51+
- cloudflare
52+
Set-Cookie:
53+
- __cf_bm=lwbC2CHslMY0bfBlRd.abcvstLtZYwaJ39.n1eS9JG4-1750433355-1.0.1.1-BkuJdjTwLvog0CiJkN6Y9MUy6sUA33xdjkTxcZfaSheQ6ajKGrI1EQPThO7bcMyD6YH1EaPXh8et52eWmXp1RafMd8wafsmLR1G5JSOytaU;
54+
path=/; expires=Fri, 20-Jun-25 15:59:15 GMT; domain=.api.openai.com; HttpOnly;
55+
Secure; SameSite=None
56+
- _cfuvid=MhSTF_Evj4D65btDYu2rj2seJvh_1FZymg0MU1lg60o-1750433355637-0.0.1.1-604800000;
57+
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
58+
Transfer-Encoding:
59+
- chunked
60+
X-Content-Type-Options:
61+
- nosniff
62+
access-control-expose-headers:
63+
- X-Request-ID
64+
alt-svc:
65+
- h3=":443"; ma=86400
66+
cf-cache-status:
67+
- DYNAMIC
68+
openai-organization:
69+
- datadog-staging
70+
openai-processing-ms:
71+
- '338'
72+
openai-version:
73+
- '2020-10-01'
74+
strict-transport-security:
75+
- max-age=31536000; includeSubDomains; preload
76+
x-envoy-upstream-service-time:
77+
- '340'
78+
x-ratelimit-limit-requests:
79+
- '10000'
80+
x-ratelimit-limit-tokens:
81+
- '50000000'
82+
x-ratelimit-remaining-requests:
83+
- '9999'
84+
x-ratelimit-remaining-tokens:
85+
- '49999987'
86+
x-ratelimit-reset-requests:
87+
- 6ms
88+
x-ratelimit-reset-tokens:
89+
- 0s
90+
x-request-id:
91+
- req_0903f0cfdf26e3659bb349882a0395e7
92+
status:
93+
code: 200
94+
message: OK
95+
version: 1
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
interactions:
2+
- request:
3+
body: '{"model":"gpt-3.5-turbo","messages":[{"role":"system","content":"You are
4+
a helpful assistant."},{"role":"user","content":"Hello, OpenAI!"}],"temperature":0.5,"stream":false,"max_tokens":100,"n":1,"user":"dd-trace-test"}'
5+
headers:
6+
Accept:
7+
- application/json, text/plain, */*
8+
Accept-Encoding:
9+
- gzip, deflate
10+
Connection:
11+
- keep-alive
12+
Content-Length:
13+
- '219'
14+
Content-Type:
15+
- application/json
16+
User-Agent:
17+
- OpenAI/NodeJS/3.3.0
18+
method: POST
19+
uri: https://api.openai.com/v1/chat/completions
20+
response:
21+
body:
22+
string: "{\n \"id\": \"chatcmpl-BkXa0GDvXwjXmEh6LZMuw0iQFKt8d\",\n \"object\":
23+
\"chat.completion\",\n \"created\": 1750431868,\n \"model\": \"gpt-3.5-turbo-0125\",\n
24+
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
25+
\"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n
26+
\ \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\":
27+
null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
28+
22,\n \"completion_tokens\": 9,\n \"total_tokens\": 31,\n \"prompt_tokens_details\":
29+
{\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
30+
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
31+
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
32+
\"default\",\n \"system_fingerprint\": null\n}\n"
33+
headers:
34+
CF-RAY:
35+
- 952c28a96f1ec351-EWR
36+
Connection:
37+
- keep-alive
38+
Content-Encoding:
39+
- gzip
40+
Content-Type:
41+
- application/json
42+
Date:
43+
- Fri, 20 Jun 2025 15:04:28 GMT
44+
Server:
45+
- cloudflare
46+
Set-Cookie:
47+
- __cf_bm=GuQFHiu.wMEyW0zJ6baqAJE9kyw93buvPmgLM.5klxE-1750431868-1.0.1.1-23veSeLqD7zNLyTTuMGByp8ut1oNUuU.nI.8YRxjzBuFIlGlX738TGr6uRkSKvlk1VOfDjTR0ZAuXXdu5R.vVUh0x9PNSW607dLCd9ty.q4;
48+
path=/; expires=Fri, 20-Jun-25 15:34:28 GMT; domain=.api.openai.com; HttpOnly;
49+
Secure; SameSite=None
50+
- _cfuvid=lY7guA00Orgtvo39tD.tireurOTxrW9IDyM20I_voxM-1750431868854-0.0.1.1-604800000;
51+
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
52+
Transfer-Encoding:
53+
- chunked
54+
X-Content-Type-Options:
55+
- nosniff
56+
access-control-expose-headers:
57+
- X-Request-ID
58+
alt-svc:
59+
- h3=":443"; ma=86400
60+
cf-cache-status:
61+
- DYNAMIC
62+
openai-organization:
63+
- datadog-staging
64+
openai-processing-ms:
65+
- '236'
66+
openai-version:
67+
- '2020-10-01'
68+
strict-transport-security:
69+
- max-age=31536000; includeSubDomains; preload
70+
x-envoy-upstream-service-time:
71+
- '240'
72+
x-ratelimit-limit-requests:
73+
- '10000'
74+
x-ratelimit-limit-tokens:
75+
- '50000000'
76+
x-ratelimit-remaining-requests:
77+
- '9999'
78+
x-ratelimit-remaining-tokens:
79+
- '49999985'
80+
x-ratelimit-reset-requests:
81+
- 6ms
82+
x-ratelimit-reset-tokens:
83+
- 0s
84+
x-request-id:
85+
- req_ee6face1aeb3c6085f9963c427425c04
86+
status:
87+
code: 200
88+
message: OK
89+
version: 1
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
interactions:
2+
- request:
3+
body: '{"model":"gpt-4o-mini","messages":[{"role":"user","content":[{"type":"text","text":"What
4+
is in this image?"},{"type":"image_url","image_url":{"url":"https://tinyurl.com/4mfz54bx"}}]}]}'
5+
headers:
6+
Accept:
7+
- application/json, text/plain, */*
8+
Accept-Encoding:
9+
- gzip, deflate
10+
Connection:
11+
- keep-alive
12+
Content-Length:
13+
- '184'
14+
Content-Type:
15+
- application/json
16+
User-Agent:
17+
- OpenAI/NodeJS/3.3.0
18+
method: POST
19+
uri: https://api.openai.com/v1/chat/completions
20+
response:
21+
body:
22+
string: "{\n \"id\": \"chatcmpl-BkXmjJeTCIKgy3PZ03ZYVnQFA5Sza\",\n \"object\":
23+
\"chat.completion\",\n \"created\": 1750432657,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
24+
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
25+
\"assistant\",\n \"content\": \"The image features a cat with striking
26+
blue eyes and a mix of light and dark fur. The background appears to be black,
27+
emphasizing the cat's features.\",\n \"refusal\": null,\n \"annotations\":
28+
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
29+
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 36848,\n \"completion_tokens\":
30+
31,\n \"total_tokens\": 36879,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
31+
0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
32+
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
33+
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
34+
\"default\",\n \"system_fingerprint\": \"fp_62a23a81ef\"\n}\n"
35+
headers:
36+
CF-RAY:
37+
- 952c3be5c8f88f7b-BOS
38+
Connection:
39+
- keep-alive
40+
Content-Encoding:
41+
- gzip
42+
Content-Type:
43+
- application/json
44+
Date:
45+
- Fri, 20 Jun 2025 15:17:40 GMT
46+
Server:
47+
- cloudflare
48+
Set-Cookie:
49+
- __cf_bm=bTyTTi2RpTe5ENkmNk1gSZLHB6TaAOn4hP67KV5bz14-1750432660-1.0.1.1-gYEtvicfSp9m2wu8oCzWVor7rG.0Bxok_BKH9fdwSoKfWKYX.fP4MB44hJTV5JW8WZup9E8mm4PiTKIC8ZVyG6QTL_jQiIFUAxT.IMGC8Ps;
50+
path=/; expires=Fri, 20-Jun-25 15:47:40 GMT; domain=.api.openai.com; HttpOnly;
51+
Secure; SameSite=None
52+
- _cfuvid=N8CxhlHAS9ekG3EkMsDg5WCr_fdo60E1cAQnK225Vso-1750432660355-0.0.1.1-604800000;
53+
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
54+
Transfer-Encoding:
55+
- chunked
56+
X-Content-Type-Options:
57+
- nosniff
58+
access-control-expose-headers:
59+
- X-Request-ID
60+
alt-svc:
61+
- h3=":443"; ma=86400
62+
cf-cache-status:
63+
- DYNAMIC
64+
openai-organization:
65+
- datadog-staging
66+
openai-processing-ms:
67+
- '3954'
68+
openai-version:
69+
- '2020-10-01'
70+
strict-transport-security:
71+
- max-age=31536000; includeSubDomains; preload
72+
x-envoy-upstream-service-time:
73+
- '3259'
74+
x-ratelimit-limit-input-images:
75+
- '50000'
76+
x-ratelimit-limit-requests:
77+
- '30000'
78+
x-ratelimit-limit-tokens:
79+
- '150000000'
80+
x-ratelimit-remaining-input-images:
81+
- '49999'
82+
x-ratelimit-remaining-requests:
83+
- '29999'
84+
x-ratelimit-remaining-tokens:
85+
- '149999226'
86+
x-ratelimit-reset-input-images:
87+
- 1ms
88+
x-ratelimit-reset-requests:
89+
- 2ms
90+
x-ratelimit-reset-tokens:
91+
- 0s
92+
x-request-id:
93+
- req_9906374ee983c1241767608f21705b47
94+
status:
95+
code: 200
96+
message: OK
97+
version: 1

0 commit comments

Comments
 (0)