Skip to content

Commit

Permalink
Add RetrieverRequest to tools-common (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDoyle authored Aug 29, 2024
1 parent cc18c45 commit b042428
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion genkit-tools/common/src/types/retrievers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -26,6 +26,12 @@ export const DocumentDataSchema = z.object({
});
export type DocumentData = z.infer<typeof DocumentDataSchema>;

const RetrieverRequestSchema = z.object({
query: DocumentDataSchema,
options: z.any().optional(),
});
export type RetrieverRequest = z.infer<typeof RetrieverRequestSchema>;

const RetrieverResponseSchema = z.object({
documents: z.array(DocumentDataSchema),
});
Expand Down

0 comments on commit b042428

Please sign in to comment.