Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions genkit-tools/common/src/types/parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ const ToolResponseSchemaBase = z.object({
/**
* Tool response part.
*/
export type ToolResponsePart = z.infer<typeof ToolResponseSchemaBase> & {
export type ToolResponse = z.infer<typeof ToolResponseSchemaBase> & {
content?: Part[];
};

export const ToolResponseSchema: z.ZodType<ToolResponsePart> =
export const ToolResponseSchema: z.ZodType<ToolResponse> =
ToolResponseSchemaBase.extend({
content: z.array(z.any()).optional(),
// TODO: switch to this once we have effective recursive schema support across the board.
Expand All @@ -134,6 +134,8 @@ export const ToolResponsePartSchema = EmptyPartSchema.extend({
toolResponse: ToolResponseSchema,
});

export type ToolResponsePart = z.infer<typeof ToolResponsePartSchema>;

/**
* Zod schema of a data part.
*/
Expand Down
Loading