파일 검색

파일 검색

Gemini API는 File Search 도구를 통해 검색 증강 생성(RAG)을 제공해요. File Search는 데이터를 가져오고, 청크로 나누고, 인덱싱해 제공된 프롬프트에 기반한 관련 정보를 빠르게 검색할 수 있게 해요. 이 검색된 정보는 모델의 컨텍스트로 사용되어 더 정확하고 관련성 있는 답변을 제공할 수 있게 해요. File search는 gemini-embedding-001이 지원하는 텍스트 임베딩과 gemini-embedding-2가 지원하는 이미지/멀티모달 임베딩으로 멀티모달 기능도 제공해요.

파일 저장과 쿼리 시 임베딩 생성은 무료이며, 파일을 처음 인덱싱할 때 임베딩을 만들 때와 일반 Gemini 모델 입력/출력 토큰 비용만 지불하면 돼요. 이 새로운 청구 패러다임은 File Search Tool을 더 쉽고 비용 효율적으로 구축·확장하게 해줘요. 자세한 내용은 가격 섹션을 참조하세요.

출처: 원문

본문

File Search 저장소에 직접 업로드

이 예시는 file search store에 파일을 직접 업로드하는 방법을 보여줘요.

from google import genai
from google.genai import types
import time

client = genai.Client()

# File name will be visible in citations
file_search_store = client.file_search_stores.create(
    config={
        'display_name': 'your-fileSearchStore-name',
        'embedding_model': 'models/gemini-embedding-2'
    }
)

operation = client.file_search_stores.upload_to_file_search_store(
  file='sample.txt',
  file_search_store_name=file_search_store.name,
  config={
      'display_name' : 'display-file-name',
  }
)

while not operation.done:
    time.sleep(5)
    operation = client.operations.get(operation)

response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="""Can you tell me about [insert question]""",
    config=types.GenerateContentConfig(
        tools=[
            types.Tool(
                file_search=types.FileSearch(
                    file_search_store_names=[file_search_store.name]
                )
            )
        ]
    )
)

print(response.text)
const { GoogleGenAI } = require('@google/genai');

const ai = new GoogleGenAI({});

async function run() {
  // File name will be visible in citations
  const fileSearchStore = await ai.fileSearchStores.create({
    config: {
      displayName: 'your-fileSearchStore-name',
      embeddingModel: 'models/gemini-embedding-2'
    }
  });

  let operation = await ai.fileSearchStores.uploadToFileSearchStore({
    file: 'file.txt',
    fileSearchStoreName: fileSearchStore.name,
    config: {
      displayName: 'file-name',
    }
  });

  while (!operation.done) {
    await new Promise(resolve => setTimeout(resolve, 5000));
    operation = await ai.operations.get({ operation });
  }

  const response = await ai.models.generateContent({
    model: "gemini-3.8-flash",
    contents: "Can you tell me about [insert question]",
    config: {
      tools: [
        {
          fileSearch: {
            fileSearchStoreNames: [fileSearchStore.name]
          }
        }
      ]
    }
  });

  console.log(response.text);
}

run();

자세한 내용은 API 참조의 uploadToFileSearchStore를 확인하세요.

파일 가져오기

또는 기존 파일을 업로드하고 file search store에 가져올 수 있어요.

from google import genai
from google.genai import types
import time

client = genai.Client()

# File name will be visible in citations
sample_file = client.files.upload(file='sample.txt', config={'name': 'display_file_name'})

file_search_store = client.file_search_stores.create(
    config={
        'display_name': 'your-fileSearchStore-name',
        'embedding_model': 'models/gemini-embedding-2'
    }
)

operation = client.file_search_stores.import_file(
    file_search_store_name=file_search_store.name,
    file_name=sample_file.name
)

while not operation.done:
    time.sleep(5)
    operation = client.operations.get(operation)

response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="""Can you tell me about [insert question]""",
    config=types.GenerateContentConfig(
        tools=[
            types.Tool(
                file_search=types.FileSearch(
                    file_search_store_names=[file_search_store.name]
                )
            )
        ]
    )
)

