생각 중

사고 모델은 모델이 응답의 일부로서 거치는 '사고 과정'을 생성하도록 학습됩니다. 따라서 사고 모델은 동급의 기본 모델보다 응답에서 더 강력한 추론 기능을 사용할 수 있습니다.

사고 과정은 기본적으로 사용 설정되어 있습니다. Vertex AI Studio를 사용하면 모델의 생성된 대답과 함께 전체 사고 과정을 확인할 수 있습니다.

지원되는 모델

사고는 다음 모델에서 지원됩니다.

사고 모델 사용

지원되는 모델에서 사고를 사용하려면 다음 단계를 따르세요.

콘솔

  1. Vertex AI Studio > 프롬프트 만들기를 엽니다.
  2. 모델 패널에서 모델 전환을 클릭하고 메뉴에서 지원되는 모델 중 하나를 선택합니다.
    • (Gemini 2.5 Flash만 해당) 사고 예산은 모델이 로드될 때 기본적으로 자동으로 설정됩니다.
  3. (선택사항) 시스템 안내 필드에서 모델이 응답을 포맷하는 방법에 관한 자세한 안내를 제공합니다.
  4. 프롬프트 작성 필드에 프롬프트를 입력합니다.
  5. 실행을 클릭합니다.

Gemini는 대답이 생성된 후 대답을 반환합니다. 대답의 복잡성에 따라 생성에 몇 초가 걸릴 수 있습니다.

(Gemini 2.5 Flash만 해당) 사고를 사용 중지하려면 사고 예산사용 안함으로 설정합니다.

Python

설치

pip install --upgrade google-genai

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

Vertex AI에서 생성형 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=global
export GOOGLE_GENAI_USE_VERTEXAI=True

from google import genai

client = genai.Client()
response = client.models.generate_content(
    model="gemini-2.5-pro",
    contents="solve x^2 + 4x + 4 = 0",
)
print(response.text)
# Example Response:
#     Okay, let's solve the quadratic equation x² + 4x + 4 = 0.
#
#     We can solve this equation by factoring, using the quadratic formula, or by recognizing it as a perfect square trinomial.
#
#     **Method 1: Factoring**
#
#     1.  We need two numbers that multiply to the constant term (4) and add up to the coefficient of the x term (4).
#     2.  The numbers 2 and 2 satisfy these conditions: 2 * 2 = 4 and 2 + 2 = 4.
#     3.  So, we can factor the quadratic as:
#         (x + 2)(x + 2) = 0
#         or
#         (x + 2)² = 0
#     4.  For the product to be zero, the factor must be zero:
#         x + 2 = 0
#     5.  Solve for x:
#         x = -2
#
#     **Method 2: Quadratic Formula**
#
#     The quadratic formula for an equation ax² + bx + c = 0 is:
#     x = [-b ± sqrt(b² - 4ac)] / (2a)
#
#     1.  In our equation x² + 4x + 4 = 0, we have a=1, b=4, and c=4.
#     2.  Substitute these values into the formula:
#         x = [-4 ± sqrt(4² - 4 * 1 * 4)] / (2 * 1)
#         x = [-4 ± sqrt(16 - 16)] / 2
#         x = [-4 ± sqrt(0)] / 2
#         x = [-4 ± 0] / 2
#         x = -4 / 2
#         x = -2
#
#     **Method 3: Perfect Square Trinomial**
#
#     1.  Notice that the expression x² + 4x + 4 fits the pattern of a perfect square trinomial: a² + 2ab + b², where a=x and b=2.
#     2.  We can rewrite the equation as:
#         (x + 2)² = 0
#     3.  Take the square root of both sides:
#         x + 2 = 0
#     4.  Solve for x:
#         x = -2
#
#     All methods lead to the same solution.
#
#     **Answer:**
#     The solution to the equation x² + 4x + 4 = 0 is x = -2. This is a repeated root (or a root with multiplicity 2).

Go

Go를 설치하거나 업데이트하는 방법을 알아보세요.

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

Vertex AI에서 생성형 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=global
export GOOGLE_GENAI_USE_VERTEXAI=True

