|
3 | 3 | from __future__ import annotations
|
4 | 4 |
|
5 | 5 | from typing import List, Union, Iterable, Optional
|
6 |
| -from typing_extensions import Literal, Required, TypeAlias, TypedDict |
| 6 | +from typing_extensions import Required, TypedDict |
7 | 7 |
|
8 | 8 | from ..chat_model import ChatModel
|
9 | 9 | from .assistant_tool_param import AssistantToolParam
|
| 10 | +from .file_chunking_strategy_param import FileChunkingStrategyParam |
10 | 11 | from .assistant_response_format_option_param import AssistantResponseFormatOptionParam
|
11 | 12 |
|
12 | 13 | __all__ = [
|
|
15 | 16 | "ToolResourcesCodeInterpreter",
|
16 | 17 | "ToolResourcesFileSearch",
|
17 | 18 | "ToolResourcesFileSearchVectorStore",
|
18 |
| - "ToolResourcesFileSearchVectorStoreChunkingStrategy", |
19 |
| - "ToolResourcesFileSearchVectorStoreChunkingStrategyAuto", |
20 |
| - "ToolResourcesFileSearchVectorStoreChunkingStrategyStatic", |
21 |
| - "ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic", |
22 | 19 | ]
|
23 | 20 |
|
24 | 21 |
|
@@ -118,43 +115,12 @@ class ToolResourcesCodeInterpreter(TypedDict, total=False):
|
118 | 115 | """
|
119 | 116 |
|
120 | 117 |
|
121 |
| -class ToolResourcesFileSearchVectorStoreChunkingStrategyAuto(TypedDict, total=False): |
122 |
| - type: Required[Literal["auto"]] |
123 |
| - """Always `auto`.""" |
124 |
| - |
125 |
| - |
126 |
| -class ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic(TypedDict, total=False): |
127 |
| - chunk_overlap_tokens: Required[int] |
128 |
| - """The number of tokens that overlap between chunks. The default value is `400`. |
129 |
| -
|
130 |
| - Note that the overlap must not exceed half of `max_chunk_size_tokens`. |
131 |
| - """ |
132 |
| - |
133 |
| - max_chunk_size_tokens: Required[int] |
134 |
| - """The maximum number of tokens in each chunk. |
135 |
| -
|
136 |
| - The default value is `800`. The minimum value is `100` and the maximum value is |
137 |
| - `4096`. |
138 |
| - """ |
139 |
| - |
140 |
| - |
141 |
| -class ToolResourcesFileSearchVectorStoreChunkingStrategyStatic(TypedDict, total=False): |
142 |
| - static: Required[ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic] |
143 |
| - |
144 |
| - type: Required[Literal["static"]] |
145 |
| - """Always `static`.""" |
146 |
| - |
147 |
| - |
148 |
| -ToolResourcesFileSearchVectorStoreChunkingStrategy: TypeAlias = Union[ |
149 |
| - ToolResourcesFileSearchVectorStoreChunkingStrategyAuto, ToolResourcesFileSearchVectorStoreChunkingStrategyStatic |
150 |
| -] |
151 |
| - |
152 |
| - |
153 | 118 | class ToolResourcesFileSearchVectorStore(TypedDict, total=False):
|
154 |
| - chunking_strategy: ToolResourcesFileSearchVectorStoreChunkingStrategy |
| 119 | + chunking_strategy: FileChunkingStrategyParam |
155 | 120 | """The chunking strategy used to chunk the file(s).
|
156 | 121 |
|
157 |
| - If not set, will use the `auto` strategy. |
| 122 | + If not set, will use the `auto` strategy. Only applicable if `file_ids` is |
| 123 | + non-empty. |
158 | 124 | """
|
159 | 125 |
|
160 | 126 | file_ids: List[str]
|
|
0 commit comments