diff --git a/genkit-tools/common/src/types/parts.ts b/genkit-tools/common/src/types/parts.ts index b2acf20f02..eef420cc7b 100644 --- a/genkit-tools/common/src/types/parts.ts +++ b/genkit-tools/common/src/types/parts.ts @@ -115,11 +115,11 @@ const ToolResponseSchemaBase = z.object({ /** * Tool response part. */ -export type ToolResponsePart = z.infer & { +export type ToolResponse = z.infer & { content?: Part[]; }; -export const ToolResponseSchema: z.ZodType = +export const ToolResponseSchema: z.ZodType = ToolResponseSchemaBase.extend({ content: z.array(z.any()).optional(), // TODO: switch to this once we have effective recursive schema support across the board. @@ -134,6 +134,8 @@ export const ToolResponsePartSchema = EmptyPartSchema.extend({ toolResponse: ToolResponseSchema, }); +export type ToolResponsePart = z.infer; + /** * Zod schema of a data part. */