Skip to content

Commit

Permalink
chore: Fixed aws-sdk-v3 bedrock tests (#2211)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr authored May 23, 2024
1 parent b267695 commit 050469e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/versioned/aws-sdk-v3/bedrock-chat-completions.tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,23 @@ const helper = require('../../lib/agent_helper')
require('../../lib/metrics_helper')
const createAiResponseServer = require('../../lib/aws-server-stubs/ai-server')
const { FAKE_CREDENTIALS } = require('../../lib/aws-server-stubs')
const { version: pkgVersion } = require('@smithy/smithy-client/package.json')
const { DESTINATIONS } = require('../../../lib/config/attribute-filter')

const pkgVersion = (function () {
try {
const { version } = require('@smithy/smithy-client/package.json')
return version
} catch {
try {
const {
version
} = require('./node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/smithy-client/package.json')
return version
} catch {}
}
/* eslint-disable-next-line */
}())

const requests = {
ai21: (prompt, modelId) => ({
body: JSON.stringify({ prompt, temperature: 0.5, maxTokens: 100 }),
Expand Down

0 comments on commit 050469e

Please sign in to comment.