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

Gemini 2.0 Thinking #78

Open
appatalks opened this issue Jan 22, 2025 · 1 comment
Open

Gemini 2.0 Thinking #78

appatalks opened this issue Jan 22, 2025 · 1 comment

Comments

@appatalks
Copy link
Owner

By default, the Gemini API doesn't return thoughts in the response. To include thoughts in the response, you must set the include_thoughts field to true, as shown in the examples.

Something changed, so it looks like I need to add include_thoughts somewhere in the payload for Gemini 2.0 Thinking

@appatalks
Copy link
Owner Author

A couple of examples I might be able to utilize:

                elif MODEL_NAME == "gemini-2.0-flash-thinking-exp":
                    config = {'thinking_config': {'include_thoughts': True}}
                    response = client.models.generate_content(
                        model='gemini-2.0-flash-thinking-exp',
                        contents=prompt,
                        config=config
                    )
                else:
                    response = model.generate_content(prompt)
def _ThinkingConfig_to_vertex(
    api_client: ApiClient,
    from_object: Union[dict, object],
    parent_object: dict = None,
) -> dict:
  to_object = {}
  if getv(from_object, ['include_thoughts']) is not None:
    setv(
        to_object, ['includeThoughts'], getv(from_object, ['include_thoughts'])
    )

  return to_object

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

1 participant