Skip to content

Commit cdc1b65

Browse files
Add file search details and ranker options
1 parent 423e672 commit cdc1b65

File tree

1 file changed

+124
-16
lines changed

1 file changed

+124
-16
lines changed

openapi.yaml

Lines changed: 124 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4684,6 +4684,17 @@ paths:
46844684
schema:
46854685
type: string
46864686
description: The ID of the thread to run.
4687+
- name: include
4688+
in: query
4689+
description: &include_param_description |
4690+
A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
4691+
4692+
See the [file search tool documentation](/docs/assistants/tools/file-search/customizing-file-search-settings) for more information.
4693+
schema:
4694+
type: array
4695+
items:
4696+
type: string
4697+
enum: ["step_details.tool_calls[*].file_search.results[*].content"]
46874698
requestBody:
46884699
required: true
46894700
content:
@@ -5644,6 +5655,14 @@ paths:
56445655
description: *pagination_before_param_description
56455656
schema:
56465657
type: string
5658+
- name: include
5659+
in: query
5660+
description: *include_param_description
5661+
schema:
5662+
type: array
5663+
items:
5664+
type: string
5665+
enum: ["step_details.tool_calls[*].file_search.results[*].content"]
56475666
responses:
56485667
"200":
56495668
description: OK
@@ -5655,7 +5674,7 @@ paths:
56555674
name: List run steps
56565675
group: threads
56575676
beta: true
5658-
returns: A list of [run step](/docs/api-reference/runs/step-object) objects.
5677+
returns: A list of [run step](/docs/api-reference/run-steps/step-object) objects.
56595678
examples:
56605679
request:
56615680
curl: |
@@ -5747,6 +5766,14 @@ paths:
57475766
schema:
57485767
type: string
57495768
description: The ID of the run step to retrieve.
5769+
- name: include
5770+
in: query
5771+
description: *include_param_description
5772+
schema:
5773+
type: array
5774+
items:
5775+
type: string
5776+
enum: ["step_details.tool_calls[*].file_search.results[*].content"]
57505777
responses:
57515778
"200":
57525779
description: OK
@@ -5758,7 +5785,7 @@ paths:
57585785
name: Retrieve run step
57595786
group: threads
57605787
beta: true
5761-
returns: The [run step](/docs/api-reference/runs/step-object) object matching the specified ID.
5788+
returns: The [run step](/docs/api-reference/run-steps/step-object) object matching the specified ID.
57625789
examples:
57635790
request:
57645791
curl: |
@@ -12232,10 +12259,30 @@ components:
1223212259
description: |
1223312260
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.
1223412261

12235-
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/number-of-chunks-returned) for more information.
12262+
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.
12263+
ranking_options:
12264+
$ref: "#/components/schemas/FileSearchRankingOptions"
1223612265
required:
1223712266
- type
1223812267

12268+
FileSearchRankingOptions:
12269+
title: File search tool call ranking options
12270+
type: object
12271+
description: |
12272+
The ranking options for the file search.
12273+
12274+
See the [file search tool documentation](/docs/assistants/tools/file-search/customizing-file-search-settings) for more information.
12275+
properties:
12276+
ranker:
12277+
type: string
12278+
description: The ranker to use for the file search. If not specified will use the `auto` ranker.
12279+
enum: ["auto", "default_2024_08_21"]
12280+
score_threshold:
12281+
type: number
12282+
description: The score threshold for the file search. All values must be a floating point number between 0 and 1.
12283+
minimum: 0
12284+
maximum: 1
12285+
1223912286
AssistantToolsFileSearchTypeOnly:
1224012287
type: object
1224112288
title: FileSearch tool
@@ -14198,11 +14245,72 @@ components:
1419814245
type: object
1419914246
description: For now, this is always going to be an empty object.
1420014247
x-oaiTypeLabel: map
14248+
properties:
14249+
ranking_options:
14250+
$ref: "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject"
14251+
results:
14252+
type: array
14253+
description: The results of the file search.
14254+
items:
14255+
$ref: "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject"
1420114256
required:
1420214257
- id
1420314258
- type
1420414259
- file_search
1420514260

