Skip to content

Commit 1ac8678

Browse files
authored
fix(anthropic): upgrade supported version of anthropic SDK (#604)
1 parent 3f32542 commit 1ac8678

File tree

9 files changed

+598
-447
lines changed

9 files changed

+598
-447
lines changed

package-lock.json

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

packages/instrumentation-anthropic/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
"tslib": "^2.8.1"
4646
},
4747
"devDependencies": {
48-
"@anthropic-ai/sdk": "^0.32.1",
48+
"@anthropic-ai/sdk": "^0.50.4",
4949
"@pollyjs/adapter-node-http": "^6.0.6",
50+
"@pollyjs/adapter-fetch": "^6.0.7",
5051
"@pollyjs/core": "^6.0.6",
5152
"@pollyjs/persister-fs": "^6.0.6",
5253
"@types/mocha": "^10.0.10",

packages/instrumentation-anthropic/recordings/Test-Anthropic-instrumentation_3769946143/should-set-attributes-in-span-for-completions-streaming_2198009633/recording.har

Lines changed: 58 additions & 62 deletions
Large diffs are not rendered by default.

packages/instrumentation-anthropic/recordings/Test-Anthropic-instrumentation_3769946143/should-set-attributes-in-span-for-completions_1224394582/recording.har

Lines changed: 55 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,160 +8,151 @@
88
},
99
"entries": [
1010
{
11-
"_id": "3d54b7ae72fa4dc3272d8f7c5bcddf6d",
11+
"_id": "52fd228e6030791ac9667034a8d64d2b",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
15-
"bodySize": 131,
15+
"bodySize": 118,
1616
"cookies": [],
1717
"headers": [
1818
{
19-
"_fromType": "array",
20-
"name": "content-length",
21-
"value": "131"
22-
},
23-
{
24-
"_fromType": "array",
2519
"name": "accept",
2620
"value": "application/json"
2721
},
2822
{
29-
"_fromType": "array",
23+
"name": "anthropic-version",
24+
"value": "2023-06-01"
25+
},
26+
{
3027
"name": "content-type",
3128
"value": "application/json"
3229
},
3330
{
34-
"_fromType": "array",
3531
"name": "user-agent",
36-
"value": "Anthropic/JS 0.20.1"
32+
"value": "Anthropic/JS 0.50.4"
3733
},
3834
{
39-
"_fromType": "array",
40-
"name": "x-stainless-lang",
41-
"value": "js"
35+
"name": "x-stainless-arch",
36+
"value": "arm64"
4237
},
4338
{
44-
"_fromType": "array",
45-
"name": "x-stainless-package-version",
46-
"value": "0.20.1"
39+
"name": "x-stainless-lang",
40+
"value": "js"
4741
},
4842
{
49-
"_fromType": "array",
5043
"name": "x-stainless-os",
5144
"value": "MacOS"
5245
},
5346
{
54-
"_fromType": "array",
55-
"name": "x-stainless-arch",
56-
"value": "arm64"
47+
"name": "x-stainless-package-version",
48+
"value": "0.50.4"
49+
},
50+
{
51+
"name": "x-stainless-retry-count",
52+
"value": "0"
5753
},
5854
{
59-
"_fromType": "array",
6055
"name": "x-stainless-runtime",
6156
"value": "node"
6257
},
6358
{
64-
"_fromType": "array",
6559
"name": "x-stainless-runtime-version",
66-
"value": "v18.17.1"
60+
"value": "v22.10.0"
6761
},
6862
{
69-
"_fromType": "array",
70-
"name": "anthropic-version",
71-
"value": "2023-06-01"
72-
},
73-
{
74-
"_fromType": "array",
75-
"name": "accept-encoding",
76-
"value": "gzip,deflate"
77-
},
78-
{
79-
"name": "host",
80-
"value": "api.anthropic.com"
63+
"name": "x-stainless-timeout",
64+
"value": "600"
8165
}
8266
],
83-
"headersSize": 548,
67+
"headersSize": 525,
8468
"httpVersion": "HTTP/1.1",
8569
"method": "POST",
8670
"postData": {
8771
"mimeType": "application/json",
8872
"params": [],
89-
"text": "{\n \"model\": \"claude-2\",\n \"max_tokens_to_sample\": 300,\n \"prompt\": \"\\n\\nHuman: Tell me a joke about OpenTelemetry\\n\\nAssistant:\"\n}"
73+
"text": "{\"model\":\"claude-2\",\"max_tokens_to_sample\":300,\"prompt\":\"\\n\\nHuman: Tell me a joke about OpenTelemetry\\n\\nAssistant:\"}"
9074
},
9175
"queryString": [],
9276
"url": "https://api.anthropic.com/v1/complete"
9377
},
9478
"response": {
95-
"bodySize": 600,
79+
"bodySize": 776,
9680
"content": {
97-
"encoding": "base64",
9881
"mimeType": "application/json",
99-
"size": 600,
100-
"text": "[\"H4sIAAAAAAAAA4xSwWobMRD9lWddfNmY2s0h+BLS9hBDIJdAWjCYyWpqqdZqttIoW7X034s2DSQlh14EmuG9efPm/TJaRzZb08swBlYv0XTG2+fK4d366qOupw2fX1R7MX7m8/c3m3u2pnsJ2Rpcc+JlBiF41cBo3aKc4MogCfQgRXE7crzjwANrqtt93Md7VzFRhjp+3YUm6hklOhrHeokP3FPJDK9wZBEFeaSYF43kNXDiqFCZKa302qZHi0zedtibT3Opww7qfDxhB0ePDBXBQLGil6j8Q/Nib9DI7yb5R1l7fZ8xUTjBRxUQHiitcBsZmWp+ni7qOLWZX6TgFGXqMDESUwgVPmZNZWhi+ZFTbWqOoCQlWjhOvNibJ4dIYQVVCnoKARTfdEod6TLjKJHRJ/pZL3GFWFTr7NRs1A5ORp6pgj+xxVCRfVNDqjyMmkGKb3Li/NbFVrhhxcDzLvBfG9HSzlRtZcfUrK4YJDGUexclyLGeqeOB7VMSFqYzWWU8JKY8R2f+Zf5eOPZsOjOI5dACGKhYPtus1n8hZjsbcl0GilvTmSDHw/9E9fcfAAAA//8DAOxCDkfmAgAA\"]"
82+
"size": 776,
83+
"text": "{\"type\":\"completion\",\"id\":\"compl_01MkPQy9DMgyJBBE1Z5FpHkf\",\"completion\":\" Here is an OpenTelemetry joke:\\n\\nWhy was the trace so hard to follow?\\nIt had no spans!\\n\\nIt's a play on words about OpenTelemetry spans, which are a fundamental concept in distributed tracing. The traces for an OpenTelemetry instrumented app consist of spans that allow you to follow the flow of execution across services. Without spans, it would be hard to understand the causal relationships and trace how a request propagates through the system.\\n\\nHope you enjoyed that little OpenTelemetry humor! Let me know if you'd like to hear another telemetry or observability related joke.\",\"stop_reason\":\"stop_sequence\",\"model\":\"claude-2.1\",\"stop\":\"\\n\\nHuman:\",\"log_id\":\"compl_01MkPQy9DMgyJBBE1Z5FpHkf\"}"
10184
},
10285
"cookies": [],
10386
"headers": [
10487
{
105-
"name": "date",
106-
"value": "Fri, 05 Apr 2024 11:20:12 GMT"
88+
"name": "anthropic-organization-id",
89+
"value": "4591fe84-abb6-4b93-9858-2c0c0b11204e"
10790
},
10891
{
109-
"name": "content-type",
110-
"value": "application/json"
92+
"name": "cf-cache-status",
93+
"value": "DYNAMIC"
11194
},
11295
{
113-
"name": "transfer-encoding",
114-
"value": "chunked"
96+
"name": "cf-ray",
97+
"value": "94d3d12f5858556e-EWR"
11598
},
11699
{
117100
"name": "connection",
118101
"value": "keep-alive"
119102
},
120103
{
121-
"name": "request-id",
122-
"value": "req_01MF9Mk2Pm5K7idAdKGVuKtn"
104+
"name": "content-encoding",
105+
"value": "gzip"
123106
},
124107
{
125-
"name": "x-cloud-trace-context",
126-
"value": "bfd63b2c08c48c70d3ba04406af4864c"
108+
"name": "content-type",
109+
"value": "application/json"
127110
},
128111
{
129-
"name": "via",
130-
"value": "1.1 google"
112+
"name": "date",
113+
"value": "Mon, 09 Jun 2025 21:45:46 GMT"
131114
},
132115
{
133-
"name": "cf-cache-status",
134-
"value": "DYNAMIC"
116+
"name": "request-id",
117+
"value": "req_011CPyNzBf3pvguzANuUuKAW"
135118
},
136119
{
137120
"name": "server",
138121
"value": "cloudflare"
139122
},
140123
{
141-
"name": "cf-ray",
142-
"value": "86f925a33e42a268-FCO"
124+
"name": "strict-transport-security",
125+
"value": "max-age=31536000; includeSubDomains; preload"
143126
},
144127
{
145-
"name": "content-encoding",
146-
"value": "gzip"
128+
"name": "transfer-encoding",
129+
"value": "chunked"
130+
},
131+
{
132+
"name": "via",
133+
"value": "1.1 google"
134+
},
135+
{
136+
"name": "x-robots-tag",
137+
"value": "none"
147138
}
148139
],
149-
"headersSize": 339,
140+
"headersSize": 440,
150141
"httpVersion": "HTTP/1.1",
151142
"redirectURL": "",
152143
"status": 200,
153144
"statusText": "OK"
154145
},
155-
"startedDateTime": "2024-04-05T11:20:06.759Z",
156-
"time": 5267,
146+
"startedDateTime": "2025-06-09T21:45:38.365Z",
147+
"time": 8503,
157148
"timings": {
158149
"blocked": -1,
159150
"connect": -1,
160151
"dns": -1,
161152
"receive": 0,
162153
"send": 0,
163154
"ssl": -1,
164-
"wait": 5267
155+
"wait": 8503
165156
}
166157
}
167158
],

0 commit comments

Comments
 (0)