import (
	"context"
	"fmt"
	"io"

	"google.golang.org/genai"
)

// generateThinkingWithText shows how to generate thinking using a text prompt.
func generateThinkingWithText(w io.Writer) error {
	ctx := context.Background()

	client, err := genai.NewClient(ctx, &genai.ClientConfig{
		HTTPOptions: genai.HTTPOptions{APIVersion: "v1"},
	})
	if err != nil {
		return fmt.Errorf("failed to create genai client: %w", err)
	}

	resp, err := client.Models.GenerateContent(ctx,
		"gemini-2.5-flash",
		genai.Text("solve x^2 + 4x + 4 = 0"),
		nil,
	)
	if err != nil {
		return fmt.Errorf("failed to generate content: %w", err)
	}

	respText := resp.Text()

	fmt.Fprintln(w, respText)
	// Example response:
	// To solve the quadratic equation $x^2 + 4x + 4 = 0$, we can use a few methods:
	//
	// **Method 1: Factoring (Recognizing a Perfect Square Trinomial)**
	// **1. The Foundation: Data and Algorithms**
	//
	// Notice that the left side of the equation is a perfect square trinomial.
	// ...

	return nil
}

사고 요약 보기

사고 요약은 모델이 대답을 생성할 때 거친 사고 과정의 축약된 출력입니다. Gemini 2.5 Flash와 Gemini 2.5 Pro 모두에서 사고 요약을 볼 수 있습니다. 사고 요약을 보려면 다음 단계를 따르세요.

콘솔

사고 요약은 Vertex AI Studio에서 기본적으로 사용 설정되어 있습니다. 사고 패널을 펼쳐 모델의 요약된 사고 과정을 확인할 수 있습니다.

Python

설치

pip install --upgrade google-genai

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

Vertex AI에서 생성형 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=global
export GOOGLE_GENAI_USE_VERTEXAI=True

from google import genai
from google.genai.types import GenerateContentConfig, ThinkingConfig

client = genai.Client()
response = client.models.generate_content(
    model="gemini-2.5-pro",
    contents="solve x^2 + 4x + 4 = 0",
    config=GenerateContentConfig(
        thinking_config=ThinkingConfig(include_thoughts=True)
    ),
)

print(response.text)
# Example Response:
#     Okay, let's solve the quadratic equation x² + 4x + 4 = 0.
#     ...
#     **Answer:**
#     The solution to the equation x² + 4x + 4 = 0 is x = -2. This is a repeated root (or a root with multiplicity 2).

for part in response.candidates[0].content.parts:
    if part and part.thought:  # show thoughts
        print(part.text)
# Example Response:
#     **My Thought Process for Solving the Quadratic Equation**
#
#     Alright, let's break down this quadratic, x² + 4x + 4 = 0. First things first:
#     it's a quadratic; the x² term gives it away, and we know the general form is
#     ax² + bx + c = 0.
#
#     So, let's identify the coefficients: a = 1, b = 4, and c = 4. Now, what's the
#     most efficient path to the solution? My gut tells me to try factoring; it's
#     often the fastest route if it works. If that fails, I'll default to the quadratic
#     formula, which is foolproof. Completing the square? It's good for deriving the
#     formula or when factoring is difficult, but not usually my first choice for
#     direct solving, but it can't hurt to keep it as an option.
#
#     Factoring, then. I need to find two numbers that multiply to 'c' (4) and add
#     up to 'b' (4). Let's see... 1 and 4 don't work (add up to 5). 2 and 2? Bingo!
#     They multiply to 4 and add up to 4. This means I can rewrite the equation as
#     (x + 2)(x + 2) = 0, or more concisely, (x + 2)² = 0. Solving for x is now
#     trivial: x + 2 = 0, thus x = -2.
#
#     Okay, just to be absolutely certain, I'll run the quadratic formula just to
#     double-check. x = [-b ± √(b² - 4ac)] / 2a. Plugging in the values, x = [-4 ±
#     √(4² - 4 * 1 * 4)] / (2 * 1). That simplifies to x = [-4 ± √0] / 2. So, x =
#     -2 again – a repeated root. Nice.
#
#     Now, let's check via completing the square. Starting from the same equation,
#     (x² + 4x) = -4. Take half of the b-value (4/2 = 2), square it (2² = 4), and
#     add it to both sides, so x² + 4x + 4 = -4 + 4. Which simplifies into (x + 2)²
#     = 0. The square root on both sides gives us x + 2 = 0, therefore x = -2, as
#      expected.
#
#     Always, *always* confirm! Let's substitute x = -2 back into the original
#     equation: (-2)² + 4(-2) + 4 = 0. That's 4 - 8 + 4 = 0. It checks out.
#
#     Conclusion: the solution is x = -2. Confirmed.

