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

[Bug]: cannot see thoughts #1683

Open
1 task done
nlpravi opened this issue Feb 2, 2025 · 2 comments
Open
1 task done

[Bug]: cannot see thoughts #1683

nlpravi opened this issue Feb 2, 2025 · 2 comments
Assignees

Comments

@nlpravi
Copy link

nlpravi commented Feb 2, 2025

File Name

gemini/getting-started/intro_gemini_2_0_flash_thinking_mode.ipynb

What happened?

Using the following code with the thinking model. But cannot see the thought in the response.

from google import genai

# Initialize the Gemini client
client = genai.Client(api_key="YOUR_API_KEY", http_options={"api_version": "v1alpha"})

# Define the request configuration to include thoughts
config = {
    "thinking_config": {"include_thoughts": True}  # Enable thought process
}

# Send a request to the Gemini model
response = client.models.generate_content(
    model="gemini-2.0-flash-thinking-exp-01-21", 
    contents="Solve 3*x^3-5*x=1.",
    config=config
)

# Process and display the response, including thoughts
for part in response.candidates.content.parts:
    if hasattr(part, "thought") and part.thought:  # Check if 'thought' exists
        print(f"Model Thought Process:\n{part.text}\n")
    else:
        print(f"Model Final Response:\n{part.text}\n")

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct
@holtskinner
Copy link
Collaborator

Hi, this is a known issue, the thinking model has been briefly removed from the API.

@holtskinner holtskinner self-assigned this Feb 5, 2025
@holtskinner
Copy link
Collaborator

Update: The model is back in the Vertex AI API, but thoughts are disabled for the time being.

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

No branches or pull requests

2 participants