print(response.text)
const { GoogleGenAI } = require('@google/genai');

const ai = new GoogleGenAI({});

async function run() {
  // File name will be visible in citations
  const sampleFile = await ai.files.upload({
    file: 'sample.txt',
    config: { name: 'file-name' }
  });

  const fileSearchStore = await ai.fileSearchStores.create({
    config: {
      displayName: 'your-fileSearchStore-name',
      embeddingModel: 'models/gemini-embedding-2'
    }
  });

  let operation = await ai.fileSearchStores.importFile({
    fileSearchStoreName: fileSearchStore.name,
    fileName: sampleFile.name
  });

  while (!operation.done) {
    await new Promise(resolve => setTimeout(resolve, 5000));
    operation = await ai.operations.get({ operation: operation });
  }

  const response = await ai.models.generateContent({
    model: "gemini-3.8-flash",
    contents: "Can you tell me about [insert question]",
    config: {
      tools: [
        {
          fileSearch: {
            fileSearchStoreNames: [fileSearchStore.name]
          }
        }
      ]
    }
  });

  console.log(response.text);
}

run();

자세한 내용은 API 참조의 importFile을 확인하세요.

청크 구성

파일을 File Search 저장소로 가져오면 자동으로 청크로 분할되고, 임베딩되고, 인덱싱되며, File Search 저장소에 업로드돼요. 청크 전략에 대한 더 많은 제어가 필요하다면 chunking_config 설정을 지정해 청크당 최대 토큰 수와 최대 중첩 토큰 수를 설정할 수 있어요.

from google import genai
from google.genai import types
import time

client = genai.Client()

operation = client.file_search_stores.upload_to_file_search_store(
    file_search_store_name=file_search_store.name,
    file_name=sample_file.name,
    config={
        'chunking_config': {
          'white_space_config': {
            'max_tokens_per_chunk': 200,
            'max_overlap_tokens': 20
          }
        }
    }
)

while not operation.done:
    time.sleep(5)
    operation = client.operations.get(operation)

print("Custom chunking complete.")
const { GoogleGenAI } = require('@google/genai');

const ai = new GoogleGenAI({});

let operation = await ai.fileSearchStores.uploadToFileSearchStore({
  file: 'file.txt',
  fileSearchStoreName: fileSearchStore.name,
  config: {
    displayName: 'file-name',
    chunkingConfig: {
      whiteSpaceConfig: {
        maxTokensPerChunk: 200,
        maxOverlapTokens: 20
      }
    }
  }
});

while (!operation.done) {
  await new Promise(resolve => setTimeout(resolve, 5000));
  operation = await ai.operations.get({ operation });
}
console.log("Custom chunking complete.");

File Search 저장소를 사용하려면 업로드 및 가져오기 예시에서 보여준 것처럼 generateContent 메서드에 도구로 전달해요.

작동 방식

File Search는 의미 검색(semantic search)이라는 기술을 사용해 사용자 프롬프트와 관련된 정보를 찾아요. 표준 키워드 기반 검색과 달리 의미 검색은 쿼리의 의미와 컨텍스트를 이해해요.

파일을 가져오면 업로드된 콘텐츠의 의미를 포착하는 임베딩이라는 숫자 표현으로 변환돼요. 이 임베딩은 전용 File Search 데이터베이스에 저장돼요.

쿼리를 하면 그것도 임베딩으로 변환돼요. 그런 다음 시스템이 File Search를 수행해 File Search 저장소에서 가장 유사하고 관련성 있는 문서 청크를 찾아요.

임베딩에는 TTL(수명)이 없어요. 수동으로 삭제하거나 모델이 폐기될 때까지 지속돼요. 그러나 파일은 48시간 후 삭제돼요.