Node.js

설치

npm install @google/genai

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

Vertex AI에서 생성형 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=global
export GOOGLE_GENAI_USE_VERTEXAI=True

const {GoogleGenAI} = require('@google/genai');

const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';

async function generateWithThoughts(
  projectId = GOOGLE_CLOUD_PROJECT,
  location = GOOGLE_CLOUD_LOCATION
) {
  const client = new GoogleGenAI({
    vertexai: true,
    project: projectId,
    location: location,
  });

  const response = await client.models.generateContent({
    model: 'gemini-2.5-pro',
    contents: 'solve x^2 + 4x + 4 = 0',
    config: {
      thinkingConfig: {
        includeThoughts: true,
      },
    },
  });

  console.log(response.text);
  // Example Response:
  //  Okay, let's solve the quadratic equation x² + 4x + 4 = 0.
  //  ...
  //  **Answer:**
  //  The solution to the equation x² + 4x + 4 = 0 is x = -2. This is a repeated root (or a root with multiplicity 2).

  for (const part of response.candidates[0].content.parts) {
    if (part && part.thought) {
      console.log(part.text);
    }
  }

  // Example Response:
  // **My Thought Process for Solving the Quadratic Equation**
  //
  // Alright, let's break down this quadratic, x² + 4x + 4 = 0. First things first:
  // it's a quadratic; the x² term gives it away, and we know the general form is
  // ax² + bx + c = 0.
  //
  // So, let's identify the coefficients: a = 1, b = 4, and c = 4. Now, what's the
  // most efficient path to the solution? My gut tells me to try factoring; it's
  // often the fastest route if it works. If that fails, I'll default to the quadratic
  // formula, which is foolproof. Completing the square? It's good for deriving the
  // formula or when factoring is difficult, but not usually my first choice for
  // direct solving, but it can't hurt to keep it as an option.
  //
  // Factoring, then. I need to find two numbers that multiply to 'c' (4) and add
  // up to 'b' (4). Let's see... 1 and 4 don't work (add up to 5). 2 and 2? Bingo!
  // They multiply to 4 and add up to 4. This means I can rewrite the equation as
  // (x + 2)(x + 2) = 0, or more concisely, (x + 2)² = 0. Solving for x is now
  // trivial: x + 2 = 0, thus x = -2.
  //
  // Okay, just to be absolutely certain, I'll run the quadratic formula just to
  // double-check. x = [-b ± √(b² - 4ac)] / 2a. Plugging in the values, x = [-4 ±
  // √(4² - 4 * 1 * 4)] / (2 * 1). That simplifies to x = [-4 ± √0] / 2. So, x =
  // -2 again – a repeated root. Nice.
  //
  // Now, let's check via completing the square. Starting from the same equation,
  // (x² + 4x) = -4. Take half of the b-value (4/2 = 2), square it (2² = 4), and
  // add it to both sides, so x² + 4x + 4 = -4 + 4. Which simplifies into (x + 2)²
  // = 0. The square root on both sides gives us x + 2 = 0, therefore x = -2, as
  //  expected.
  //
  // Always, *always* confirm! Let's substitute x = -2 back into the original
  // equation: (-2)² + 4(-2) + 4 = 0. That's 4 - 8 + 4 = 0. It checks out.
  //
  // Conclusion: the solution is x = -2. Confirmed.

  return response.text;
}

