Gemini 2.0 Flash Thinking

Gemini 2.0 Flash Thinking은 모델이 응답의 일부로 거치는 '사고 과정'을 생성하도록 학습된 실험용 모델입니다. 따라서 Gemini 2.0 Flash Thinking은 기본 Gemini 2.0 Flash 모델보다 더 강력한 추론 기능을 통해 대답을 제공할 수 있습니다.

플래시 사고 사용

플래시 사고 모델은 Vertex AI에서 실험용 모델로 사용할 수 있습니다. 최신 Flash Thinking 모델을 사용하려면 모델 드롭다운 메뉴에서 gemini-2.0-flash-thinking-exp-01-21 모델을 선택합니다.

Gen AI SDK for Python

Gen AI SDK for Python를 설치하거나 업데이트하는 방법을 알아보세요.

자세한 내용은 SDK 참조 문서를 참고하세요.

Vertex AI에서 Gen AI SDK를 사용하도록 환경 변수를 설정합니다.

# 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
from google.genai.types import HttpOptions

client = genai.Client(http_options=HttpOptions(api_version="v1"))
response = client.models.generate_content(
    model="gemini-2.0-flash-thinking-exp-01-21",
    contents="solve x^2 + 4x + 4 = 0",
)
print(response.text)
# Example response:
#     To solve the equation x^2 + 4x + 4 = 0, we can use several methods.
#
#     **Method 1: Factoring**
#
#     We look for two numbers that multiply to 4 (the constant term) and add to 4 (the coefficient of the x term).
#     These two numbers are 2 and 2 because 2 * 2 = 4 and 2 + 2 = 4.
#     Therefore, we can factor the quadratic expression as:
#     (x + 2)(x + 2) = 0
#     This can also be written as:
#     (x + 2)^2 = 0
#
#     To solve for x, we set the factor (x + 2) equal to zero:
#     x + 2 = 0
#     Subtract 2 from both sides:
#     x = -2
#
#     **Method 2: Quadratic Formula**
#
#     The quadratic formula for an equation of the form ax^2 + bx + c = 0 is given by:
#     x = [-b ± sqrt(b^2 - 4ac)] / (2a)
#
#     ...
#
#
#     All three methods yield the same solution, x = -2.
#     This is a repeated root, which is expected since the discriminant (b^2 - 4ac) is 0.
#
#     To check our solution, we substitute x = -2 back into the original equation:
#     (-2)^2 + 4(-2) + 4 = 4 - 8 + 4 = 0
#     The equation holds true, so our solution is correct.

#     Final Answer: The final answer is $\boxed{-2}$

제한사항

Flash Thinking은 실험용 모델이며 다음과 같은 제한사항이 있습니다.

  • 토큰 100만 개 입력 한도
  • 텍스트, 이미지, 오디오, 동영상 입력
  • 64k 토큰 출력 한도
  • 텍스트 전용 출력
  • 검색이나 코드 실행과 같은 기본 제공 도구 사용 불가

다음 단계

Colab 노트북을 사용하여 Flash Thinking을 직접 사용해 보거나 Vertex AI 콘솔을 열고 직접 모델에 프롬프트를 제공해 보세요.