3
3
from __future__ import annotations
4
4
5
5
import typing_extensions
6
- from typing import Union , Iterable , Optional , overload
6
+ from typing import List , Union , Iterable , Optional , overload
7
7
from functools import partial
8
8
from typing_extensions import Literal
9
9
49
49
from .....types .beta .threads .run import Run
50
50
from .....types .beta .assistant_tool_param import AssistantToolParam
51
51
from .....types .beta .assistant_stream_event import AssistantStreamEvent
52
+ from .....types .beta .threads .runs .run_step_include import RunStepInclude
52
53
from .....types .beta .assistant_tool_choice_option_param import AssistantToolChoiceOptionParam
53
54
from .....types .beta .assistant_response_format_option_param import AssistantResponseFormatOptionParam
54
55
@@ -74,6 +75,7 @@ def create(
74
75
thread_id : str ,
75
76
* ,
76
77
assistant_id : str ,
78
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
77
79
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
78
80
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
79
81
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -104,6 +106,14 @@ def create(
104
106
[assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
105
107
execute this run.
106
108
109
+ include: A list of additional fields to include in the response. Currently the only
110
+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
111
+ to fetch the file search result content.
112
+
113
+ See the
114
+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
115
+ for more information.
116
+
107
117
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
108
118
is useful for modifying the behavior on a per-run basis without overriding other
109
119
instructions.
@@ -206,6 +216,7 @@ def create(
206
216
* ,
207
217
assistant_id : str ,
208
218
stream : Literal [True ],
219
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
209
220
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
210
221
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
211
222
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -239,6 +250,14 @@ def create(
239
250
events, terminating when the Run enters a terminal state with a `data: [DONE]`
240
251
message.
241
252
253
+ include: A list of additional fields to include in the response. Currently the only
254
+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
255
+ to fetch the file search result content.
256
+
257
+ See the
258
+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
259
+ for more information.
260
+
242
261
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
243
262
is useful for modifying the behavior on a per-run basis without overriding other
244
263
instructions.
@@ -337,6 +356,7 @@ def create(
337
356
* ,
338
357
assistant_id : str ,
339
358
stream : bool ,
359
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
340
360
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
341
361
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
342
362
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -370,6 +390,14 @@ def create(
370
390
events, terminating when the Run enters a terminal state with a `data: [DONE]`
371
391
message.
372
392
393
+ include: A list of additional fields to include in the response. Currently the only
394
+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
395
+ to fetch the file search result content.
396
+
397
+ See the
398
+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
399
+ for more information.
400
+
373
401
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
374
402
is useful for modifying the behavior on a per-run basis without overriding other
375
403
instructions.
@@ -467,6 +495,7 @@ def create(
467
495
thread_id : str ,
468
496
* ,
469
497
assistant_id : str ,
498
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
470
499
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
471
500
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
472
501
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -516,7 +545,11 @@ def create(
516
545
run_create_params .RunCreateParams ,
517
546
),
518
547
options = make_request_options (
519
- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
548
+ extra_headers = extra_headers ,
549
+ extra_query = extra_query ,
550
+ extra_body = extra_body ,
551
+ timeout = timeout ,
552
+ query = maybe_transform ({"include" : include }, run_create_params .RunCreateParams ),
520
553
),
521
554
cast_to = Run ,
522
555
stream = stream or False ,
@@ -958,6 +991,7 @@ def stream(
958
991
self ,
959
992
* ,
960
993
assistant_id : str ,
994
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
961
995
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
962
996
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
963
997
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -988,6 +1022,7 @@ def stream(
988
1022
self ,
989
1023
* ,
990
1024
assistant_id : str ,
1025
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
991
1026
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
992
1027
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
993
1028
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1018,6 +1053,7 @@ def stream(
1018
1053
self ,
1019
1054
* ,
1020
1055
assistant_id : str ,
1056
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
1021
1057
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
1022
1058
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
1023
1059
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1057,6 +1093,7 @@ def stream(
1057
1093
body = maybe_transform (
1058
1094
{
1059
1095
"assistant_id" : assistant_id ,
1096
+ "include" : include ,
1060
1097
"additional_instructions" : additional_instructions ,
1061
1098
"additional_messages" : additional_messages ,
1062
1099
"instructions" : instructions ,
@@ -1417,6 +1454,14 @@ async def create(
1417
1454
[assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
1418
1455
execute this run.
1419
1456
1457
+ include: A list of additional fields to include in the response. Currently the only
1458
+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
1459
+ to fetch the file search result content.
1460
+
1461
+ See the
1462
+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1463
+ for more information.
1464
+
1420
1465
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
1421
1466
is useful for modifying the behavior on a per-run basis without overriding other
1422
1467
instructions.
@@ -1519,6 +1564,7 @@ async def create(
1519
1564
* ,
1520
1565
assistant_id : str ,
1521
1566
stream : Literal [True ],
1567
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
1522
1568
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
1523
1569
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
1524
1570
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1552,6 +1598,14 @@ async def create(
1552
1598
events, terminating when the Run enters a terminal state with a `data: [DONE]`
1553
1599
message.
1554
1600
1601
+ include: A list of additional fields to include in the response. Currently the only
1602
+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
1603
+ to fetch the file search result content.
1604
+
1605
+ See the
1606
+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1607
+ for more information.
1608
+
1555
1609
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
1556
1610
is useful for modifying the behavior on a per-run basis without overriding other
1557
1611
instructions.
@@ -1650,6 +1704,7 @@ async def create(
1650
1704
* ,
1651
1705
assistant_id : str ,
1652
1706
stream : bool ,
1707
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
1653
1708
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
1654
1709
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
1655
1710
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1683,6 +1738,14 @@ async def create(
1683
1738
events, terminating when the Run enters a terminal state with a `data: [DONE]`
1684
1739
message.
1685
1740
1741
+ include: A list of additional fields to include in the response. Currently the only
1742
+ supported value is `step_details.tool_calls[*].file_search.results[*].content`
1743
+ to fetch the file search result content.
1744
+
1745
+ See the
1746
+ [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1747
+ for more information.
1748
+
1686
1749
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
1687
1750
is useful for modifying the behavior on a per-run basis without overriding other
1688
1751
instructions.
@@ -1780,6 +1843,7 @@ async def create(
1780
1843
thread_id : str ,
1781
1844
* ,
1782
1845
assistant_id : str ,
1846
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
1783
1847
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
1784
1848
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
1785
1849
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1829,7 +1893,11 @@ async def create(
1829
1893
run_create_params .RunCreateParams ,
1830
1894
),
1831
1895
options = make_request_options (
1832
- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1896
+ extra_headers = extra_headers ,
1897
+ extra_query = extra_query ,
1898
+ extra_body = extra_body ,
1899
+ timeout = timeout ,
1900
+ query = await async_maybe_transform ({"include" : include }, run_create_params .RunCreateParams ),
1833
1901
),
1834
1902
cast_to = Run ,
1835
1903
stream = stream or False ,
0 commit comments