생각 서명 수신

사고 서명은 모델의 내부 사고 과정을 암호화한 표현입니다. 사고를 사용하고 함수 호출이 사용 설정된 경우 모델은 응답 객체에 사고 서명을 반환합니다. 모델이 대화의 여러 턴에서 컨텍스트를 유지하도록 하려면 후속 요청에서 사고 서명을 반환해야 합니다.

다음과 같은 경우 생각 서명이 표시됩니다.

  • 사고가 사용 설정되어 있고 생각이 생성됩니다.
  • 요청에 함수 선언이 포함되어 있습니다.

다음은 함수 선언 호출과 함께 사고하는 방법을 보여주는 예입니다.

Python

# Create user friendly response with function result and call the model again
# ...Create a function response part (No change)

# Append thought signatures, function call and result of the function execution to contents
function_call_content = response.candidates[0].content
# Append the model's function call message, which includes thought signatures
contents.append(function_call_content)
contents.append(types.Content(role="user", parts=[function_response_part])) # Append the function response

final_response = client.models.generate_content(
    model="gemini-2.5-flash",
    config=config,
    contents=contents,
)

print(final_response.text)
      

자세한 내용은 함수 호출 페이지를 참고하세요.

함수 호출과 관련해 고려해야 할 기타 사용 제한사항은 다음과 같습니다.

  • 서명은 함수 호출, 텍스트, 텍스트 또는 생각 요약 부분과 같은 응답의 다른 부분 내에서 모델로부터 반환됩니다. 후속 턴에서 모든 파트가 포함된 전체 응답을 모델에 다시 반환합니다.
  • 서명은 함께 연결할 수 없습니다.
  • 서명은 일련의 부분으로 전송됩니다. 이러한 부분은 동일한 순서로 반환해야 합니다.

사고 예산 제어

모델이 응답하는 동안 얼마나 사고할지 제어할 수 있습니다. 이 상한을 사고 예산이라고 하며 모델의 전체 사고 과정에 적용됩니다. 기본적으로 모델은 최대 8,192개의 토큰까지 사고하는 정도를 자동으로 제어합니다.

기본 사고 예산보다 토큰이 더 많거나 적게 필요할 수 있는 상황에서는 토큰 수의 상한을 수동으로 설정할 수 있습니다. 복잡성이 낮은 작업에는 토큰 한도를 낮게, 복잡성이 높은 작업에는 토큰 한도를 높게 설정할 수 있습니다.

다음 표에는 지원되는 각 모델에 대해 설정할 수 있는 토큰 예산의 최소 금액과 최대 금액이 나와 있습니다.

모델 최소 토큰 금액 최대 토큰 금액
Gemini 2.5 Flash 1 24,576
Gemini 2.5 Pro 128 32,768
Gemini 2.5 Flash-Lite 512 24,576

Gemini 2.5 Flash 및 Gemini 2.5 Flash-Lite를 사용할 때 사고 예산을 0로 설정하면 사고가 사용 중지됩니다. Gemini 2.5 Pro에서는 사고를 사용 중지할 수 없습니다.

API를 사용할 때 모델이 사고 예산을 제어하도록 하려면 사고 예산을 -1로 설정하세요.

콘솔

  1. Vertex AI Studio > 프롬프트 만들기를 엽니다.
  2. 모델 패널에서 모델 전환을 클릭하고 메뉴에서 지원되는 모델 중 하나를 선택합니다.
  3. 사고 예산 드롭다운 선택기에서 수동을 선택한 다음 슬라이더를 사용하여 사고 예산 한도를 조정합니다.

Python

설치

pip install --upgrade google-genai

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

Vertex AI에서 생성형 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=global
export GOOGLE_GENAI_USE_VERTEXAI=True

from google import genai
from google.genai.types import GenerateContentConfig, ThinkingConfig

client = genai.Client()

