@@ -572,17 +572,15 @@ export interface TranslationResponse {
572572 * @returns Response that adheres to `TranslationResponse` type.
573573 */
574574export async function orchestrationResponseFormat ( ) : Promise < TranslationResponse > {
575- const translationSchema = z
576- . object ( {
577- language : z . string ( ) . meta ( {
578- description :
579- 'The language of the translation, randomly chosen by the LLM.'
580- } ) ,
581- translation : z
582- . string ( )
583- . meta ( { description : 'The translation of the input sentence.' } )
584- } )
585- . strict ( ) ;
575+ const translationSchema = z . strictOject ( {
576+ language : z . string ( ) . meta ( {
577+ description :
578+ 'The language of the translation, randomly chosen by the LLM.'
579+ } ) ,
580+ translation : z
581+ . string ( )
582+ . meta ( { description : 'The translation of the input sentence.' } )
583+ } ) ;
586584 const orchestrationClient = new OrchestrationClient ( {
587585 // define the language model to be used
588586 promptTemplating : {
@@ -621,12 +619,10 @@ export async function orchestrationResponseFormat(): Promise<TranslationResponse
621619 return JSON . parse ( response . getContent ( ) ! ) as TranslationResponse ;
622620}
623621
624- const addNumbersSchema = z
625- . object ( {
626- a : z . number ( ) . meta ( { description : 'The first number to be added.' } ) ,
627- b : z . number ( ) . meta ( { description : 'The second number to be added.' } )
628- } )
629- . strict ( ) ;
622+ const addNumbersSchema = z . strictObject ( {
623+ a : z . number ( ) . meta ( { description : 'The first number to be added.' } ) ,
624+ b : z . number ( ) . meta ( { description : 'The second number to be added.' } )
625+ } ) ;
630626
631627const addNumbersTool : ChatCompletionTool = {
632628 type : 'function' ,
0 commit comments