@@ -67,7 +67,33 @@ describe('Maestro Runs', () => {
6767 } ,
6868 { name : 'completeness' , description : 'Cover all major areas' , isMandatory : false } ,
6969 ] ,
70- tools : [ 'web_search' , 'file_search' ] ,
70+ tools : [
71+ { type : 'web_search' , urls : [ 'https://arxiv.org' , 'https://openai.com' ] } ,
72+ { type : 'file_search' , file_ids : [ 'file_123' , 'file_456' ] , labels : [ 'ai' , 'ml' , 'nlp' ] } ,
73+ {
74+ type : 'http' ,
75+ function : {
76+ name : 'get_weather' ,
77+ description : 'Get the weather for a given city' ,
78+ parameters : {
79+ type : 'object' ,
80+ properties : { city : { type : 'string' , description : 'The city to get the weather for' } } ,
81+ required : [ 'city' ] ,
82+ } ,
83+ } ,
84+ endpoint : {
85+ url : 'https://api.openweathermap.org/data/2.5/weather' ,
86+ headers : { Authorization : 'Bearer 1234567890' } ,
87+ } ,
88+ } ,
89+ {
90+ type : 'mcp' ,
91+ server_label : 'openai' ,
92+ server_url : 'https://my-mcp-server.com' ,
93+ headers : { Authorization : 'Bearer 1234567890' } ,
94+ allowed_tools : [ 'get_weather' ] ,
95+ } ,
96+ ] ,
7197 tool_resources : {
7298 file_search : {
7399 file_ids : [ 'file_123' , 'file_456' ] ,
@@ -174,7 +200,7 @@ describe('Maestro Runs', () => {
174200 } ) ;
175201 } ) ;
176202
177- describe ( 'create_and_poll ' , ( ) => {
203+ describe ( 'createAndPoll ' , ( ) => {
178204 it ( 'should create and poll until completion with default options' , async ( ) => {
179205 const body : Models . MaestroRunRequest = {
180206 input : 'Test input' ,
@@ -199,7 +225,7 @@ describe('Maestro Runs', () => {
199225 mockClient . post . mockResolvedValue ( createResponse ) ;
200226 mockClient . get . mockResolvedValue ( completedResponse ) ;
201227
202- const response = await runs . create_and_poll ( body ) ;
228+ const response = await runs . createAndPoll ( body ) ;
203229
204230 expect ( mockClient . post ) . toHaveBeenCalledWith ( '/maestro/runs' , { body } ) ;
205231 expect ( mockClient . get ) . toHaveBeenCalledWith ( '/maestro/runs/run_123' ) ;
@@ -235,14 +261,14 @@ describe('Maestro Runs', () => {
235261 mockClient . post . mockResolvedValue ( createResponse ) ;
236262 mockClient . get . mockResolvedValue ( completedResponse ) ;
237263
238- const response = await runs . create_and_poll ( body , options ) ;
264+ const response = await runs . createAndPoll ( body , options ) ;
239265
240266 expect ( mockClient . post ) . toHaveBeenCalledWith ( '/maestro/runs' , { body } ) ;
241267 expect ( mockClient . get ) . toHaveBeenCalledWith ( '/maestro/runs/run_123' ) ;
242268 expect ( response ) . toEqual ( completedResponse ) ;
243269 } ) ;
244270
245- it ( 'should call create_and_poll with correct parameters' , async ( ) => {
271+ it ( 'should call createAndPoll with correct parameters' , async ( ) => {
246272 const body : Models . MaestroRunRequest = {
247273 input : 'Test input' ,
248274 } ;
@@ -271,7 +297,7 @@ describe('Maestro Runs', () => {
271297 mockClient . post . mockResolvedValue ( createResponse ) ;
272298 mockClient . get . mockResolvedValue ( completedResponse ) ;
273299
274- const response = await runs . create_and_poll ( body , options ) ;
300+ const response = await runs . createAndPoll ( body , options ) ;
275301
276302 expect ( mockClient . post ) . toHaveBeenCalledWith ( '/maestro/runs' , { body } ) ;
277303 expect ( mockClient . get ) . toHaveBeenCalledWith ( '/maestro/runs/run_123' ) ;
@@ -286,7 +312,7 @@ describe('Maestro Runs', () => {
286312 const error = new AI21Error ( ) ;
287313 mockClient . post . mockRejectedValue ( error ) ;
288314
289- await expect ( runs . create_and_poll ( body ) ) . rejects . toThrow ( ) ;
315+ await expect ( runs . createAndPoll ( body ) ) . rejects . toThrow ( ) ;
290316 } ) ;
291317
292318 it ( 'should handle polling errors' , async ( ) => {
@@ -306,7 +332,7 @@ describe('Maestro Runs', () => {
306332 mockClient . post . mockResolvedValue ( createResponse ) ;
307333 mockClient . get . mockRejectedValue ( error ) ;
308334
309- await expect ( runs . create_and_poll ( body ) ) . rejects . toThrow ( ) ;
335+ await expect ( runs . createAndPoll ( body ) ) . rejects . toThrow ( ) ;
310336 } ) ;
311337 } ) ;
312338
0 commit comments