@@ -34,7 +34,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
34
34
35
35
app . tool ( async ( _params ) => { } , {
36
36
name : 'noop' ,
37
- definition : 'Does nothing' ,
37
+ description : 'Does nothing' ,
38
38
} ) ;
39
39
40
40
// Assess
@@ -48,7 +48,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
48
48
49
49
app . tool ( async ( _params ) => { } , {
50
50
name : 'noop' ,
51
- definition : 'Does nothing' ,
51
+ description : 'Does nothing' ,
52
52
} ) ;
53
53
54
54
// Assess
@@ -68,7 +68,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
68
68
69
69
app . tool ( async ( _params ) => { } , {
70
70
name : 'noop' ,
71
- definition : 'Does nothing' ,
71
+ description : 'Does nothing' ,
72
72
} ) ;
73
73
74
74
// Act
@@ -88,7 +88,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
88
88
for ( const num of [ 1 , 2 , 3 , 4 , 5 ] ) {
89
89
app . tool ( async ( _params ) => { } , {
90
90
name : `noop${ num } ` ,
91
- definition : 'Does nothing' ,
91
+ description : 'Does nothing' ,
92
92
} ) ;
93
93
}
94
94
@@ -98,7 +98,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
98
98
} ,
99
99
{
100
100
name : 'mult' ,
101
- definition : 'Multiplies two numbers' ,
101
+ description : 'Multiplies two numbers' ,
102
102
}
103
103
) ;
104
104
@@ -151,7 +151,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
151
151
} ,
152
152
{
153
153
name : 'math' ,
154
- definition : 'Adds two numbers' ,
154
+ description : 'Adds two numbers' ,
155
155
}
156
156
) ;
157
157
@@ -167,7 +167,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
167
167
} ,
168
168
{
169
169
name : 'math' ,
170
- definition : 'Multiplies two numbers' ,
170
+ description : 'Multiplies two numbers' ,
171
171
}
172
172
) ;
173
173
@@ -183,12 +183,12 @@ describe('Class: BedrockAgentFunctionResolver', () => {
183
183
const app = new BedrockAgentFunctionResolver ( ) ;
184
184
185
185
class Lambda {
186
- @app . tool ( { name : 'hello' , definition : 'Says hello' } )
186
+ @app . tool ( { name : 'hello' , description : 'Says hello' } )
187
187
async helloWorld ( ) {
188
188
return 'Hello, world!' ;
189
189
}
190
190
191
- @app . tool ( { name : 'add' , definition : 'Adds two numbers' } )
191
+ @app . tool ( { name : 'add' , description : 'Adds two numbers' } )
192
192
async add ( params : { a : string ; b : string } ) {
193
193
const { a, b } = params ;
194
194
return Number . parseInt ( a ) + Number . parseInt ( b ) ;
@@ -229,23 +229,23 @@ describe('Class: BedrockAgentFunctionResolver', () => {
229
229
toolFunction : async ( ) => 'Hello, world' ,
230
230
toolParams : {
231
231
name : 'string' ,
232
- definition : 'Returns string' ,
232
+ description : 'Returns string' ,
233
233
} ,
234
234
expected : 'Hello, world' ,
235
235
} ,
236
236
{
237
237
toolFunction : async ( ) => 42 ,
238
238
toolParams : {
239
239
name : 'number' ,
240
- definition : 'Returns number' ,
240
+ description : 'Returns number' ,
241
241
} ,
242
242
expected : '42' ,
243
243
} ,
244
244
{
245
245
toolFunction : async ( ) => true ,
246
246
toolParams : {
247
247
name : 'boolean' ,
248
- definition : 'Returns boolean' ,
248
+ description : 'Returns boolean' ,
249
249
} ,
250
250
expected : 'true' ,
251
251
} ,
@@ -261,7 +261,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
261
261
} ) ,
262
262
toolParams : {
263
263
name : 'object' ,
264
- definition : 'Returns an object' ,
264
+ description : 'Returns an object' ,
265
265
} ,
266
266
expected :
267
267
'{"name":"John Doe","age":30,"isActive":true,"address":{"street":"123 Main St","city":"Anytown"}}' ,
@@ -270,7 +270,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
270
270
toolFunction : async ( ) => [ 1 , 'two' , false , null ] ,
271
271
toolParams : {
272
272
name : 'array' ,
273
- definition : 'Returns an array' ,
273
+ description : 'Returns an array' ,
274
274
} ,
275
275
expected : '[1,"two",false,null]' ,
276
276
} ,
@@ -298,14 +298,14 @@ describe('Class: BedrockAgentFunctionResolver', () => {
298
298
toolFunction : async ( ) => null ,
299
299
toolParams : {
300
300
name : 'null' ,
301
- definition : 'Returns null' ,
301
+ description : 'Returns null' ,
302
302
} ,
303
303
} ,
304
304
{
305
305
toolFunction : async ( ) => void 0 ,
306
306
toolParams : {
307
307
name : 'undefined' ,
308
- definition : 'Returns undefined' ,
308
+ description : 'Returns undefined' ,
309
309
} ,
310
310
} ,
311
311
] ) (
@@ -337,7 +337,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
337
337
} ,
338
338
{
339
339
name : 'error-tool' ,
340
- definition : 'Throws an error' ,
340
+ description : 'Throws an error' ,
341
341
}
342
342
) ;
343
343
@@ -365,7 +365,7 @@ describe('Class: BedrockAgentFunctionResolver', () => {
365
365
} ,
366
366
{
367
367
name : 'greeting' ,
368
- definition : 'Greets a person by name' ,
368
+ description : 'Greets a person by name' ,
369
369
}
370
370
) ;
371
371
0 commit comments