@@ -73,7 +73,7 @@ export const resourceListParser = StructuredOutputParser.fromZodSchema(
7373 status : z . string ( ) . describe ( 'Current status' ) ,
7474 age : z . string ( ) . describe ( 'Age of the resource' ) ,
7575 additionalInfo : z
76- . record ( z . string ( ) )
76+ . record ( z . string ( ) , z . string ( ) )
7777 . optional ( )
7878 . describe ( 'Additional resource-specific information' ) ,
7979 } )
@@ -128,7 +128,9 @@ export const actionSuggestionParser = StructuredOutputParser.fromZodSchema(
128128 . array (
129129 z . object ( {
130130 toolName : z . string ( ) . describe ( 'Name of the tool to use' ) ,
131- parameters : z . record ( z . any ( ) ) . describe ( 'Parameters for the tool call' ) ,
131+ parameters : z
132+ . record ( z . string ( ) , z . any ( ) )
133+ . describe ( 'Parameters for the tool call' ) ,
132134 description : z . string ( ) . describe ( 'What this tool action accomplishes' ) ,
133135 } )
134136 )
@@ -155,7 +157,7 @@ export async function safeParseResponse<T extends z.ZodTypeAny>(
155157) : Promise < { success : boolean ; data ?: z . infer < T > ; error ?: string } > {
156158 try {
157159 const parsed = await parser . parse ( response ) ;
158- return { success : true , data : parsed } ;
160+ return { success : true , data : parsed as z . infer < T > } ;
159161 } catch ( error ) {
160162 console . error ( 'Error parsing structured response:' , error ) ;
161163 return {
0 commit comments