fix: make recipe crawling work

This commit is contained in:
Max Richter
2025-11-12 15:41:30 +01:00
parent 92126882b6
commit 7ad08daf80
19 changed files with 44 additions and 55 deletions

View File

@@ -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]);