File Search uploadToFileSearchStore API 사용 프로세스의 세부 사항은 다음과 같아요.

  1. File Search 저장소 만들기: File Search 저장소에는 파일에서 처리된 데이터가 포함돼요. 의미 검색이 작동할 임베딩의 지속적인 컨테이너예요.
  2. 파일 업로드 및 File Search 저장소로 가져오기: 파일을 업로드하고 결과를 File Search 저장소로 동시에 가져와요. 이는 원시 문서를 참조하는 임시 File 객체를 만들어요. 그 데이터는 청크로 나뉘고 File Search 임베딩으로 변환되며 인덱싱돼요. File 객체는 48시간 후 삭제되지만, File Search 저장소로 가져온 데이터는 삭제를 선택할 때까지 무기한 저장돼요.
  3. File Search로 쿼리: 마지막으로 generateContent 호출에서 FileSearch 도구를 사용해요. 도구 구성에서 검색할 FileSearchStore를 가리키는 FileSearchRetrievalResource를 지정해요. 이는 모델이 해당 특정 File Search 저장소에서 의미 검색을 수행해 응답을 그라운딩할 관련 정보를 찾도록 지시해요.

이 다이어그램에서 Documents에서 Embedding model(gemini-embedding-001](/gemini-api/docs/embeddings) 사용)로 가는 점선은 uploadToFileSearchStore API를 나타내요(File storage 우회). 그렇지 않으면 Files API를 사용해 파일을 별도로 만들고 가져오는 방식은 인덱싱 프로세스를 Documents에서 File storage로, 그다음 Embedding model로 이동시켜요.

File Search 저장소

File Search 저장소는 문서 임베딩의 컨테이너예요. File API를 통해 업로드된 원시 파일은 48시간 후 삭제되지만, File Search 저장소로 가져온 데이터는 수동으로 삭제할 때까지 무기한 저장돼요. 문서를 구성하기 위해 여러 File Search 저장소를 만들 수 있어요. FileSearchStore API로 file search 저장소를 생성, 나열, 조회, 삭제할 수 있어요. File Search 저장소 이름은 전역으로 범위가 지정돼요.

File Search 저장소를 관리하는 방법의 몇 가지 예시는 다음과 같아요.

file_search_store = client.file_search_stores.create(
    config={
        'display_name': 'my-file_search-store-123',
        'embedding_model': 'models/gemini-embedding-2'
    }
)

for file_search_store in client.file_search_stores.list():
    print(file_search_store)

my_file_search_store = client.file_search_stores.get(name='fileSearchStores/my-file_search-store-123')

client.file_search_stores.delete(name='fileSearchStores/my-file_search-store-123', config={'force': True})
const fileSearchStore = await ai.fileSearchStores.create({
  config: {
    displayName: 'my-file_search-store-123',
    embeddingModel: 'models/gemini-embedding-2'
  }
});

const fileSearchStores = await ai.fileSearchStores.list();
for await (const store of fileSearchStores) {
  console.log(store);
}

const myFileSearchStore = await ai.fileSearchStores.get({
  name: 'fileSearchStores/my-file_search-store-123'
});

await ai.fileSearchStores.delete({
  name: 'fileSearchStores/my-file_search-store-123',
  config: { force: true }
});
curl -X POST "https://generativelanguage.googleapis.com/v1beta/fileSearchStores?key=${GEMINI_API_KEY}" \
    -H "Content-Type: application/json" \
    -d '{ "displayName": "My Store", "embedding_model": "models/gemini-embedding-2" }'

curl "https://generativelanguage.googleapis.com/v1beta/fileSearchStores?key=${GEMINI_API_KEY}"

curl "https://generativelanguage.googleapis.com/v1beta/fileSearchStores/my-file_search-store-123?key=${GEMINI_API_KEY}"

curl -X DELETE "https://generativelanguage.googleapis.com/v1beta/fileSearchStores/my-file_search-store-123?key=${GEMINI_API_KEY}"

File Search 문서

File Search Documents API로 file 저장소의 개별 문서를 관리해 각 문서를 list하고, 문서에 대한 정보를 get하고, 이름으로 문서를 delete할 수 있어요.

