Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cook book - responseSchema #241

Open
LindaLawton opened this issue Jul 12, 2024 · 3 comments
Open

Cook book - responseSchema #241

LindaLawton opened this issue Jul 12, 2024 · 3 comments
Assignees
Labels
component:examples Issues/PR referencing examples folder status:awaiting response Awaiting a response from the author status:triaged Issue/PR triaged to the corresponding sub-team type:feature request New feature request/enhancement

Comments

@LindaLawton
Copy link

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

@singhniraj08 singhniraj08 added type:feature request New feature request/enhancement status:triaged Issue/PR triaged to the corresponding sub-team component:examples Issues/PR referencing examples folder labels Jul 25, 2024
@markmcd
Copy link
Member

markmcd commented Aug 16, 2024

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

@lordsoffallen
Copy link

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.

@markmcd
Copy link
Member

markmcd commented Sep 12, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:examples Issues/PR referencing examples folder status:awaiting response Awaiting a response from the author status:triaged Issue/PR triaged to the corresponding sub-team type:feature request New feature request/enhancement
Projects
None yet
Development

No branches or pull requests

4 participants