Open
Description
Creating a utility that calls the Gemini LLM with a given prompt and an optional JSON schema:
-
Accepting a prompt with an output JSON schema with descriptions for each field, which will be concatenated with the prompt, ensuring the final output is easily parseable and aligned with structured data.
-
Accepting a prompt without an output JSON schema will require some work to handle and parse the output of the LLM to continue working with it.
https://ai.google.dev/gemini-api/docs/structured-output#python. It is preferred to use the structured output using JSON Schema