for document_in_store in client.file_search_stores.documents.list(parent='fileSearchStores/my-file_search-store-123'):
  print(document_in_store)

file_search_document = client.file_search_stores.documents.get(name='fileSearchStores/my-file_search-store-123/documents/my_doc')
print(file_search_document)

client.file_search_stores.documents.delete(name='fileSearchStores/my-file_search-store-123/documents/my_doc')
const documents = await ai.fileSearchStores.documents.list({
  parent: 'fileSearchStores/my-file_search-store-123'
});
for await (const doc of documents) {
  console.log(doc);
}

const fileSearchDocument = await ai.fileSearchStores.documents.get({
  name: 'fileSearchStores/my-file_search-store-123/documents/my_doc',
});

await ai.fileSearchStores.documents.delete({
  name: 'fileSearchStores/my-file_search-store-123/documents/my_doc'
});
curl "https://generativelanguage.googleapis.com/v1beta/fileSearchStores/my-file_search-store-123/documents?key=${GEMINI_API_KEY}"

curl "https://generativelanguage.googleapis.com/v1beta/fileSearchStores/my-file_search-store-123/documents/my_doc?key=${GEMINI_API_KEY}"

curl -X DELETE "https://generativelanguage.googleapis.com/v1beta/fileSearchStores/my-file_search-store-123/documents/my_doc?key=${GEMINI_API_KEY}"

파일 메타데이터

파일을 필터링하거나 추가 컨텍스트를 제공하는 데 도움이 되도록 파일에 커스텀 메타데이터를 추가할 수 있어요. 메타데이터는 키-값 쌍의 집합이에요.

op = client.file_search_stores.import_file(
    file_search_store_name=file_search_store.name,
    file_name=sample_file.name,
    custom_metadata=[
        {"key": "author", "string_value": "Robert Graves"},
        {"key": "year", "numeric_value": 1934}
    ]
)
let operation = await ai.fileSearchStores.importFile({
  fileSearchStoreName: fileSearchStore.name,
  fileName: sampleFile.name,
  config: {
    customMetadata: [
      { key: "author", stringValue: "Robert Graves" },
      { key: "year", numericValue: 1934 }
    ]
  }
});

이것은 File Search 저장소에 여러 문서가 있고 그 중 일부만 검색하려 할 때 유용해요.

response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="Tell me about the book 'I, Claudius'",
    config=types.GenerateContentConfig(
        tools=[
            types.Tool(
                file_search=types.FileSearch(
                    file_search_store_names=[file_search_store.name],
                    metadata_filter="author=Robert Graves",
                )
            )
        ]
    )
)

print(response.text)
const response = await ai.models.generateContent({
  model: "gemini-3.8-flash",
  contents: "Tell me about the book 'I, Claudius'",
  config: {
    tools: [
      {
        fileSearch: {
          fileSearchStoreNames: [fileSearchStore.name],
          metadataFilter: 'author="Robert Graves"',
        }
      }
    ]
  }
});

console.log(response.text);
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent?key=${GEMINI_API_KEY}" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
            "contents": [{
                "parts":[{"text": "Tell me about the book I, Claudius"}]
            }],
            "tools": [{
                "file_search": {
                    "file_search_store_names":["'$STORE_NAME'"],
                    "metadata_filter": "author = \"Robert Graves\""
                }
            }]
        }' 2> /dev/null > response.json

cat response.json

metadata_filter의 목록 필터 구문 구현 지침은 google.aip.dev/160에서 찾을 수 있어요.

멀티모달 파일 검색

멀티모달 파일 검색을 사용하면 이미지를 네이티브로 임베딩하고 검색할 수 있어 풍부한 멀티모달 RAG 애플리케이션을 구현할 수 있어요.

임베딩 모델 구성

FileSearchStore를 만들 때 기본 텍스트 전용 임베딩 모델을 멀티모달 모델로 재정의해야 해요. models/gemini-embedding-2를 사용해 텍스트와 이미지를 모두 처리하세요.