response = client.models.generate_content(
    model="gemini-2.5-flash",
    contents="solve x^2 + 4x + 4 = 0",
    config=GenerateContentConfig(
        thinking_config=ThinkingConfig(
            thinking_budget=1024,  # Use `0` to turn off thinking
        )
    ),
)

print(response.text)
# Example response:
#     To solve the equation $x^2 + 4x + 4 = 0$, you can use several methods:
#     **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).
#     2.  The numbers are 2 and 2 ($2 \times 2 = 4$ and $2 + 2 = 4$).
#     ...
#     ...
#     All three methods yield the same solution. This quadratic equation has exactly one distinct solution (a repeated root).
#     The solution is **x = -2**.

# Token count for `Thinking`
print(response.usage_metadata.thoughts_token_count)
# Example response:
#     886

# Total token count
print(response.usage_metadata.total_token_count)
# Example response:
#     1525

Node.js

설치

npm install @google/genai

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

Vertex AI에서 생성형 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=global
export GOOGLE_GENAI_USE_VERTEXAI=True

const {GoogleGenAI} = require('@google/genai');

const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';

async function generateWithThoughts(
  projectId = GOOGLE_CLOUD_PROJECT,
  location = GOOGLE_CLOUD_LOCATION
) {
  const client = new GoogleGenAI({
    vertexai: true,
    project: projectId,
    location: location,
  });

  const response = await client.models.generateContent({
    model: 'gemini-2.5-flash',
    contents: 'solve x^2 + 4x + 4 = 0',
    config: {
      thinkingConfig: {
        thinkingBudget: 1024,
      },
    },
  });

  console.log(response.text);
  // Example response:
  //  To solve the equation $x^2 + 4x + 4 = 0$, you can use several methods:
  //  **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).
  //  2.  The numbers are 2 and 2 ($2 \times 2 = 4$ and $2 + 2 = 4$).
  //  ...
  //  ...
  //  All three methods yield the same solution. This quadratic equation has exactly one distinct solution (a repeated root).
  //  The solution is **x = -2**.

  // Token count for `Thinking`
  console.log(response.usageMetadata.thoughtsTokenCount);
  // Example response:
  //  886

  // Total token count
  console.log(response.usageMetadata.totalTokenCount);
  // Example response:
  //  1525
  return response.text;
}

프롬프트 작성 기법

효과적인 프롬프트는 Gemini 사고 모델의 이점을 극대화하는 데 매우 중요합니다. 이 섹션에서는 사고 모델을 위한 프롬프트 작성 관행을 간략하게 설명합니다.

원하는 결과를 설명하는 일반적인 안내로 시작합니다. 간단한 프롬프트로 시작하여 대답 방법에 관한 모델의 초기 생각을 관찰합니다.

Describe the most unusual or striking architectural feature you've ever seen in a building or structure.
  
<...>
The most unusual architectural feature that has truly stayed with me is the "floating roof" of the
  Heydar Aliyev Center in Baku, Azerbaijan, designed by Zaha Hadid Architects.

Visually, it's breathtaking. Imagine a vast, undulating landscape of pure white, seemingly draped
over the building. It's not just a roof in the traditional sense; it's an extension of the ground,
flowing seamlessly upwards and over the building's various spaces before curving back down to meet
the earth again. There are no sharp angles, no rigid lines. Instead, everything is fluid, organic,
and continuous. It resembles a giant, pristine white wave frozen in motion, or perhaps a sand dune
sculpted by an unseen wind.
<...>
  

단계별 안내 제공하기

첫 번째 시도에서 원하는 결과를 얻지 못한 경우 더 구체적인 단계별 안내를 제공하여 Gemini가 문제 해결 과정을 통해 더 집중적으로 접근할 수 있도록 프롬프트를 미세 조정합니다. 이를 통해 명시적인 제안과 안내를 사용하여 작업에 대한 모델의 초기 이해를 유도할 수 있습니다.

Now imagine that architectural feature is not just for looks, but has a specific function or
purpose related to the building's environment or the people who use it. Explain what that
function could be and how it enhances the building's overall design and usability.
  
