Open LindaLawton opened 4 months ago
There's an example in the JSON mode recipe. Are you looking for more advanced examples?
Examples don't work as expected. Here is an output for trying to use one:
../../../../miniconda3/envs/projx/lib/python3.10/site-packages/vertexai/generative_models/_generative_models.py:1456: in __init__
gapic_schema_dict = _convert_schema_dict_to_gapic(response_schema)
../../../../miniconda3/envs/projx/lib/python3.10/site-packages/vertexai/generative_models/_generative_models.py:1775: in _convert_schema_dict_to_gapic
if "type" in gapic_schema_dict:
E TypeError: argument of type '_TypedDictMeta' is not iterable
I used TypedDict as the cookbook uses it but it doesn't work.
../../../../miniconda3/envs/projx/lib/python3.10/site-packages/vertexai/generative_models/_generative_models.py:1456: in __init__
I see vertexai
in your stack trace. This cookbook is for the Gemini API, not Vertex. We try to keep the SDKs as similar as possible but they aren't 100% drop-in compatible.
I'm able to run the JSON mode recipe from end-to-end without failure or intervention. If you are still seeing an error with the Gemini SDK, can you point to the specific example that fails using the un-edited notebook? Or provide the (edited) code you used so we can try to help.
Or if you have compatibility concerns, the best place for that feedback is in the issue tracker for the relevant SDK(s).
Description of the feature request:
Can we get a cookbook for the usage of responseSchema
https://ai.google.dev/api/rest/v1beta/GenerationConfig
What problem are you trying to solve with this feature?
No response
Any other information you'd like to share?
No response