14261+
RunStepDetailsToolCallsFileSearchRankingOptionsObject:
14262+
title: File search tool call ranking options
14263+
type: object
14264+
description: The ranking options for the file search.
14265+
properties:
14266+
ranker:
14267+
type: string
14268+
description: The ranker used for the file search.
14269+
enum: ["default_2024_08_21"]
14270+
score_threshold:
14271+
type: number
14272+
description: The score threshold for the file search. All values must be a floating point number between 0 and 1.
14273+
minimum: 0
14274+
maximum: 1
14275+
required:
14276+
- ranker
14277+
- score_threshold
14278+
14279+
RunStepDetailsToolCallsFileSearchResultObject:
14280+
title: File search tool call result
14281+
type: object
14282+
description: A result instance of the file search.
14283+
x-oaiTypeLabel: map
14284+
properties:
14285+
file_id:
14286+
type: string
14287+
description: The ID of the file that result was found in.
14288+
file_name:
14289+
type: string
14290+
description: The name of the file that result was found in.
14291+
score:
14292+
type: number
14293+
description: The score of the result. All values must be a floating point number between 0 and 1.
14294+
minimum: 0
14295+
maximum: 1
14296+
content:
14297+
type: array
14298+
description: The content of the result that was found. The content is only included if requested via the include query parameter.
14299+
items:
14300+
type: object
14301+
properties:
14302+
type:
14303+
type: string
14304+
description: The type of the content.
14305+
enum: ["text"]
14306+
text:
14307+
type: string
14308+
description: The text content of the file.
14309+
required:
14310+
- file_id
14311+
- file_name
14312+
- score
14313+
1420614314
RunStepDeltaStepDetailsToolCallsFileSearchObject:
1420714315
title: File search tool call
1420814316
type: object
@@ -14989,9 +15097,9 @@ components:
1498915097
required:
1499015098
- event
1499115099
- data
14992-
description: Occurs when a [run step](/docs/api-reference/runs/step-object) is created.
15100+
description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) is created.
1499315101
x-oaiMeta:
14994-
dataDescription: "`data` is a [run step](/docs/api-reference/runs/step-object)"
15102+
dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)"
1499515103
- type: object
1499615104
properties:
1499715105
event:
@@ -15002,9 +15110,9 @@ components:
1500215110
required:
1500315111
- event
1500415112
- data
15005-
description: Occurs when a [run step](/docs/api-reference/runs/step-object) moves to an `in_progress` state.
15113+
description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) moves to an `in_progress` state.
1500615114
x-oaiMeta:
15007-
dataDescription: "`data` is a [run step](/docs/api-reference/runs/step-object)"
15115+
dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)"
1500815116
- type: object
1500915117
properties:
1501015118
event:
@@ -15015,7 +15123,7 @@ components:
1501515123
required:
1501615124
- event
1501715125
- data
15018-
description: Occurs when parts of a [run step](/docs/api-reference/runs/step-object) are being streamed.
15126+
description: Occurs when parts of a [run step](/docs/api-reference/run-steps/step-object) are being streamed.
1501915127
x-oaiMeta:
1502015128
dataDescription: "`data` is a [run step delta](/docs/api-reference/assistants-streaming/run-step-delta-object)"
1502115129
- type: object
@@ -15028,9 +15136,9 @@ components:
1502815136
required:
1502915137
- event
1503015138
- data
15031-
description: Occurs when a [run step](/docs/api-reference/runs/step-object) is completed.
15139+
description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) is completed.
1503215140
x-oaiMeta:
15033-
dataDescription: "`data` is a [run step](/docs/api-reference/runs/step-object)"
15141+
dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)"
1503415142
- type: object
1503515143
properties:
1503615144
event:
@@ -15041,9 +15149,9 @@ components:
1504115149
required:
1504215150
- event
1504315151
- data
15044-
description: Occurs when a [run step](/docs/api-reference/runs/step-object) fails.
15152+
description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) fails.
1504515153
x-oaiMeta:
15046-
dataDescription: "`data` is a [run step](/docs/api-reference/runs/step-object)"
15154+
dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)"
1504715155
- type: object
1504815156
properties:
1504915157
event:
@@ -15054,9 +15162,9 @@ components:
1505415162
required:
1505515163
- event
1505615164
- data
15057-
description: Occurs when a [run step](/docs/api-reference/runs/step-object) is cancelled.
15165+
description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) is cancelled.
1505815166
x-oaiMeta:
15059-
dataDescription: "`data` is a [run step](/docs/api-reference/runs/step-object)"
15167+
dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)"
1506015168
- type: object
1506115169
properties:
1506215170
event:
@@ -15067,9 +15175,9 @@ components:
1506715175
required:
1506815176
- event
1506915177
- data
15070-
description: Occurs when a [run step](/docs/api-reference/runs/step-object) expires.
15178+
description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) expires.
1507115179
x-oaiMeta:
15072-
dataDescription: "`data` is a [run step](/docs/api-reference/runs/step-object)"
15180+
dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)"
1507315181

1507415182
MessageStreamEvent:
1507515183
oneOf:

0 commit comments

Comments
 (0)