<...>
Let's imagine that the "floating roof" of the Heydar Aliyev Center is not purely aesthetic but
serves a crucial environmental and user-centric function: it's designed as a sophisticated climate
moderator and natural ventilation system for the Baku environment.

Here's how this function would work and enhance the building:

Function: Passive Climate Control and Natural Ventilation System

Shading and Solar Heat Mitigation: The undulating curves of the white GFRC roof are strategically
shaped and oriented to provide optimal shading throughout the day, year-round. Baku experiences
intense sun, especially during the summer. The overhanging curves, acting like giant brise-soleils,
would block direct sunlight from hitting the building's glass facade, significantly reducing solar
heat gain. The varying heights and depths of the curves would create dynamic shade patterns, ensuring
that different parts of the building are shaded at different times of the day, optimizing comfort
and reducing the need for excessive air conditioning. The white color of the GFRC further enhances
this by reflecting a large portion of the solar radiation.
<...>
  

사고를 포함한 멀티샷 프롬프트

사고와 함께 멀티샷 프롬프트를 사용하면 Gemini의 이해도를 높이고 대답의 정확도를 개선할 수 있습니다. 프롬프트에 원하는 동작과 출력 형식을 보여주는 입력-출력 쌍의 예를 여러 개 제공하세요.

Example 1:
User: What is the tallest mountain in the world?
Assistant: Mount Everest

Example 2:
User: What is the largest ocean?
Assistant: Pacific Ocean

User: What is the longest river in the world?
Assistant:
  
Amazon River
  

출력 및 동작 정의

사용자가 모델과 직접 상호작용하는 애플리케이션을 빌드할 때 Gemini의 출력과 대답의 어조와 형식을 지정하는 방법을 안내할 수 있습니다.

시스템 안내

시스템 안내는 모델에서 프롬프트를 처리하기 전에 처리하는 안내 모음입니다. 이러한 지침은 모델이 프롬프트될 때마다 호출되며 모델의 동작 방식과 응답 방식을 지정합니다. 예를 들어 역할 또는 페르소나, 컨텍스트 정보, 형식 지정 안내 등을 포함할 수 있습니다.

System Instruction: You are a helpful and concise coding tutor. Always provide code examples and explain them briefly.

User Prompt: Explain what is a closure in Javascript and give an example.
  
    function outerFunction(outerVar) {
      function innerFunction(innerVar) {
        console.log(outerVar); // Accessing outerVar from outerFunction's scope
        console.log(innerVar);
      }
      return innerFunction;
    }

    const closureExample = outerFunction('I am from outer');
    closureExample('I am from inner');

Explanation:

A closure is created when a function (innerFunction in this example) is defined inside another function
(outerFunction) and the inner function remembers and has access to the variables from the outer
function's scope, even after the outer function has finished executing.

In the example:

outerFunction is called with 'I am from outer' and returns innerFunction.

closureExample now holds a reference to innerFunction.

When closureExample('I am from inner') is called, innerFunction executes.

Even though outerFunction has already finished, innerFunction can still access and use outerVar
(which is 'I am from outer') because of the closure.

In essence, the innerFunction "closes over" the variables of its outer function's scope, creating
a closure.
  

확인 및 성찰

시스템 안내 또는 프롬프트에 직접 구체적인 확인 단계를 포함합니다. 예를 들어 Gemini에게 소스를 확인하고, 추론을 검토하고, 잠재적인 오류를 식별하고, 최종 대답을 확인해 달라고 요청할 수 있습니다.

    Verify the following statement and provide your sources: The capital of Brazil is Rio de Janeiro.
  
The statement "The capital of Brazil is Rio de Janeiro" is incorrect.

The current capital of Brazil is Brasília.

Rio de Janeiro was the capital of Brazil for a significant period, from 1763 to 1960. However, the
capital was moved to Brasília in 1960 as part of a plan to develop the country's interior and create
a more centrally located capital.

Verification and Sources:

You can easily verify this information from numerous reliable sources:

Encyclopedias:

Britannica: Searching for "Brazil" on Britannica will clearly state Brasília as the capital.

