@DjvuLee https://ai.google.dev/gemini-api/docs/json-mode?lang=python "This approach works with both Gemini 1.5 Flash and Gemini 1.5 Pro. Since the model gets the format specification from text in the prompt, you may have some flexibility in how you represent the specification. Any reasonable format for representing a JSON schema may work."
@matrix1010 我看到的是下面原文开头是这样说的。我认为的是在 model 层面可以直接指定的这种。不过可能你说的是对的,实际上 flash 可以 work 。
> In your prompt, you can ask Gemini to produce JSON-formatted output, but note that Google can't guarantee that it will produce JSON and nothing but JSON. However, if you use Gemini 1.5 Pro, you can pass a specific JSON schema in a response_schema field so that Gemini always responds with an expected structure.
> As a structured schema supplied through model configuration. This approach works with Gemini 1.5 Pro but not Gemini 1.5 Flash.