store = client.file_search_stores.create(
    config={
        "display_name": "Multimodal Catalog",
        "embedding_model": "models/gemini-embedding-2",
    }
)
const fileSearchStore = await ai.fileSearchStores.create({
  config: {
    displayName: "Multimodal Catalog",
    embeddingModel: "models/gemini-embedding-2",
  },
});
curl -X POST "https://generativelanguage.googleapis.com/v1beta/fileSearchStores?key=$GEMINI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "display_name": "Multimodal Catalog",
      "embedding_model": "models/gemini-embedding-2"
    }'

이미지 업로드

멀티모달 임베딩 모델로 저장소를 만든 후, File Search 저장소에 직접 업로드 또는 파일 가져오기에서 설명한 것과 동일한 업로드 API로 이미지 파일을 직접 업로드할 수 있어요.

이미지 파일 요구사항:

  • 이미지 파일은 최대 4K x 4K 픽셀 해상도여야 해요.
  • 지원 형식은 PNG, JPEG예요.

인용

File Search를 사용할 때 모델의 응답에는 답변을 생성하는 데 사용된 업로드 문서의 일부를 지정하는 인용이 포함될 수 있어요. 이는 사실 확인과 검증에 도움이 돼요.

응답의 grounding_metadata 속성을 통해 인용 정보에 접근할 수 있어요.

print(response.candidates[0].grounding_metadata)
console.log(JSON.stringify(response.candidates?.[0]?.groundingMetadata, null, 2));

그라운딩 메타데이터 구조에 대한 자세한 정보는 File Search cookbook의 예시나 Grounding with Google Search의 그라운딩 섹션 문서를 참조하세요.

페이지 번호

PDF 같은 페이지가 있는 문서와 함께 File Search를 사용하면 모델의 응답에 정보가 발견된 페이지 번호가 포함될 수 있어요. retrieved_context의 page_number 속성으로 이 정보에 접근할 수 있어요.

# Iterate through citations and check for page numbers
for chunk in response.grounding_metadata.grounding_chunks:
   if chunk.retrieved_context and chunk.retrieved_context.page_number:
       print(f"Cited Page: {chunk.retrieved_context.page_number}")
const groundingMetadata = response.candidates[0].groundingMetadata;
for (const chunk of groundingMetadata.groundingChunks) {
  if (chunk.retrievedContext && chunk.retrievedContext.pageNumber) {
    console.log(`Cited Page: ${chunk.retrievedContext.pageNumber}`);
  }
}

미디어 인용

모델이 생성 중에 이미지 청크를 참조하면 API는 그라운딩 메타데이터에 media_id를 포함하는 인용을 반환해요. 이 ID를 사용해 모델이 참조한 정확한 이미지 청크를 다운로드할 수 있어요. 이 media_id는 여러 검색 호출에 걸쳐 지속되므로 같은 이미지를 안정적으로 검색하거나 ID로 캐시할 수 있어요.

다음 스니펫은 REST 응답 예시예요.

"groundingMetadata": {
  "groundingChunks": [
    {
      "retrievedContext": {
        "title": "product_image",
        "fileSearchStore": "fileSearchStores/my-store-123",
        "media_id": "fileSearchStores/my-store-123/media/BlobId-456"
      }
    }
  ]
}

다음 코드 스니펫은 media_id를 검색하고 미디어를 다운로드하는 방법을 보여줘요.

# Iterate through citations and download media if present
for chunk in response.grounding_metadata.grounding_chunks:
   if chunk.retrieved_context and chunk.retrieved_context.media_id:
       print(f"Cited Media ID: {chunk.retrieved_context.media_id}")
       # Download the blob using the SDK
       blob_content = client.file_search_stores.download_media(
           media_id=chunk.retrieved_context.media_id
       )
       # Save blob_content to file...
