@@ -52,6 +52,13 @@ const llama2 = {
52
52
}
53
53
}
54
54
55
+ const llama3 = {
56
+ modelId : 'meta.llama3-8b-instruct-v1:0' ,
57
+ body : {
58
+ prompt : 'who are you'
59
+ }
60
+ }
61
+
55
62
const titan = {
56
63
modelId : 'amazon.titan-text-lite-v1' ,
57
64
body : {
@@ -85,7 +92,7 @@ tap.test('non-conforming command is handled gracefully', async (t) => {
85
92
'Claude3' ,
86
93
'Cohere' ,
87
94
'CohereEmbed' ,
88
- 'Llama2 ' ,
95
+ 'Llama ' ,
89
96
'Titan' ,
90
97
'TitanEmbed'
91
98
] ) {
@@ -212,7 +219,7 @@ tap.test('cohere embed minimal command works', async (t) => {
212
219
tap . test ( 'llama2 minimal command works' , async ( t ) => {
213
220
t . context . updatePayload ( structuredClone ( llama2 ) )
214
221
const cmd = new BedrockCommand ( t . context . input )
215
- t . equal ( cmd . isLlama2 ( ) , true )
222
+ t . equal ( cmd . isLlama ( ) , true )
216
223
t . equal ( cmd . maxTokens , undefined )
217
224
t . equal ( cmd . modelId , llama2 . modelId )
218
225
t . equal ( cmd . modelType , 'completion' )
@@ -226,7 +233,32 @@ tap.test('llama2 complete command works', async (t) => {
226
233
payload . body . temperature = 0.5
227
234
t . context . updatePayload ( payload )
228
235
const cmd = new BedrockCommand ( t . context . input )
229
- t . equal ( cmd . isLlama2 ( ) , true )
236
+ t . equal ( cmd . isLlama ( ) , true )
237
+ t . equal ( cmd . maxTokens , 25 )
238
+ t . equal ( cmd . modelId , payload . modelId )
239
+ t . equal ( cmd . modelType , 'completion' )
240
+ t . equal ( cmd . prompt , payload . body . prompt )
241
+ t . equal ( cmd . temperature , payload . body . temperature )
242
+ } )
243
+
244
+ tap . test ( 'llama3 minimal command works' , async ( t ) => {
245
+ t . context . updatePayload ( structuredClone ( llama3 ) )
246
+ const cmd = new BedrockCommand ( t . context . input )
247
+ t . equal ( cmd . isLlama ( ) , true )
248
+ t . equal ( cmd . maxTokens , undefined )
249
+ t . equal ( cmd . modelId , llama3 . modelId )
250
+ t . equal ( cmd . modelType , 'completion' )
251
+ t . equal ( cmd . prompt , llama3 . body . prompt )
252
+ t . equal ( cmd . temperature , undefined )
253
+ } )
254
+
255
+ tap . test ( 'llama3 complete command works' , async ( t ) => {
256
+ const payload = structuredClone ( llama3 )
257
+ payload . body . max_gen_length = 25
258
+ payload . body . temperature = 0.5
259
+ t . context . updatePayload ( payload )
260
+ const cmd = new BedrockCommand ( t . context . input )
261
+ t . equal ( cmd . isLlama ( ) , true )
230
262
t . equal ( cmd . maxTokens , 25 )
231
263
t . equal ( cmd . modelId , payload . modelId )
232
264
t . equal ( cmd . modelType , 'completion' )
0 commit comments