@@ -8,38 +8,59 @@ const output = z.object({
88} ) ;
99
1010async function main ( ) {
11+ const prompt =
12+ 'Tell me about recursion in programming. Quickly responding with a single answer is fine.' ;
13+
1114 const agent = new Agent ( {
1215 name : 'GPT-5 Assistant' ,
1316 model : 'gpt-5' ,
1417 instructions : "You're a helpful assistant." ,
1518 modelSettings : {
16- providerData : {
17- reasoning : { effort : 'minimal' } ,
18- text : { verbosity : 'low' } ,
19- } ,
19+ reasoning : { effort : 'minimal' } ,
20+ text : { verbosity : 'low' } ,
2021 } ,
2122 outputType : output ,
2223 } ) ;
2324
24- const prompt =
25- 'Tell me about recursion in programming. Quickly responding with a single answer is fine.' ;
2625 const result = await run ( agent , prompt ) ;
2726 console . log ( result . finalOutput ) ;
2827
28+ // The following code works in the same way:
29+ // const agent2 = agent.clone({
30+ // modelSettings: {
31+ // providerData: {
32+ // reasoning: { effort: 'minimal' },
33+ // text: { verbosity: 'low' },
34+ // }
35+ // },
36+ // });
37+ // const result2 = await run(agent2, prompt);
38+ // console.log(result2.finalOutput);
39+
2940 const completionsAgent = new Agent ( {
3041 name : 'GPT-5 Assistant' ,
3142 model : new OpenAIChatCompletionsModel ( new OpenAI ( ) , 'gpt-5' ) ,
3243 instructions : "You're a helpful assistant." ,
3344 modelSettings : {
34- providerData : {
35- reasoning_effort : 'minimal' ,
36- verbosity : 'low' ,
37- } ,
45+ reasoning : { effort : 'minimal' } ,
46+ text : { verbosity : 'low' } ,
3847 } ,
3948 outputType : output ,
4049 } ) ;
4150 const completionsResult = await run ( completionsAgent , prompt ) ;
4251 console . log ( completionsResult . finalOutput ) ;
52+
53+ // The following code works in the same way:
54+ // const completionsAgent2 = completionsAgent.clone({
55+ // modelSettings: {
56+ // providerData: {
57+ // reasoning_effort: 'minimal',
58+ // verbosity: 'low',
59+ // }
60+ // },
61+ // });
62+ // const completionsResult2 = await run(completionsAgent2, prompt);
63+ // console.log(completionsResult2.finalOutput);
4364}
4465
4566if ( require . main === module ) {
0 commit comments