const groundingMetadata = response.candidates[0].groundingMetadata;
for (const chunk of groundingMetadata.groundingChunks) {
  if (chunk.retrievedContext && chunk.retrievedContext.mediaId) {
    console.log(`Cited Media ID: ${chunk.retrievedContext.mediaId}`);
    const blobContent = await ai.fileSearchStores.downloadMedia(chunk.retrievedContext.mediaId);
    // Save blobContent to file...
  }
}
curl -X GET "https://generativelanguage.googleapis.com/v1/fileSearchStores/my-store-123/media/BlobId-456" \
  -H "x-goog-api-key: ***

그라운딩 데이터의 커스텀 메타데이터

파일에 커스텀 메타데이터를 추가했다면 모델 응답의 그라운딩 메타데이터에서 접근할 수 있어요. 이는 소스 문서에서 애플리케이션 로직으로 추가 컨텍스트(URL, 페이지 번호, 작성자 같은)를 전달하는 데 유용해요. retrieved_context의 각 grounding_chunk에 이 커스텀 메타데이터가 포함돼요.

response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="Tell me about [insert question]",
    config=types.GenerateContentConfig(
        tools=[
            types.Tool(
                file_search=types.FileSearch(
                    file_search_store_names=[file_search_store.name]
                )
            )
        ]
    )
)

for chunk in response.candidates[0].grounding_metadata.grounding_chunks:
    if chunk.retrieved_context:
        print(f"Text: {chunk.retrieved_context.text}")
        if chunk.retrieved_context.custom_metadata:
            for metadata in chunk.retrieved_context.custom_metadata:
                print(f"Metadata Key: {metadata.key}")
                print(f"Value: {metadata.string_value or metadata.numeric_value}")
const response = await ai.models.generateContent({
  model: "gemini-3.8-flash",
  contents: "Tell me about [insert question]",
  config: {
    tools: [
      {
        fileSearch: {
          fileSearchStoreNames: [fileSearchStore.name]
        }
      }
    ]
  }
});

const groundingMetadata = response.candidates[0].groundingMetadata;
groundingMetadata.groundingChunks.forEach((chunk) => {
  if (chunk.retrievedContext) {
    console.log(`Text: ${chunk.retrievedContext.text}`);
    if (chunk.retrievedContext.customMetadata) {
      chunk.retrievedContext.customMetadata.forEach((metadata) => {
        console.log(`Metadata Key: ${metadata.key}`);
        console.log(`Value: ${metadata.stringValue || metadata.numericValue}`);
      });
    }
  }
});
{
  "candidates": [
    {
      "content": { ... },
      "grounding_metadata": {
        "grounding_chunks": [
          {
            "retrieved_context": {
              "text": "...",
              "title": "...",
              "uri": "...",
              "custom_metadata": [
                {
                  "key": "author",
                  "string_value": "Robert Graves"
                },
                {
                  "key": "year",
                  "numeric_value": 1934
                }
              ]
            }
          }
        ],
        "grounding_supports": [ ... ]
      }
    }
  ]
}

구조화된 출력

Gemini 3 모델부터 파일 검색 도구를 구조화된 출력과 결합할 수 있어요.

from pydantic import BaseModel, Field

class Money(BaseModel):
    amount: str = Field(description="The numerical part of the amount.")
    currency: str = Field(description="The currency of amount.")

response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="What is the minimum hourly wage in Tokyo right now?",
    config=types.GenerateContentConfig(
                tools=[
                    types.Tool(
                        file_search=types.FileSearch(
                            file_search_store_names=[file_search_store.name]
                        )
                    )
                ],
                response_format={"text": {"mime_type": "application/json", "schema": Money.model_json_schema()}}
      )
)
result = Money.model_validate_json(response.text)
print(result)
import { z } from "zod";

const moneySchema = z.object({
  amount: z.string().describe("The numerical part of the amount."),
  currency: z.string().describe("The currency of amount."),
});

