From b04242823e29ff45c87023eb9a9708e56848ae9c Mon Sep 17 00:00:00 2001 From: Michael Doyle Date: Thu, 29 Aug 2024 13:01:11 -0400 Subject: [PATCH] Add RetrieverRequest to tools-common (#836) --- genkit-tools/common/src/types/retrievers.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/genkit-tools/common/src/types/retrievers.ts b/genkit-tools/common/src/types/retrievers.ts index 3f8d40bbd..ce9772940 100644 --- a/genkit-tools/common/src/types/retrievers.ts +++ b/genkit-tools/common/src/types/retrievers.ts @@ -15,7 +15,7 @@ */ // -// IMPORTANT: Keep this file in sync with genkit/ai/src/retrievers.ts! +// IMPORTANT: Keep this file in sync with js/ai/src/retriever.ts! // import { z } from 'zod'; import { PartSchema } from './model'; @@ -26,6 +26,12 @@ export const DocumentDataSchema = z.object({ }); export type DocumentData = z.infer; +const RetrieverRequestSchema = z.object({ + query: DocumentDataSchema, + options: z.any().optional(), +}); +export type RetrieverRequest = z.infer; + const RetrieverResponseSchema = z.object({ documents: z.array(DocumentDataSchema), });