cookbook icon indicating copy to clipboard operation
cookbook copied to clipboard

Cook book - responseSchema

Open LindaLawton opened this issue 1 year ago • 5 comments
trafficstars

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

LindaLawton avatar Jul 12 '24 14:07 LindaLawton

There's an example in the JSON mode recipe. Are you looking for more advanced examples?

markmcd avatar Aug 16 '24 03:08 markmcd

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.

lordsoffallen avatar Sep 09 '24 13:09 lordsoffallen

../../../../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).

markmcd avatar Sep 12 '24 01:09 markmcd

Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.

github-actions[bot] avatar Dec 02 '24 08:12 github-actions[bot]

Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.

github-actions[bot] avatar Dec 18 '24 22:12 github-actions[bot]

This issue was closed because it has been inactive for 27 days. Please post a new issue if you need further assistance. Thanks!

github-actions[bot] avatar Jan 01 '25 22:01 github-actions[bot]