async function run() {
  const response = await ai.models.generateContent({
    model: "gemini-3.8-flash",
    contents: "What is the minimum hourly wage in Tokyo right now?",
    config: {
      tools: [
        {
          fileSearch: {
            fileSearchStoreNames: [file_search_store.name],
          },
        },
      ],
      responseFormat: { text: { mimeType: "application/json", schema: z.toJSONSchema(moneySchema) } },
    },
  });

  const result = moneySchema.parse(JSON.parse(response.text));
  console.log(result);
}

run();
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent" \
  -H "x-goog-api-key: *** \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "contents": [{
      "parts": [{"text": "What is the minimum hourly wage in Tokyo right now?"}]
    }],
    "tools": [
      {
        "fileSearch": {
          "fileSearchStoreNames": ["$FILE_SEARCH_STORE_NAME"]
        }
      }
    ],
    "generationConfig": {
"responseFormat": {
  "text": {
    "mimeType": "application/json",
    "schema": {
            "type": "object",
            "properties": {
                "amount": {"type": "string", "description": "The numerical part of the amount."},
                "currency": {"type": "string", "description": "The currency of amount."}
  }
}
},
            "required": ["amount", "currency"]
        }
    }
  }'

지원 모델

다음 모델이 File Search를 지원해요.

모델 파일 검색
Gemini 3.8 Flash ✔️
Gemini 3.7 Flash ✔️
Gemini 3.6 Flash ✔️
Gemini 3.5 Flash-Lite ✔️
Gemini 3.5 Flash ✔️
Gemini 3.1 Pro Preview ✔️
Gemini 3.1 Flash-Lite ✔️
Gemini 3 Flash Preview ✔️
Gemini 2.5 Pro ✔️
Gemini 2.5 Flash-Lite ✔️

지원 도구 조합

Gemini 3 모델은 내장 도구(예: File Search)를 커스텀 도구(함수 호출)와 결합하는 것을 지원해요. 도구 조합 페이지에서 자세히 알아보세요.

지원 파일 유형

File Search는 다음 섹션에 나열된 광범위한 파일 형식을 지원해요.

애플리케이션 파일 유형

  • application/dart
  • application/ecmascript
  • application/json
  • application/ms-java
  • application/msword
  • application/pdf
  • application/sql
  • application/typescript
  • application/vnd.curl
  • application/vnd.dart
  • application/vnd.ibm.secure-container
  • application/vnd.jupyter
  • application/vnd.ms-excel
  • application/vnd.oasis.opendocument.text
  • application/vnd.openxmlformats-officedocument.presentationml.presentation
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • application/vnd.openxmlformats-officedocument.wordprocessingml.template
  • application/x-csh
  • application/x-hwp
  • application/x-hwp-v5
  • application/x-latex
  • application/x-php
  • application/x-powershell
  • application/x-sh
  • application/x-shellscript
  • application/x-tex
  • application/x-zsh
  • application/xml
  • application/zip

