---
title: "FileSearch tool"
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/schemas/AssistantToolsFileSearch"
---

> Full API specification: https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1.md

# FileSearch tool

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
components:
  schemas:
    FileSearchRankingOptions:
      title: File search tool call ranking options
      type: object
      description: |
        The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.

        See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.
      properties:
        ranker:
          type: string
          description: The ranker to use for the file search. If not specified will use
            the `auto` ranker.
          enum:
            - auto
            - default_2024_08_21
        score_threshold:
          type: number
          description: The score threshold for the file search. All values must be a
            floating point number between 0 and 1.
          minimum: 0
          maximum: 1
      required:
        - score_threshold
    AssistantToolsFileSearch:
      type: object
      title: FileSearch tool
      properties:
        type:
          type: string
          description: "The type of tool being defined: `file_search`"
          enum:
            - file_search
          x-stainless-const: true
        file_search:
          type: object
          description: Overrides for the file search tool.
          properties:
            max_num_results:
              type: integer
              minimum: 1
              maximum: 50
              description: |
                The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.

                Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.
            ranking_options:
              $ref: "#/components/schemas/FileSearchRankingOptions"
      required:
        - type
```
