Skip to content

fix: handle case where google model lacks description #331

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

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

DinoChiesa
Copy link
Contributor

@DinoChiesa DinoChiesa commented Mar 24, 2025

This fixes #325 .

The chatgpt-shell-google--fetch-model-versions fn loads model descriptions from Google via a GET to https://generativelanguage.googleapis.com/v1beta/models

The response is a set of records like the following.

    {
      "name": "models/gemini-2.0-flash-exp",
      "version": "2.0",
      "displayName": "Gemini 2.0 Flash Experimental",
      "description": "Gemini 2.0 Flash Experimental",
      "inputTokenLimit": 1048576,
      "outputTokenLimit": 8192,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens",
        "bidiGenerateContent"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 40,
      "maxTemperature": 2
    },

In cases in which the model is deprecated, the description field has contained the word "deprecated". so the logic in
chatgpt-shell-google--fetch-model-versions filters out such records. In some cases, the data returned by Google does not include any description. Eg

    {
      "name": "models/gemma-3-27b-it",
      "version": "001",
      "displayName": "Gemma 3 27B",
      "inputTokenLimit": 131072,
      "outputTokenLimit": 8192,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 64
    },

This change handles that case. With this change, the current Gemma model can be loaded.

I observed a separate problem using the Gemma model. It returns

Developer instruction is not enabled for models/gemma-3-27b-it

This is a matter of API usage. See #334 .

Copy link
Owner

@xenodium xenodium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

@xenodium xenodium merged commit b47049a into xenodium:main Mar 24, 2025
@DinoChiesa DinoChiesa deleted the goog-model-lacks-descrip branch March 26, 2025 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chatgpt-shell-google-load-models is currently broken
2 participants