텍스트 파일 유형

  • text/1d-interleaved-parityfec
  • text/RED
  • text/SGML
  • text/cache-manifest
  • text/calendar
  • text/cql
  • text/cql-extension
  • text/cql-identifier
  • text/css
  • text/csv
  • text/csv-schema
  • text/dns
  • text/encaprtp
  • text/enriched
  • text/example
  • text/fhirpath
  • text/flexfec
  • text/fwdred
  • text/gff3
  • text/grammar-ref-list
  • text/hl7v2
  • text/html
  • text/javascript
  • text/jcr-cnd
  • text/jsx
  • text/markdown
  • text/mizar
  • text/n3
  • text/parameters
  • text/parityfec
  • text/php
  • text/plain
  • text/provenance-notation
  • text/prs.fallenstein.rst
  • text/prs.lines.tag
  • text/prs.prop.logic
  • text/raptorfec
  • text/rfc822-headers
  • text/rtf
  • text/rtp-enc-aescm128
  • text/rtploopback
  • text/rtx
  • text/sgml
  • text/shaclc
  • text/shex
  • text/spdx
  • text/strings
  • text/t140
  • text/tab-separated-values
  • text/texmacs
  • text/troff
  • text/tsv
  • text/tsx
  • text/turtle
  • text/ulpfec
  • text/uri-list
  • text/vcard
  • text/vnd.DMClientScript
  • text/vnd.IPTC.NITF
  • text/vnd.IPTC.NewsML
  • text/vnd.a
  • text/vnd.abc
  • text/vnd.ascii-art
  • text/vnd.curl
  • text/vnd.debian.copyright
  • text/vnd.dvb.subtitle
  • text/vnd.esmertec.theme-descriptor
  • text/vnd.exchangeable
  • text/vnd.familysearch.gedcom
  • text/vnd.ficlab.flt
  • text/vnd.fly
  • text/vnd.fmi.flexstor
  • text/vnd.gml
  • text/vnd.graphviz
  • text/vnd.hans
  • text/vnd.hgl
  • text/vnd.in3d.3dml
  • text/vnd.in3d.spot
  • text/vnd.latex-z
  • text/vnd.motorola.reflex
  • text/vnd.ms-mediapackage
  • text/vnd.net2phone.commcenter.command
  • text/vnd.radisys.msml-basic-layout
  • text/vnd.senx.warpscript
  • text/vnd.sosi
  • text/vnd.sun.j2me.app-descriptor
  • text/vnd.trolltech.linguist
  • text/vnd.wap.si
  • text/vnd.wap.sl
  • text/vnd.wap.wml
  • text/vnd.wap.wmlscript
  • text/vtt
  • text/wgsl
  • text/x-asm
  • text/x-bibtex
  • text/x-boo
  • text/x-c
  • text/x-c++hdr
  • text/x-c++src
  • text/x-cassandra
  • text/x-chdr
  • text/x-coffeescript
  • text/x-component
  • text/x-csh
  • text/x-csharp
  • text/x-csrc
  • text/x-cuda
  • text/x-d
  • text/x-diff
  • text/x-dsrc
  • text/x-emacs-lisp
  • text/x-erlang
  • text/x-gff3
  • text/x-go
  • text/x-haskell
  • text/x-java
  • text/x-java-properties
  • text/x-java-source
  • text/x-kotlin
  • text/x-lilypond
  • text/x-lisp
  • text/x-literate-haskell
  • text/x-lua
  • text/x-moc
  • text/x-objcsrc
  • text/x-pascal
  • text/x-pcs-gcd
  • text/x-perl
  • text/x-perl-script
  • text/x-python
  • text/x-python-script
  • text/x-r-markdown
  • text/x-rsrc
  • text/x-rst
  • text/x-ruby-script
  • text/x-rust
  • text/x-sass
  • text/x-scala
  • text/x-scheme
  • text/x-script.python
  • text/x-scss
  • text/x-setext
  • text/x-sfv
  • text/x-sh
  • text/x-siesta
  • text/x-sos
  • text/x-sql
  • text/x-swift
  • text/x-tcl
  • text/x-tex
  • text/x-vbasic
  • text/x-vcalendar
  • text/xml
  • text/xml-dtd
  • text/xml-external-parsed-entity
  • text/yaml

제한 사항

요금 한도

File Search API는 서비스 안정성을 강화하기 위해 다음 한도가 있어요.

  • 최대 파일 크기 / 문서당 한도: 100MB
  • 프로젝트 File Search 저장소 총 크기(사용자 계층 기준): 무료: 1GB / Tier 1: 10GB / Tier 2: 100GB / Tier 3: 1TB
  • 권장 사항: 최적의 검색 지연 시간을 보장하려면 각 File Search 저장소의 크기를 20GB 미만으로 제한하세요.

가격

  • 인덱싱 시 임베딩에 대해 기존 임베딩 가격에 따라 청구돼요.
  • 저장은 무료예요.
  • 쿼리 시 임베딩은 무료예요.
  • 검색된 문서 토큰은 일반 컨텍스트 토큰으로 청구돼요.

다음 단계

더 알아보기 (Learn more)