https://www.britannica.com/place/Brazil (Look for the "Capital" information in the introductory summary or "Geography" section)

Wikipedia: The Wikipedia article for "Brazil" also states Brasília as the capital.

https://en.wikipedia.org/wiki/Brazil (Look in the infobox or introductory section)

Government and Official Sources:

CIA World Factbook: This is a highly reliable source for country information. Searching for "Brazil"
will list Brasília as the capital.

https://www.cia.gov/the-world-factbook/countries/brazil/ (Look under "Government" > "Capital")

Official Website of the Brazilian Government (if accessible and in English): While navigating official
government websites can sometimes be complex, they would definitively list Brasília as the capital.

Geographic Resources:

National Geographic: Their website and publications will confirm Brasília as the capital of Brazil.

Atlases and Geography Textbooks: Any modern atlas or geography textbook will list Brasília as the capital.

Why the confusion?

The confusion might arise because:

Rio de Janeiro is a very famous Brazilian city: It's a major tourist destination, known for its
beaches, Carnival, and iconic landmarks like Christ the Redeemer. Its past status as capital adds
to its historical significance and public recognition.

Historical context: Rio de Janeiro was the capital for a long time. People who learned about Brazil
in the past might remember it as the capital.

In conclusion, the statement is false. The capital of Brazil is Brasília, not Rio de Janeiro. Rio
de Janeiro was the former capital but is no longer the current capital.

You can confidently use the sources listed above to verify this information.
  

디버깅 및 조향

Vertex AI Studio는 개발자에게 UI에서 모델의 생각을 확인할 수 있는 액세스 권한을 제공합니다. 디버깅 시 프롬프트를 검토하는 개발자에게는 다음이 유용합니다.

사고 과정 분석

Gemini의 사고 과정을 주의 깊게 검토하여 잘못된 부분이 있는지 확인합니다. 이 분석은 프롬프트를 개선하고 애플리케이션에서 일관되게 원하는 응답을 얻는 데 유용한 단서를 제공할 수 있습니다.

예시 시나리오: Gemini의 사고 과정에서 복잡한 안내의 한 단계를 잘못 이해한 것으로 나타나면 프롬프트를 수정하여 해당 단계를 명확하게 설명할 수 있습니다.

Step 1: Summarize the following article about quantum physics.
Step 2: Translate the summary into Spanish.
Step 3: Extract the key entities from the Spanish summary.

Article: ... [Article Text] ...
The user wants me to process an article about Google's new quantum chip called Willow in three steps:
Step 1: Summarize the article.
Step 2: Translate the summary into Spanish.
Step 3: Extract the key entities from the Spanish summary.

Let's break down each step.

Step 1: Summarize the article.
I need to read the article and identify the main points. The article is about Google's new quantum
chip, Willow, and its achievements. The key achievements are:

Exponential error reduction as qubits scale up.

Outperforming supercomputers in a benchmark computation (RCS).

Willow is a step towards commercially relevant quantum computing.

It's the first system below threshold for quantum error correction.

It achieved a benchmark computation in under 5 minutes that would take a supercomputer 10 septillion years.

It was fabricated in a new facility.

It has state-of-the-art performance and high quality qubits.

Google is looking towards real-world applications with Willow.

Quantum computing will benefit AI.

I will synthesize these points into a concise summary.

Step 2: Translate the summary into Spanish.
Once I have the summary in English, I will translate it into Spanish. I need to ensure the translation
is accurate and natural-sounding in Spanish.

Step 3: Extract the key entities from the Spanish summary.
After translating the summary, I will identify and extract the key entities. Key entities are typically
nouns or noun phrases that represent important objects, concepts, or actors. In this context, they
will likely include:

Names of chips (Willow, Sycamore)

Companies/Organizations (Google Quantum AI, Google Research)

Technologies (quantum chip, quantum computer, qubits, quantum error correction, superconducting
quantum system, classical computers, supercomputers, AI)

Benchmarks (random circuit sampling, RCS)

People (Julian Kelly, Peter Shor, David Deutsch, Sergio Boixo, Hartmut Neven, John Preskill)

