Gemini 2.0 Flash 사고 모델은 모델이 응답의 일부로 거치는 '사고 과정'을 생성하도록 학습된 실험용 모델입니다. 따라서 Flash Thinking 모델은 Gemini 2.0 Flash 실험 버전 모델보다 더 강력한 추론 기능을 갖추고 있습니다.
사고 모델 사용
Flash Thinking 모델은 Google AI Studio 및 Gemini API를 통해 사용할 수 있습니다.
Gemini API는 응답에 생각을 반환하지 않습니다.
사고 모델을 사용하려면 클라이언트가 API의 v1alpha
버전을 사용하도록 설정해야 합니다.
pip install -U google-genai
from google import genai
from google.genai import types
client = genai.Client(
api_key=GOOGLE_API_KEY,
http_options={'api_version':'v1alpha'},
)
기본 요청 보내기
Python
이 예에서는 새 Google Genai SDK를 사용합니다.
from google import genai
client = genai.Client(api_key='GEMINI_API_KEY', http_options={'api_version':'v1alpha'})
response = client.models.generate_content(
model='gemini-2.0-flash-thinking-exp',
contents='Explain how RLHF works in simple terms.',
)
print(response.text)
멀티턴 사고 대화
멀티턴 대화 중에 전체 대화 기록을 입력으로 전달하므로 모델은 멀티턴 대화에서 이전 생각에 액세스할 수 없습니다.
Python
새로운 Google Genai SDK는 대화 상태를 관리하는 데 도움이 되는 다중 대화 채팅 세션을 만드는 기능을 제공합니다.
from google import genai
client = genai.Client(api_key='GEMINI_API_KEY', http_options={'api_version':'v1alpha'})
chat = client.aio.chats.create(
model='gemini-2.0-flash-thinking-exp',
)
response = await chat.send_message('What is your name?')
print(response.text)
response = await chat.send_message('What did you just say before this?')
print(response.text)
제한사항
Flash Thinking 모델은 실험용 모델이며 다음과 같은 제한사항이 있습니다.
- 텍스트 및 이미지 입력만
- 텍스트 전용 출력
- JSON 모드 또는 검색 기반 없음
- 생각은 Google AI 스튜디오에만 표시됩니다.
다음 단계
- Google AI Studio에서 Flash Thinking 모델을 사용해 보세요.
- Flash Thinking Colab을 사용해 보세요.