Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
test: consolidate llama2 and llama3 for some tests
  • Loading branch information
amychisholm03 committed Jun 27, 2024
commit fcefe6eea7d9a3f1b745a8ec231190965ad1bb1c
9 changes: 3 additions & 6 deletions test/lib/aws-server-stubs/ai-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,11 @@ function handler(req, res) {
}

case 'meta.llama2-13b-chat-v1':
case 'meta.llama2-70b-chat-v1': {
response = responses.llama2.get(payload.prompt)
break
}

case 'meta.llama2-70b-chat-v1':
// llama3 responses are indentical, just return llama2 data
case 'meta.llama3-8b-instruct-v1:0':
case 'meta.llama3-70b-instruct-v1:0': {
response = responses.llama3.get(payload.prompt)
response = responses.llama.get(payload.prompt)
break
}

Expand Down
6 changes: 2 additions & 4 deletions test/lib/aws-server-stubs/ai-server/responses/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ const amazon = require('./amazon')
const claude = require('./claude')
const claude3 = require('./claude3')
const cohere = require('./cohere')
const llama2 = require('./llama2')
const llama3 = require('./llama3')
const llama = require('./llama')

module.exports = {
ai21,
amazon,
claude,
claude3,
cohere,
llama2,
llama3
llama
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const responses = new Map()
const { contentType, reqId } = require('./constants')

responses.set('text llama2 ultimate question', {
responses.set('text llama ultimate question', {
headers: {
'content-type': contentType,
'x-amzn-requestid': reqId,
Expand All @@ -25,7 +25,7 @@ responses.set('text llama2 ultimate question', {
}
})

responses.set('text llama2 ultimate question streamed', {
responses.set('text llama ultimate question streamed', {
headers: {
'content-type': 'application/vnd.amazon.eventstream',
'x-amzn-requestid': reqId,
Expand Down Expand Up @@ -68,7 +68,7 @@ responses.set('text llama2 ultimate question streamed', {
]
})

responses.set('text llama2 ultimate question error', {
responses.set('text llama ultimate question error', {
headers: {
'content-type': contentType,
'x-amzn-requestid': reqId,
Expand Down
84 changes: 0 additions & 84 deletions test/lib/aws-server-stubs/ai-server/responses/llama3.js

This file was deleted.

10 changes: 3 additions & 7 deletions test/versioned/aws-sdk-v3/bedrock-chat-completions.tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ const requests = {
body: JSON.stringify({ prompt, temperature: 0.5, max_tokens: 100 }),
modelId
}),
llama2: (prompt, modelId) => ({
body: JSON.stringify({ prompt, max_gen_length: 100, temperature: 0.5 }),
modelId
}),
llama3: (prompt, modelId) => ({
llama: (prompt, modelId) => ({
body: JSON.stringify({ prompt, max_gen_length: 100, temperature: 0.5 }),
modelId
})
Expand Down Expand Up @@ -102,8 +98,8 @@ tap.afterEach(async (t) => {
{ modelId: 'anthropic.claude-v2', resKey: 'claude' },
{ modelId: 'anthropic.claude-3-haiku-20240307-v1:0', resKey: 'claude3' },
{ modelId: 'cohere.command-text-v14', resKey: 'cohere' },
{ modelId: 'meta.llama2-13b-chat-v1', resKey: 'llama2' },
{ modelId: 'meta.llama3-8b-instruct-v1:0', resKey: 'llama3' }
{ modelId: 'meta.llama2-13b-chat-v1', resKey: 'llama' },
{ modelId: 'meta.llama3-8b-instruct-v1:0', resKey: 'llama' }
].forEach(({ modelId, resKey }) => {
tap.test(`${modelId}: should properly create completion segment`, (t) => {
const { bedrock, client, responses, agent, expectedExternalPath } = t.context
Expand Down