This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gemini generated object to original schema compatible object converter | |
* | |
* Utility to convert Gemini generated objects back to their original schema format. | |
* Pairs with gemini.schema-converter.ts | |
*/ | |
import { z } from "zod"; | |
function findDiscriminatorKey(schema: z.ZodTypeAny): string | null { | |
if (schema instanceof z.ZodUnion) { |