미디어 해상도

media_resolution 매개변수는 미디어 입력에 할당된 최대 토큰 수 를 결정하여 이미지, 동영상, PDF 문서와 같은 미디어 입력을 Gemini API가 처리하는 방식을 제어하므로 지연 시간과 비용에 대한 응답 품질의 균형을 맞출 수 있습니다. 다양한 설정, 기본값, 토큰과의 상호 관계는 토큰 수 섹션을 참고하세요.

요청 내에서 개별 미디어 객체 (콘텐츠 항목)의 미디어 해상도를 구성할 수 있습니다 (Gemini 3만 해당).

콘텐츠 항목별 미디어 해상도 (Gemini 3만 해당)

Gemini 3을 사용하면 요청 내에서 개별 미디어 객체의 미디어 해상도를 설정하여 토큰 사용을 세부적으로 최적화할 수 있습니다. 단일 요청에서 해상도 수준을 혼합할 수 있습니다. 예를 들어 복잡한 다이어그램에는 고해상도를 사용하고 간단한 컨텍스트 이미지에는 저해상도를 사용합니다.

Python

from google import genai

client = genai.Client()

myfile = client.files.upload(file="path/to/image.jpg")

interaction = client.interactions.create(
    model="gemini-3.6-flash",
    input=[
        {"type": "text", "text": "Describe this image:"},
        {
            "type": "image",
            "uri": myfile.uri,
            "mime_type": myfile.mime_type,
            "resolution": "high"
        }
    ]
)
print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({});

async function main() {
  const myfile = await ai.files.upload({
    file: "path/to/image.jpg",
    config: { mime_type: "image/jpeg" },
  });

  const interaction = await ai.interactions.create({
    model: "gemini-3.6-flash",
    input: [
      { type: "text", text: "Describe this image:" },
      {
        type