Skip to content

Commit 050469e

Browse files
authored
chore: Fixed aws-sdk-v3 bedrock tests (#2211)
1 parent b267695 commit 050469e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/versioned/aws-sdk-v3/bedrock-chat-completions.tap.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,23 @@ const helper = require('../../lib/agent_helper')
1111
require('../../lib/metrics_helper')
1212
const createAiResponseServer = require('../../lib/aws-server-stubs/ai-server')
1313
const { FAKE_CREDENTIALS } = require('../../lib/aws-server-stubs')
14-
const { version: pkgVersion } = require('@smithy/smithy-client/package.json')
1514
const { DESTINATIONS } = require('../../../lib/config/attribute-filter')
1615

16+
const pkgVersion = (function () {
17+
try {
18+
const { version } = require('@smithy/smithy-client/package.json')
19+
return version
20+
} catch {
21+
try {
22+
const {
23+
version
24+
} = require('./node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/smithy-client/package.json')
25+
return version
26+
} catch {}
27+
}
28+
/* eslint-disable-next-line */
29+
}())
30+
1731
const requests = {
1832
ai21: (prompt, modelId) => ({
1933
body: JSON.stringify({ prompt, temperature: 0.5, maxTokens: 100 }),

0 commit comments

Comments
 (0)