Skip to content
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8452958
change test utilities
sabrenner Oct 21, 2025
351b933
ai tests
sabrenner Oct 21, 2025
7b8b7a2
anthropic tests
sabrenner Oct 21, 2025
842f720
bedrock tests
sabrenner Oct 21, 2025
12e5167
vertexai tests
sabrenner Oct 21, 2025
4977220
langchain tests
sabrenner Oct 21, 2025
2d973a7
openai tests
sabrenner Oct 21, 2025
0bc153c
"integration" tests
sabrenner Oct 21, 2025
6b240ba
typescript tests
sabrenner Oct 21, 2025
d33b73c
fix ci errors
sabrenner Oct 21, 2025
c3f78d7
Merge branch 'master' of github.com:DataDog/dd-trace-js into sabrenne…
sabrenner Oct 21, 2025
365cf05
unskip some tests
sabrenner Oct 21, 2025
27c43e7
Merge branch 'master' of github.com:DataDog/dd-trace-js into sabrenne…
sabrenner Oct 21, 2025
0187e72
remove unused import
sabrenner Oct 21, 2025
5741e92
uncomment dummy api key
sabrenner Oct 21, 2025
b510c4a
fix sdk test
sabrenner Oct 21, 2025
86d28ea
openai completion models do not support cached tokens
sabrenner Oct 21, 2025
93c76e8
change MOCK_ANY assertion
sabrenner Oct 21, 2025
e0587a3
remove unnecessary metadata assertion
sabrenner Oct 21, 2025
a590892
Merge branch 'master' of github.com:DataDog/dd-trace-js into sabrenne…
sabrenner Oct 22, 2025
216da08
Merge branch 'master' into sabrenner/rework-llmobs-test-assertions
sabrenner Oct 24, 2025
75bd3dd
Merge branch 'master' into sabrenner/rework-llmobs-test-assertions
sabrenner Oct 27, 2025
161af29
Merge branch 'master' into sabrenner/rework-llmobs-test-assertions
sabrenner Oct 29, 2025
fd999cb
move requires
sabrenner Oct 29, 2025
e5eea39
in-person review comments
sabrenner Oct 29, 2025
9e85bb9
lint
sabrenner Oct 29, 2025
33645e8
Merge branch 'master' into sabrenner/rework-llmobs-test-assertions
sabrenner Oct 30, 2025
ef719cb
review comments
sabrenner Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 45 additions & 44 deletions packages/datadog-plugin-aws-sdk/test/fixtures/bedrockruntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,50 +154,51 @@ bedrockruntime.models = [
text: 'The capital of France is Paris.'
}
},
{
provider: PROVIDER.COHERE,
modelId: 'cohere.command-r-v1:0',
userPrompt: prompt,
requestBody: {
message: prompt,
temperature,
max_tokens: maxTokens
},
response: {
inputTokens: 7,
outputTokens: 335,
cacheReadTokens: 0,
cacheWriteTokens: 0,
text: 'The current capital of France is Paris. It has been the capital since 1958 and' +
' is also the most populous city in the country. Paris has a rich history and' +
' is known for its iconic landmarks and cultural significance.\n\nThe history' +
' of the capital of France is somewhat complex, with the city of Paris itself' +
' having a long and fascinating past. There was a shift in the capital\'s location' +
' over the centuries, with various cities and towns fulfilling the role. The' +
' earliest French capital based on historical records is thought to be the city' +
' of Tours. The capital moved to various locations, often due to political and' +
' dynastic reasons, including cities like Reims and Orleans. Paris initially' +
' became the capital during the era of the Louvre in the 14th century, under' +
' the rule of King Philip IV.\n\nThe status of Paris as the capital of France' +
' has been reaffirmed many times, even during the French Revolution and the' +
' establishment of the First French Empire by Napoleon Bonaparte. The city\'s' +
' significance grew further with its designation as the centre of the Department' +
' of Seine. Paris remained the capital through the changes in regime, including' +
' the restoration of the monarchy, the July Monarchy, the Second Empire, and' +
' the establishment of the French Third Republic.\n\nModern France\'s political' +
' system, following the end of the Second World War, saw the capital remain' +
' in Paris. The city continues to be a cultural hub, attracting artists, writers,' +
' and musicians from around the world. Paris remains a prominent global city,' +
' influencing art, fashion, gastronomy, and culture.\n\nIf you would like to' +
' know more about the history of France or the city of Paris, please let me' +
' know!'
},
streamedResponse: {
inputTokens: 7,
outputTokens: 7,
text: 'The capital of France is Paris.'
}
},
// TODO(sabrenner): input messages are undefined?
// {
// provider: PROVIDER.COHERE,
// modelId: 'cohere.command-r-v1:0',
// userPrompt: prompt,
// requestBody: {
// message: prompt,
// temperature,
// max_tokens: maxTokens
// },
// response: {
// inputTokens: 7,
// outputTokens: 335,
// cacheReadTokens: 0,
// cacheWriteTokens: 0,
// text: 'The current capital of France is Paris. It has been the capital since 1958 and' +
// ' is also the most populous city in the country. Paris has a rich history and' +
// ' is known for its iconic landmarks and cultural significance.\n\nThe history' +
// ' of the capital of France is somewhat complex, with the city of Paris itself' +
// ' having a long and fascinating past. There was a shift in the capital\'s location' +
// ' over the centuries, with various cities and towns fulfilling the role. The' +
// ' earliest French capital based on historical records is thought to be the city' +
// ' of Tours. The capital moved to various locations, often due to political and' +
// ' dynastic reasons, including cities like Reims and Orleans. Paris initially' +
// ' became the capital during the era of the Louvre in the 14th century, under' +
// ' the rule of King Philip IV.\n\nThe status of Paris as the capital of France' +
// ' has been reaffirmed many times, even during the French Revolution and the' +
// ' establishment of the First French Empire by Napoleon Bonaparte. The city\'s' +
// ' significance grew further with its designation as the centre of the Department' +
// ' of Seine. Paris remained the capital through the changes in regime, including' +
// ' the restoration of the monarchy, the July Monarchy, the Second Empire, and' +
// ' the establishment of the French Third Republic.\n\nModern France\'s political' +
// ' system, following the end of the Second World War, saw the capital remain' +
// ' in Paris. The city continues to be a cultural hub, attracting artists, writers,' +
// ' and musicians from around the world. Paris remains a prominent global city,' +
// ' influencing art, fashion, gastronomy, and culture.\n\nIf you would like to' +
// ' know more about the history of France or the city of Paris, please let me' +
// ' know!'
// },
// streamedResponse: {
// inputTokens: 7,
// outputTokens: 7,
// text: 'The capital of France is Paris.'
// }
// },
{
provider: PROVIDER.META,
modelId: 'meta.llama3-8b-instruct-v1:0',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
interactions:
- request:
body: '{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"What is
the weather in New York City?"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get
the weather in a given city","parameters":{"type":"object","properties":{"city":{"type":"string","description":"The
city to get the weather for"}}}}}],"tool_choice":"auto","stream":true,"stream_options":{"include_usage":true}}'
headers:
? !!python/object/apply:multidict._multidict.istr
- Accept
: - application/json
? !!python/object/apply:multidict._multidict.istr
- Accept-Encoding
: - gzip, deflate
? !!python/object/apply:multidict._multidict.istr
- Accept-Language
: - '*'
? !!python/object/apply:multidict._multidict.istr
- Connection
: - keep-alive
Content-Length:
- '410'
? !!python/object/apply:multidict._multidict.istr
- Content-Type
: - application/json
? !!python/object/apply:multidict._multidict.istr
- User-Agent
: - OpenAI/JS 6.4.0
? !!python/object/apply:multidict._multidict.istr
- X-Stainless-Arch
: - arm64
? !!python/object/apply:multidict._multidict.istr
- X-Stainless-Lang
: - js
? !!python/object/apply:multidict._multidict.istr
- X-Stainless-OS
: - MacOS
? !!python/object/apply:multidict._multidict.istr
- X-Stainless-Package-Version
: - 6.4.0
? !!python/object/apply:multidict._multidict.istr
- X-Stainless-Retry-Count
: - '0'
? !!python/object/apply:multidict._multidict.istr
- X-Stainless-Runtime
: - node
? !!python/object/apply:multidict._multidict.istr
- X-Stainless-Runtime-Version
: - v22.17.0
? !!python/object/apply:multidict._multidict.istr
- sec-fetch-mode
: - cors
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: 'data: {"id":"chatcmpl-CSw4x8Te053upyjQ9iUXktFGwbe3b","object":"chat.completion.chunk","created":1761012475,"model":"gpt-3.5-turbo-0125","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_FOfwGtELG2od6UEZKIOg9c3T","type":"function","function":{"name":"get_weather","arguments":""}}],"refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"zGW"}


data: {"id":"chatcmpl-CSw4x8Te053upyjQ9iUXktFGwbe3b","object":"chat.completion.chunk","created":1761012475,"model":"gpt-3.5-turbo-0125","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"34TgNLxdmdCRK"}


data: {"id":"chatcmpl-CSw4x8Te053upyjQ9iUXktFGwbe3b","object":"chat.completion.chunk","created":1761012475,"model":"gpt-3.5-turbo-0125","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"city"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"covhD9t0pUjb"}


data: {"id":"chatcmpl-CSw4x8Te053upyjQ9iUXktFGwbe3b","object":"chat.completion.chunk","created":1761012475,"model":"gpt-3.5-turbo-0125","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"lUWK1fqiRgy"}


data: {"id":"chatcmpl-CSw4x8Te053upyjQ9iUXktFGwbe3b","object":"chat.completion.chunk","created":1761012475,"model":"gpt-3.5-turbo-0125","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"New"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SBm0l8w1hkARw"}


data: {"id":"chatcmpl-CSw4x8Te053upyjQ9iUXktFGwbe3b","object":"chat.completion.chunk","created":1761012475,"model":"gpt-3.5-turbo-0125","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"
York"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"raK6arPwTlI"}


data: {"id":"chatcmpl-CSw4x8Te053upyjQ9iUXktFGwbe3b","object":"chat.completion.chunk","created":1761012475,"model":"gpt-3.5-turbo-0125","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"
City"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"EN7HgoklOww"}


data: {"id":"chatcmpl-CSw4x8Te053upyjQ9iUXktFGwbe3b","object":"chat.completion.chunk","created":1761012475,"model":"gpt-3.5-turbo-0125","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wd8s2xSmM3Xyc"}


data: {"id":"chatcmpl-CSw4x8Te053upyjQ9iUXktFGwbe3b","object":"chat.completion.chunk","created":1761012475,"model":"gpt-3.5-turbo-0125","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"d0tZAczcCMwrZm"}


data: {"id":"chatcmpl-CSw4x8Te053upyjQ9iUXktFGwbe3b","object":"chat.completion.chunk","created":1761012475,"model":"gpt-3.5-turbo-0125","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":65,"completion_tokens":16,"total_tokens":81,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"LKGhb8GvL"}


data: [DONE]


'
headers:
CF-RAY:
- 991d34444adb7d18-EWR
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Tue, 21 Oct 2025 02:07:56 GMT
Server:
- cloudflare
Set-Cookie:
- __cf_bm=IdNyfBOHfWBj_mBsHAlYh8nrMzoC7J8MxQqtcQHNgeE-1761012476-1.0.1.1-cpOs8CUoL4HF0cm9NmhB2T1Zj_ZPZQr.99BnM5b3trMjWVA.e9OmvLm6iwUvzbPm8DIHRNa24zpoOqp749wy.MoslcHCZHrAQY1FUrGKG5A;
path=/; expires=Tue, 21-Oct-25 02:37:56 GMT; domain=.api.openai.com; HttpOnly;
Secure; SameSite=None
- _cfuvid=qIJBolCy7BMyQbSPPS9nL2cD9fA3UOJ2HIi7Xmcc.qM-1761012476034-0.0.1.1-604800000;
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
openai-organization:
- datadog-staging
openai-processing-ms:
- '362'
openai-project:
- proj_gt6TQZPRbZfoY2J9AQlEJMpd
openai-version:
- '2020-10-01'
x-envoy-upstream-service-time:
- '407'
x-openai-proxy-wasm:
- v0.1
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '50000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '49999987'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_ee0a1796ca9a48fbabc207b1a2b7e925
status:
code: 200
message: OK
version: 1
Loading