Pensando

Os modelos de pensamento são treinados para gerar o "processo de pensamento" pelo qual o modelo passa como parte da resposta. Como resultado, os modelos de pensamento têm capacidades de raciocínio mais fortes nas respostas do que os modelos de base equivalentes.

Use o pensamento

Os modelos experimentais do Gemini 2.5 Pro estão disponíveis como um modelo experimental na Vertex AI. Para usar o modelo Gemini 2.5 Pro Experimental mais recente, selecione o modelo gemini-2.5-pro-exp-03-25 no menu suspenso Modelo.

Gen AI SDK for Python

Instalar

pip install --upgrade google-genai
Para saber mais, consulte a documentação de referência do SDK.

Defina variáveis de ambiente para usar o SDK da IA generativa com a Vertex AI:

# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values
# with appropriate values for your project.
export GOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECT
export GOOGLE_CLOUD_LOCATION=us-central1
export GOOGLE_GENAI_USE_VERTEXAI=True

from google import genai

client = genai.Client()
response = client.models.generate_content(
    model="gemini-2.5-pro-exp-03-25",
    contents="solve x^2 + 4x + 4 = 0",
)
print(response.text)
# Example Response:
#     Okay, let's solve the quadratic equation x² + 4x + 4 = 0.
#
#     There are a few ways to solve this:
#
#     **Method 1: Factoring**
#
#     1.  **Look for two numbers** that multiply to the constant term (4) and add up to the coefficient of the x term (4).
#         *   The numbers are 2 and 2 (since 2 * 2 = 4 and 2 + 2 = 4).
#     2.  **Factor the quadratic** using these numbers:
#         (x + 2)(x + 2) = 0
#         This can also be written as:
#         (x + 2)² = 0
#     3.  **Set the factor equal to zero** and solve for x:
#         x + 2 = 0
#         x = -2
#
#     This type of solution, where the factor is repeated, is called a repeated root or a root with multiplicity 2.
#
#     **Method 2: Using the Quadratic Formula**
#
#     The quadratic formula solves for x in any equation of the form ax² + bx + c = 0:
#     x = [-b ± √(b² - 4ac)] / 2a
#
#     1.  **Identify a, b, and c** in the equation x² + 4x + 4 = 0:
#         *   a = 1
#         *   b = 4
#         *   c = 4
#     2.  **Substitute these values into the formula:**
#         x = [-4 ± √(4² - 4 * 1 * 4)] / (2 * 1)
#     3.  **Simplify:**
#         x = [-4 ± √(16 - 16)] / 2
#         x = [-4 ± √0] / 2
#         x = [-4 ± 0] / 2
#     4.  **Calculate the result:**
#         x = -4 / 2
#         x = -2
#
#     Both methods give the same solution.
#
#     **Answer:**
#     The solution to the equation x² + 4x + 4 = 0 is **x = -2**.

Limitações

O Gemini 2.5 Pro Experimental é um modelo experimental e tem as seguintes limitações:

  • Limite de entrada de 1 milhão de tokens
  • Entrada de texto, imagem, áudio e vídeo
  • Limite de saída de 64 mil tokens
  • Saída somente de texto

A seguir

Teste o Gemini 2.5 Pro Experimental com nosso notebook Colab, ou abra o console Vertex AI e tente solicitar o modelo.