generative-ai-python icon indicating copy to clipboard operation
generative-ai-python copied to clipboard

Keep required fields spec in the structured-output schema

Open ravwojdyla opened this issue 1 year ago • 2 comments

  • re https://github.com/google-gemini/generative-ai-python/issues/642

Please see the context in https://github.com/google-gemini/generative-ai-python/issues/642. I don't think this blanket change is acceptable, but IMHO neither is the current blanket removal of required field. I'm looking forward to directions how to properly support required fields in the structured-output, given the current state of the Gemini services.

I'm happy to make any required changes to this PR.

ravwojdyla avatar Nov 29 '24 07:11 ravwojdyla

I will note that in my specific case, for a nested Pydantic schema, the Gemini API worked fine with this patch. So I wonder if the change from https://github.com/google-gemini/generative-ai-python/pull/309 is still required and if yes in what cases?

ravwojdyla avatar Nov 29 '24 07:11 ravwojdyla

Please see the context in #642. I don't think this blanket change is acceptable, but IMHO neither is the current blanket removal of required field. I'm looking forward to directions how to properly support required fields in the structured-output, given the current state of the Gemini services.

I'm happy to make any required changes to this PR.

No

Aungyehtut8 avatar Nov 29 '24 09:11 Aungyehtut8