fix: make recipe crawling work
This commit is contained in:
@@ -18,8 +18,9 @@ export const IngredientGroupSchema = z.object({
|
||||
export type IngredientGroup = z.infer<typeof IngredientGroupSchema>;
|
||||
|
||||
const recipeSchema = z.object({
|
||||
_type: z.literal("Recipe"),
|
||||
name: z.string().describe(
|
||||
"Title of the Recipe, without the name of the website or author",
|
||||
"Name of the Recipe, without the name of the website or author",
|
||||
),
|
||||
description: z.string().describe(
|
||||
"Optional, short description of the recipe",
|
||||
@@ -41,11 +42,7 @@ const recipeSchema = z.object({
|
||||
|
||||
export type Recipe = z.infer<typeof recipeSchema>;
|
||||
|
||||
const noRecipeSchema = z.object({
|
||||
errorMessages: z.array(z.string()).describe(
|
||||
"List of error messages, if no recipe was found",
|
||||
),
|
||||
});
|
||||
const noRecipeSchema = z.literal("none").describe("No Recipe found");
|
||||
|
||||
export const recipeResponseSchema = z.union([recipeSchema, noRecipeSchema]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user