2
2
3
3
from __future__ import annotations
4
4
5
- from typing import Union , Iterable , Optional , overload
5
+ from typing import List , Union , Iterable , Optional , overload
6
6
from typing_extensions import Literal
7
7
8
8
import httpx
38
38
from .....types .beta .threads .run import Run
39
39
from .....types .beta .assistant_tool_param import AssistantToolParam
40
40
from .....types .beta .assistant_stream_event import AssistantStreamEvent
41
+ from .....types .beta .threads .runs .run_step_include import RunStepInclude
41
42
from .....types .beta .assistant_tool_choice_option_param import AssistantToolChoiceOptionParam
42
43
from .....types .beta .assistant_response_format_option_param import AssistantResponseFormatOptionParam
43
44
@@ -63,6 +64,7 @@ def create(
63
64
thread_id : str ,
64
65
* ,
65
66
assistant_id : str ,
67
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
66
68
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
67
69
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
68
70
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -93,6 +95,14 @@ def create(
93
95
[assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
94
96
execute this run.
95
97
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
+
96
106
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
97
107
is useful for modifying the behavior on a per-run basis without overriding other
98
108
instructions.
@@ -195,6 +205,7 @@ def create(
195
205
* ,
196
206
assistant_id : str ,
197
207
stream : Literal [True ],
208
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
198
209
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
199
210
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
200
211
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -228,6 +239,14 @@ def create(
228
239
events, terminating when the Run enters a terminal state with a `data: [DONE]`
229
240
message.
230
241
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
+
231
250
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
232
251
is useful for modifying the behavior on a per-run basis without overriding other
233
252
instructions.
@@ -326,6 +345,7 @@ def create(
326
345
* ,
327
346
assistant_id : str ,
328
347
stream : bool ,
348
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
329
349
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
330
350
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
331
351
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -359,6 +379,14 @@ def create(
359
379
events, terminating when the Run enters a terminal state with a `data: [DONE]`
360
380
message.
361
381
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
+
362
390
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
363
391
is useful for modifying the behavior on a per-run basis without overriding other
364
392
instructions.
@@ -456,6 +484,7 @@ def create(
456
484
thread_id : str ,
457
485
* ,
458
486
assistant_id : str ,
487
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
459
488
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
460
489
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
461
490
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -505,7 +534,11 @@ def create(
505
534
run_create_params .RunCreateParams ,
506
535
),
507
536
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 ),
509
542
),
510
543
cast_to = Run ,
511
544
stream = stream or False ,
@@ -868,6 +901,7 @@ async def create(
868
901
thread_id : str ,
869
902
* ,
870
903
assistant_id : str ,
904
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
871
905
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
872
906
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
873
907
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -898,6 +932,14 @@ async def create(
898
932
[assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
899
933
execute this run.
900
934
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
+
901
943
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
902
944
is useful for modifying the behavior on a per-run basis without overriding other
903
945
instructions.
@@ -1000,6 +1042,7 @@ async def create(
1000
1042
* ,
1001
1043
assistant_id : str ,
1002
1044
stream : Literal [True ],
1045
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
1003
1046
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
1004
1047
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
1005
1048
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1033,6 +1076,14 @@ async def create(
1033
1076
events, terminating when the Run enters a terminal state with a `data: [DONE]`
1034
1077
message.
1035
1078
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
+
1036
1087
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
1037
1088
is useful for modifying the behavior on a per-run basis without overriding other
1038
1089
instructions.
@@ -1131,6 +1182,7 @@ async def create(
1131
1182
* ,
1132
1183
assistant_id : str ,
1133
1184
stream : bool ,
1185
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
1134
1186
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
1135
1187
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
1136
1188
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1164,6 +1216,14 @@ async def create(
1164
1216
events, terminating when the Run enters a terminal state with a `data: [DONE]`
1165
1217
message.
1166
1218
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
+
1167
1227
additional_instructions: Appends additional instructions at the end of the instructions for the run. This
1168
1228
is useful for modifying the behavior on a per-run basis without overriding other
1169
1229
instructions.
@@ -1261,6 +1321,7 @@ async def create(
1261
1321
thread_id : str ,
1262
1322
* ,
1263
1323
assistant_id : str ,
1324
+ include : List [RunStepInclude ] | NotGiven = NOT_GIVEN ,
1264
1325
additional_instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
1265
1326
additional_messages : Optional [Iterable [run_create_params .AdditionalMessage ]] | NotGiven = NOT_GIVEN ,
1266
1327
instructions : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -1310,7 +1371,11 @@ async def create(
1310
1371
run_create_params .RunCreateParams ,
1311
1372
),
1312
1373
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 ),
1314
1379
),
1315
1380
cast_to = Run ,
1316
1381
stream = stream or False ,
0 commit comments