22
33from __future__ import annotations
44
5- from typing import Union , Iterable , Optional , overload
5+ from typing import List , Union , Iterable , Optional , overload
66from typing_extensions import Literal
77
88import httpx
3838from .....types .beta .threads .run import Run
3939from .....types .beta .assistant_tool_param import AssistantToolParam
4040from .....types .beta .assistant_stream_event import AssistantStreamEvent
41+ from .....types .beta .threads .runs .run_step_include import RunStepInclude
4142from .....types .beta .assistant_tool_choice_option_param import AssistantToolChoiceOptionParam
4243from .....types .beta .assistant_response_format_option_param import AssistantResponseFormatOptionParam
4344
@@ -63,6 +64,7 @@ def create(
6364 thread_id : str ,
6465 * ,
6566 assistant_id : str ,
67+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
6668 additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
6769 additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
6870 instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -93,6 +95,14 @@ def create(
9395 [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
9496 execute this run.
9597
98+ include: A list of additional fields to include in the response. Currently the only
99+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
100+ to fetch the file search result content.
101+
102+ See the
103+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
104+ for more information.
105+
96106 additional_instructions: Appends additional instructions at the end of the instructions for the run. This
97107 is useful for modifying the behavior on a per-run basis without overriding other
98108 instructions.
@@ -195,6 +205,7 @@ def create(
195205 * ,
196206 assistant_id : str ,
197207 stream : Literal [True ],
208+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
198209 additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
199210 additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
200211 instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -228,6 +239,14 @@ def create(
228239 events, terminating when the Run enters a terminal state with a `data: [DONE]`
229240 message.
230241
242+ include: A list of additional fields to include in the response. Currently the only
243+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
244+ to fetch the file search result content.
245+
246+ See the
247+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
248+ for more information.
249+
231250 additional_instructions: Appends additional instructions at the end of the instructions for the run. This
232251 is useful for modifying the behavior on a per-run basis without overriding other
233252 instructions.
@@ -326,6 +345,7 @@ def create(
326345 * ,
327346 assistant_id : str ,
328347 stream : bool ,
348+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
329349 additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
330350 additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
331351 instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -359,6 +379,14 @@ def create(
359379 events, terminating when the Run enters a terminal state with a `data: [DONE]`
360380 message.
361381
382+ include: A list of additional fields to include in the response. Currently the only
383+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
384+ to fetch the file search result content.
385+
386+ See the
387+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
388+ for more information.
389+
362390 additional_instructions: Appends additional instructions at the end of the instructions for the run. This
363391 is useful for modifying the behavior on a per-run basis without overriding other
364392 instructions.
@@ -456,6 +484,7 @@ def create(
456484 thread_id : str ,
457485 * ,
458486 assistant_id : str ,
487+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
459488 additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
460489 additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
461490 instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -505,7 +534,11 @@ def create(
505534 run_create_params .RunCreateParams ,
506535 ),
507536 options = make_request_options (
508- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
537+ extra_headers = extra_headers ,
538+ extra_query = extra_query ,
539+ extra_body = extra_body ,
540+ timeout = timeout ,
541+ query = maybe_transform ({"include" : include }, run_create_params .RunCreateParams ),
509542 ),
510543 cast_to = Run ,
511544 stream = stream or False ,
@@ -868,6 +901,7 @@ async def create(
868901 thread_id : str ,
869902 * ,
870903 assistant_id : str ,
904+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
871905 additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
872906 additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
873907 instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -898,6 +932,14 @@ async def create(
898932 [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
899933 execute this run.
900934
935+ include: A list of additional fields to include in the response. Currently the only
936+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
937+ to fetch the file search result content.
938+
939+ See the
940+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
941+ for more information.
942+
901943 additional_instructions: Appends additional instructions at the end of the instructions for the run. This
902944 is useful for modifying the behavior on a per-run basis without overriding other
903945 instructions.
@@ -1000,6 +1042,7 @@ async def create(
10001042 * ,
10011043 assistant_id : str ,
10021044 stream : Literal [True ],
1045+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
10031046 additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
10041047 additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
10051048 instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1033,6 +1076,14 @@ async def create(
10331076 events, terminating when the Run enters a terminal state with a `data: [DONE]`
10341077 message.
10351078
1079+ include: A list of additional fields to include in the response. Currently the only
1080+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
1081+ to fetch the file search result content.
1082+
1083+ See the
1084+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1085+ for more information.
1086+
10361087 additional_instructions: Appends additional instructions at the end of the instructions for the run. This
10371088 is useful for modifying the behavior on a per-run basis without overriding other
10381089 instructions.
@@ -1131,6 +1182,7 @@ async def create(
11311182 * ,
11321183 assistant_id : str ,
11331184 stream : bool ,
1185+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
11341186 additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
11351187 additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
11361188 instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1164,6 +1216,14 @@ async def create(
11641216 events, terminating when the Run enters a terminal state with a `data: [DONE]`
11651217 message.
11661218
1219+ include: A list of additional fields to include in the response. Currently the only
1220+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
1221+ to fetch the file search result content.
1222+
1223+ See the
1224+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1225+ for more information.
1226+
11671227 additional_instructions: Appends additional instructions at the end of the instructions for the run. This
11681228 is useful for modifying the behavior on a per-run basis without overriding other
11691229 instructions.
@@ -1261,6 +1321,7 @@ async def create(
12611321 thread_id : str ,
12621322 * ,
12631323 assistant_id : str ,
1324+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
12641325 additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
12651326 additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
12661327 instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1310,7 +1371,11 @@ async def create(
13101371 run_create_params .RunCreateParams ,
13111372 ),
13121373 options = make_request_options (
1313- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1374+ extra_headers = extra_headers ,
1375+ extra_query = extra_query ,
1376+ extra_body = extra_body ,
1377+ timeout = timeout ,
1378+ query = await async_maybe_transform ({"include" : include }, run_create_params .RunCreateParams ),
13141379 ),
13151380 cast_to = Run ,
13161381 stream = stream or False ,
0 commit comments