Skip to content

Commit 2ca93d0

Browse files
committed
Fix incorrect test assertion for string input in Anthropic no-truncation scenario
messagesFromParams wraps string input values into an array, so the expected attribute value is JSON.stringify([longStringInput]), not the raw string.
1 parent a008245 commit 2ca93d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dev-packages/node-integration-tests/suites/tracing/anthropic/scenario-no-truncation.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function run() {
3737
messages: [{ role: 'user', content: longContent }],
3838
});
3939

40-
// Long string input (should not be wrapped in quotes)
40+
// Long string input (messagesFromParams wraps it in an array)
4141
const longStringInput = 'B'.repeat(50_000);
4242
await client.messages.create({
4343
model: 'claude-3-haiku-20240307',

dev-packages/node-integration-tests/suites/tracing/anthropic/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,10 +816,10 @@ describe('Anthropic integration', () => {
816816
[GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]: 1,
817817
}),
818818
}),
819-
// Long string input should not be truncated or wrapped in quotes
819+
// Long string input should not be truncated (messagesFromParams wraps it in an array)
820820
expect.objectContaining({
821821
data: expect.objectContaining({
822-
[GEN_AI_INPUT_MESSAGES_ATTRIBUTE]: longStringInput,
822+
[GEN_AI_INPUT_MESSAGES_ATTRIBUTE]: JSON.stringify([longStringInput]),
823823
[GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]: 1,
824824
}),
825825
}),

0 commit comments

Comments
 (0)