Concepts (exponential error reduction, below threshold, beyond breakeven, state-of-the-art performance,
commercially relevant applications, quantum mechanics, multiverse, T1 times, system benchmarks,
algorithmic benchmarks)

I will need to carefully review the Spanish summary to identify these entities and list them out.

Provide corrective feedback

If you observe errors or inconsistencies in Gemini's reasoning, provide corrective feedback in your prompt and the system instructions to anticipate where the model's response may deviate from your desired outcome.

You are an expert in botany. When asked to identify a plant, focus on leaf shape, flower structure, and stem characteristics.

Identify this plant based on these characteristics: ... [Plant Characteristics Description] ...

Previous incorrect response focused on habitat only. Please disregard habitat and focus on morphology.
Previous incorrect response focused on habitat only. Please disregard habitat and focus on morphology.
Tabebuia vellosoi

긴 출력과 긴 형식의 사고를 최대한 활용하기

사고는 Gemini의 상세한 추론을 보여주는 토큰 출력의 일부로 '생각'을 생성합니다. 이러한 출력을 최대한 활용하려면 다음 단계를 따르세요.

이유 검토

Gemini의 추론 과정(Vertex AI Studio UI에서 확인 가능), 작업을 분류한 방법, 출력물에 대해 선택한 사항에 주의를 기울이세요. 이를 통해 결론에 도달한 방식을 이해할 수 있습니다.

추론에 대한 안내 제공

출력이 특히 길어야 하는 경우 프롬프트에 더 많은 안내를 제공하여 프롬프트에 제시된 작업을 완료하는 데 필요한 사고량을 제한하는 것이 좋습니다. 이렇게 하면 대답에 더 많은 토큰 출력을 예약할 수 있습니다.

*예: 세부정보 보고서의 경우 프롬프트에서 섹션과 하위 섹션을 지정하여 Gemini의 사고를 유도하고 출력을 효율적으로 구성할 수 있습니다.

Generate a detailed report on the impact of climate change on coastal ecosystems.

Report Structure:

Introduction

Rising Sea Levels
2.1. Impact on Mangroves
2.2. Impact on Coral Reefs

Ocean Acidification
3.1. Impact on Shellfish
3.2. Impact on Plankton

Extreme Weather Events
4.1. Increased Storm Intensity
4.2. Coastal Erosion

Conclusion

Provide detailed analysis within each section.
<...>
Climate Change Impact on Coastal Ecosystems: A Detailed Report

1.  Introduction

Coastal ecosystems, the dynamic interface between land and sea, are among the most productive and
biodiverse environments on Earth. They provide crucial ecosystem services, including coastal protection,
fisheries, carbon sequestration, and support for a vast array of species. However, these vital
ecosystems are increasingly threatened by the multifaceted impacts of climate change. Driven by
anthropogenic greenhouse gas emissions, climate change is manifesting in several interconnected ways
that are profoundly altering the physical and chemical conditions of coastal environments. This report
will delve into the key impacts of climate change on coastal ecosystems, focusing on rising sea levels,
ocean acidification, and extreme weather events, and their specific consequences for critical habitats
like mangroves and coral reefs, and key organisms like shellfish and plankton. Understanding these
impacts is crucial for developing effective conservation and management strategies to mitigate the
damage and enhance the resilience of these invaluable ecosystems.

2.  Rising Sea Levels

Rising sea levels are a direct and significant consequence of global warming, driven by thermal
expansion of seawater and the melting of land ice (glaciers and ice sheets). This phenomenon poses a
direct threat to low-lying coastal ecosystems by inundating habitats, altering salinity regimes, and
increasing erosion rates. The rate of sea level rise is accelerating, and projections for the 21st
century indicate a continued upward trend, with potentially devastating consequences for coastal
environments.

2.1. Impact on Mangroves

Mangrove forests are unique coastal ecosystems found in tropical and subtropical intertidal zones.
They provide numerous benefits, including coastal protection against storms, nursery grounds for
fish and invertebrates, and significant carbon sequestration...
<...>

다음 단계

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