Skip to content

Improve key naming clarity and consistency across REST requests #683

Open
@ossa-ma

Description

@ossa-ma

Description of the feature request:

It is not immediately obvious that both camel casing and underscore pythonic style casing are interchangeable for the input data keys to Gemini. It would be helpful to note this somewhere as there are several examples where both styles are used in a confusing fashion often time in the same input json:

An example:
...

"generationConfig": {
            "stopSequences": [
                "Title"
            ],
            "temperature": 1.0,
            "maxOutputTokens": 800,
            "topP": 0.8,
            "topK": 10,
            "response_mime_type": "application/json",
             "response_schema": {
                "type": "ARRAY",
                "items": {
                  "type": "OBJECT",
                  "properties": {
                    "recipe_name": {"type":"STRING"},
                  }
                }
              }
}

...

References:
https://github.com/google-gemini/generative-ai-python/blob/8849d4f46010ce4ae68243c4f8a44a138b56598f/samples/rest/configure_model_parameters.sh#L20
https://github.com/google-gemini/generative-ai-python/blob/8849d4f46010ce4ae68243c4f8a44a138b56598f/samples/rest/controlled_generation.sh#L13

It also doesn't help that the general version of the API reference denotes everything in camel case so if a developer is only referring to that it would create a confusing situation:
https://ai.google.dev/api/generate-content#generationconfig

What problem are you trying to solve with this feature?

Improved clarity and consistency in Gemini API documentation, reduces potential for errors imo.

Any other information you'd like to share?

No response

Metadata

Metadata

Labels

component:otherQuestions unrelated to SDKstatus:triagedIssue/PR triaged to the corresponding sub-teamtype:feature requestNew feature request/enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions