@@ -258,6 +258,7 @@ export type AssistantStreamEvent =
258
258
| AssistantStreamEvent . ThreadRunInProgress
259
259
| AssistantStreamEvent . ThreadRunRequiresAction
260
260
| AssistantStreamEvent . ThreadRunCompleted
261
+ | AssistantStreamEvent . ThreadRunIncomplete
261
262
| AssistantStreamEvent . ThreadRunFailed
262
263
| AssistantStreamEvent . ThreadRunCancelling
263
264
| AssistantStreamEvent . ThreadRunCancelled
@@ -362,6 +363,20 @@ export namespace AssistantStreamEvent {
362
363
event : 'thread.run.completed' ;
363
364
}
364
365
366
+ /**
367
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
368
+ * ends with status `incomplete`.
369
+ */
370
+ export interface ThreadRunIncomplete {
371
+ /**
372
+ * Represents an execution run on a
373
+ * [thread](https://platform.openai.com/docs/api-reference/threads).
374
+ */
375
+ data : RunsAPI . Run ;
376
+
377
+ event : 'thread.run.incomplete' ;
378
+ }
379
+
365
380
/**
366
381
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
367
382
* fails.
@@ -618,6 +633,30 @@ export interface FileSearchTool {
618
633
* The type of tool being defined: `file_search`
619
634
*/
620
635
type : 'file_search' ;
636
+
637
+ /**
638
+ * Overrides for the file search tool.
639
+ */
640
+ file_search ?: FileSearchTool . FileSearch ;
641
+ }
642
+
643
+ export namespace FileSearchTool {
644
+ /**
645
+ * Overrides for the file search tool.
646
+ */
647
+ export interface FileSearch {
648
+ /**
649
+ * The maximum number of results the file search tool should output. The default is
650
+ * 20 for gpt-4\* models and 5 for gpt-3.5-turbo. This number should be between 1
651
+ * and 50 inclusive.
652
+ *
653
+ * Note that the file search tool may output fewer than `max_num_results` results.
654
+ * See the
655
+ * [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/number-of-chunks-returned)
656
+ * for more information.
657
+ */
658
+ max_num_results ?: number ;
659
+ }
621
660
}
622
661
623
662
export interface FunctionTool {
@@ -843,6 +882,7 @@ export type RunStreamEvent =
843
882
| RunStreamEvent . ThreadRunInProgress
844
883
| RunStreamEvent . ThreadRunRequiresAction
845
884
| RunStreamEvent . ThreadRunCompleted
885
+ | RunStreamEvent . ThreadRunIncomplete
846
886
| RunStreamEvent . ThreadRunFailed
847
887
| RunStreamEvent . ThreadRunCancelling
848
888
| RunStreamEvent . ThreadRunCancelled
@@ -919,6 +959,20 @@ export namespace RunStreamEvent {
919
959
event : 'thread.run.completed' ;
920
960
}
921
961
962
+ /**
963
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
964
+ * ends with status `incomplete`.
965
+ */
966
+ export interface ThreadRunIncomplete {
967
+ /**
968
+ * Represents an execution run on a
969
+ * [thread](https://platform.openai.com/docs/api-reference/threads).
970
+ */
971
+ data : RunsAPI . Run ;
972
+
973
+ event : 'thread.run.incomplete' ;
974
+ }
975
+
922
976
/**
923
977
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
924
978
* fails.
@@ -1140,6 +1194,12 @@ export namespace AssistantCreateParams {
1140
1194
1141
1195
export namespace FileSearch {
1142
1196
export interface VectorStore {
1197
+ /**
1198
+ * The chunking strategy used to chunk the file(s). If not set, will use the `auto`
1199
+ * strategy.
1200
+ */
1201
+ chunking_strategy ?: VectorStore . Auto | VectorStore . Static ;
1202
+
1143
1203
/**
1144
1204
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
1145
1205
* add to the vector store. There can be a maximum of 10000 files in a vector
@@ -1155,6 +1215,45 @@ export namespace AssistantCreateParams {
1155
1215
*/
1156
1216
metadata ?: unknown ;
1157
1217
}
1218
+
1219
+ export namespace VectorStore {
1220
+ /**
1221
+ * The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
1222
+ * `800` and `chunk_overlap_tokens` of `400`.
1223
+ */
1224
+ export interface Auto {
1225
+ /**
1226
+ * Always `auto`.
1227
+ */
1228
+ type : 'auto' ;
1229
+ }
1230
+
1231
+ export interface Static {
1232
+ static : Static . Static ;
1233
+
1234
+ /**
1235
+ * Always `static`.
1236
+ */
1237
+ type : 'static' ;
1238
+ }
1239
+
1240
+ export namespace Static {
1241
+ export interface Static {
1242
+ /**
1243
+ * The number of tokens that overlap between chunks. The default value is `400`.
1244
+ *
1245
+ * Note that the overlap must not exceed half of `max_chunk_size_tokens`.
1246
+ */
1247
+ chunk_overlap_tokens : number ;
1248
+
1249
+ /**
1250
+ * The maximum number of tokens in each chunk. The default value is `800`. The
1251
+ * minimum value is `100` and the maximum value is `4096`.
1252
+ */
1253
+ max_chunk_size_tokens : number ;
1254
+ }
1255
+ }
1256
+ }
1158
1257
}
1159
1258
}
1160
1259
}
0 commit comments