agentlin-client 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of agentlin-client might be problematic. Click here for more details.
- agentlin_client/__init__.py +90 -0
- agentlin_client/_base_client.py +1995 -0
- agentlin_client/_client.py +403 -0
- agentlin_client/_compat.py +219 -0
- agentlin_client/_constants.py +14 -0
- agentlin_client/_exceptions.py +108 -0
- agentlin_client/_files.py +123 -0
- agentlin_client/_models.py +835 -0
- agentlin_client/_qs.py +150 -0
- agentlin_client/_resource.py +43 -0
- agentlin_client/_response.py +832 -0
- agentlin_client/_streaming.py +333 -0
- agentlin_client/_types.py +260 -0
- agentlin_client/_utils/__init__.py +64 -0
- agentlin_client/_utils/_compat.py +45 -0
- agentlin_client/_utils/_datetime_parse.py +136 -0
- agentlin_client/_utils/_logs.py +25 -0
- agentlin_client/_utils/_proxy.py +65 -0
- agentlin_client/_utils/_reflection.py +42 -0
- agentlin_client/_utils/_resources_proxy.py +24 -0
- agentlin_client/_utils/_streams.py +12 -0
- agentlin_client/_utils/_sync.py +86 -0
- agentlin_client/_utils/_transform.py +457 -0
- agentlin_client/_utils/_typing.py +156 -0
- agentlin_client/_utils/_utils.py +421 -0
- agentlin_client/_version.py +4 -0
- agentlin_client/lib/.keep +4 -0
- agentlin_client/py.typed +0 -0
- agentlin_client/resources/__init__.py +33 -0
- agentlin_client/resources/conversations/__init__.py +33 -0
- agentlin_client/resources/conversations/conversations.py +489 -0
- agentlin_client/resources/conversations/items.py +558 -0
- agentlin_client/resources/responses.py +1136 -0
- agentlin_client/types/__init__.py +22 -0
- agentlin_client/types/conversation_create_params.py +28 -0
- agentlin_client/types/conversation_delete_response.py +15 -0
- agentlin_client/types/conversation_update_params.py +20 -0
- agentlin_client/types/conversations/__init__.py +74 -0
- agentlin_client/types/conversations/code_interpreter_tool_call.py +55 -0
- agentlin_client/types/conversations/code_interpreter_tool_call_param.py +54 -0
- agentlin_client/types/conversations/computer_screenshot_image.py +22 -0
- agentlin_client/types/conversations/computer_screenshot_image_param.py +21 -0
- agentlin_client/types/conversations/computer_tool_call.py +201 -0
- agentlin_client/types/conversations/computer_tool_call_output_resource.py +37 -0
- agentlin_client/types/conversations/computer_tool_call_param.py +199 -0
- agentlin_client/types/conversations/computer_tool_call_safety_check.py +16 -0
- agentlin_client/types/conversations/computer_tool_call_safety_check_param.py +18 -0
- agentlin_client/types/conversations/conversation_item.py +133 -0
- agentlin_client/types/conversations/conversation_item_list.py +26 -0
- agentlin_client/types/conversations/conversation_resource.py +32 -0
- agentlin_client/types/conversations/custom_tool_call.py +25 -0
- agentlin_client/types/conversations/custom_tool_call_output.py +26 -0
- agentlin_client/types/conversations/custom_tool_call_output_param.py +27 -0
- agentlin_client/types/conversations/custom_tool_call_param.py +24 -0
- agentlin_client/types/conversations/easy_input_message.py +26 -0
- agentlin_client/types/conversations/easy_input_message_param.py +27 -0
- agentlin_client/types/conversations/file_search_tool_call.py +42 -0
- agentlin_client/types/conversations/file_search_tool_call_param.py +44 -0
- agentlin_client/types/conversations/function_and_custom_tool_call_output.py +15 -0
- agentlin_client/types/conversations/function_and_custom_tool_call_output_param.py +16 -0
- agentlin_client/types/conversations/function_call_item_status.py +7 -0
- agentlin_client/types/conversations/function_tool_call.py +32 -0
- agentlin_client/types/conversations/function_tool_call_output_resource.py +33 -0
- agentlin_client/types/conversations/function_tool_call_param.py +31 -0
- agentlin_client/types/conversations/function_tool_call_resource.py +10 -0
- agentlin_client/types/conversations/image_gen_tool_call.py +22 -0
- agentlin_client/types/conversations/image_gen_tool_call_param.py +22 -0
- agentlin_client/types/conversations/includable.py +14 -0
- agentlin_client/types/conversations/input_content.py +32 -0
- agentlin_client/types/conversations/input_content_param.py +30 -0
- agentlin_client/types/conversations/input_file_content.py +25 -0
- agentlin_client/types/conversations/input_file_content_param.py +25 -0
- agentlin_client/types/conversations/input_image_content.py +28 -0
- agentlin_client/types/conversations/input_image_content_param.py +28 -0
- agentlin_client/types/conversations/input_item.py +209 -0
- agentlin_client/types/conversations/input_item_param.py +203 -0
- agentlin_client/types/conversations/input_message.py +30 -0
- agentlin_client/types/conversations/input_message_param.py +31 -0
- agentlin_client/types/conversations/input_text_content.py +15 -0
- agentlin_client/types/conversations/input_text_content_param.py +15 -0
- agentlin_client/types/conversations/item_create_params.py +24 -0
- agentlin_client/types/conversations/item_list_params.py +50 -0
- agentlin_client/types/conversations/item_retrieve_params.py +22 -0
- agentlin_client/types/conversations/local_shell_tool_call.py +45 -0
- agentlin_client/types/conversations/local_shell_tool_call_output.py +22 -0
- agentlin_client/types/conversations/local_shell_tool_call_output_param.py +22 -0
- agentlin_client/types/conversations/local_shell_tool_call_param.py +47 -0
- agentlin_client/types/conversations/mcp_approval_request.py +24 -0
- agentlin_client/types/conversations/mcp_approval_request_param.py +24 -0
- agentlin_client/types/conversations/mcp_approval_response_resource.py +25 -0
- agentlin_client/types/conversations/mcp_list_tools.py +39 -0
- agentlin_client/types/conversations/mcp_list_tools_param.py +39 -0
- agentlin_client/types/conversations/mcp_tool_call.py +44 -0
- agentlin_client/types/conversations/mcp_tool_call_param.py +44 -0
- agentlin_client/types/conversations/output_message.py +34 -0
- agentlin_client/types/conversations/output_message_param.py +34 -0
- agentlin_client/types/conversations/output_text_content.py +117 -0
- agentlin_client/types/conversations/output_text_content_param.py +115 -0
- agentlin_client/types/conversations/reasoning_item.py +44 -0
- agentlin_client/types/conversations/reasoning_item_param.py +45 -0
- agentlin_client/types/conversations/reasoning_text_content.py +15 -0
- agentlin_client/types/conversations/reasoning_text_content_param.py +15 -0
- agentlin_client/types/conversations/refusal_content.py +15 -0
- agentlin_client/types/conversations/refusal_content_param.py +15 -0
- agentlin_client/types/conversations/web_search_tool_call.py +67 -0
- agentlin_client/types/conversations/web_search_tool_call_param.py +66 -0
- agentlin_client/types/mcp_tool_filter.py +20 -0
- agentlin_client/types/mcp_tool_filter_param.py +22 -0
- agentlin_client/types/model_response_properties_standard.py +87 -0
- agentlin_client/types/response.py +166 -0
- agentlin_client/types/response_create_params.py +497 -0
- agentlin_client/types/response_list_input_items_params.py +34 -0
- agentlin_client/types/response_list_input_items_response.py +70 -0
- agentlin_client/types/response_properties.py +328 -0
- agentlin_client/types/response_retrieve_params.py +42 -0
- agentlin_client/types/response_tool.py +495 -0
- agentlin_client/types/response_tool_param.py +491 -0
- agentlin_client/types/text_response_format_configuration.py +59 -0
- agentlin_client/types/text_response_format_configuration_param.py +54 -0
- agentlin_client-0.1.0.dist-info/METADATA +429 -0
- agentlin_client-0.1.0.dist-info/RECORD +123 -0
- agentlin_client-0.1.0.dist-info/WHEEL +4 -0
- agentlin_client-0.1.0.dist-info/licenses/LICENSE +7 -0
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Union, Iterable, Optional
|
|
6
|
+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .mcp_tool_filter_param import McpToolFilterParam
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"ResponseToolParam",
|
|
13
|
+
"Function",
|
|
14
|
+
"FileSearch",
|
|
15
|
+
"FileSearchFilters",
|
|
16
|
+
"FileSearchFiltersComparisonFilter",
|
|
17
|
+
"FileSearchFiltersCompoundFilter",
|
|
18
|
+
"FileSearchFiltersCompoundFilterFilter",
|
|
19
|
+
"FileSearchFiltersCompoundFilterFilterComparisonFilter",
|
|
20
|
+
"FileSearchRankingOptions",
|
|
21
|
+
"ComputerUsePreview",
|
|
22
|
+
"WebSearchTool",
|
|
23
|
+
"WebSearchToolFilters",
|
|
24
|
+
"WebSearchToolUserLocation",
|
|
25
|
+
"Mcp",
|
|
26
|
+
"McpAllowedTools",
|
|
27
|
+
"McpRequireApproval",
|
|
28
|
+
"McpRequireApprovalMcpToolApprovalFilter",
|
|
29
|
+
"CodeInterpreter",
|
|
30
|
+
"CodeInterpreterContainer",
|
|
31
|
+
"CodeInterpreterContainerCodeInterpreterToolAuto",
|
|
32
|
+
"ImageGeneration",
|
|
33
|
+
"ImageGenerationInputImageMask",
|
|
34
|
+
"LocalShell",
|
|
35
|
+
"Custom",
|
|
36
|
+
"CustomFormat",
|
|
37
|
+
"CustomFormatText",
|
|
38
|
+
"CustomFormatGrammar",
|
|
39
|
+
"WebSearchPreviewTool",
|
|
40
|
+
"WebSearchPreviewToolUserLocation",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class Function(TypedDict, total=False):
|
|
45
|
+
name: Required[str]
|
|
46
|
+
"""The name of the function to call."""
|
|
47
|
+
|
|
48
|
+
parameters: Required[Optional[Dict[str, object]]]
|
|
49
|
+
"""A JSON schema object describing the parameters of the function."""
|
|
50
|
+
|
|
51
|
+
strict: Required[Optional[bool]]
|
|
52
|
+
"""Whether to enforce strict parameter validation. Default `true`."""
|
|
53
|
+
|
|
54
|
+
type: Required[Literal["function"]]
|
|
55
|
+
"""The type of the function tool. Always `function`."""
|
|
56
|
+
|
|
57
|
+
description: Optional[str]
|
|
58
|
+
"""A description of the function.
|
|
59
|
+
|
|
60
|
+
Used by the model to determine whether or not to call the function.
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class FileSearchFiltersComparisonFilter(TypedDict, total=False):
|
|
65
|
+
key: Required[str]
|
|
66
|
+
"""The key to compare against the value."""
|
|
67
|
+
|
|
68
|
+
type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte"]]
|
|
69
|
+
"""
|
|
70
|
+
Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`,
|
|
71
|
+
`nin`.
|
|
72
|
+
|
|
73
|
+
- `eq`: equals
|
|
74
|
+
- `ne`: not equal
|
|
75
|
+
- `gt`: greater than
|
|
76
|
+
- `gte`: greater than or equal
|
|
77
|
+
- `lt`: less than
|
|
78
|
+
- `lte`: less than or equal
|
|
79
|
+
- `in`: in
|
|
80
|
+
- `nin`: not in
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
value: Required[Union[str, float, bool, SequenceNotStr[Union[str, float]]]]
|
|
84
|
+
"""
|
|
85
|
+
The value to compare against the attribute key; supports string, number, or
|
|
86
|
+
boolean types.
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class FileSearchFiltersCompoundFilterFilterComparisonFilter(TypedDict, total=False):
|
|
91
|
+
key: Required[str]
|
|
92
|
+
"""The key to compare against the value."""
|
|
93
|
+
|
|
94
|
+
type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte"]]
|
|
95
|
+
"""
|
|
96
|
+
Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`,
|
|
97
|
+
`nin`.
|
|
98
|
+
|
|
99
|
+
- `eq`: equals
|
|
100
|
+
- `ne`: not equal
|
|
101
|
+
- `gt`: greater than
|
|
102
|
+
- `gte`: greater than or equal
|
|
103
|
+
- `lt`: less than
|
|
104
|
+
- `lte`: less than or equal
|
|
105
|
+
- `in`: in
|
|
106
|
+
- `nin`: not in
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
value: Required[Union[str, float, bool, SequenceNotStr[Union[str, float]]]]
|
|
110
|
+
"""
|
|
111
|
+
The value to compare against the attribute key; supports string, number, or
|
|
112
|
+
boolean types.
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
FileSearchFiltersCompoundFilterFilter: TypeAlias = Union[FileSearchFiltersCompoundFilterFilterComparisonFilter, object]
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class FileSearchFiltersCompoundFilter(TypedDict, total=False):
|
|
120
|
+
filters: Required[Iterable[FileSearchFiltersCompoundFilterFilter]]
|
|
121
|
+
"""Array of filters to combine.
|
|
122
|
+
|
|
123
|
+
Items can be `ComparisonFilter` or `CompoundFilter`.
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
type: Required[Literal["and", "or"]]
|
|
127
|
+
"""Type of operation: `and` or `or`."""
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
FileSearchFilters: TypeAlias = Union[FileSearchFiltersComparisonFilter, FileSearchFiltersCompoundFilter]
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
class FileSearchRankingOptions(TypedDict, total=False):
|
|
134
|
+
ranker: Literal["auto", "default-2024-11-15"]
|
|
135
|
+
"""The ranker to use for the file search."""
|
|
136
|
+
|
|
137
|
+
score_threshold: float
|
|
138
|
+
"""The score threshold for the file search, a number between 0 and 1.
|
|
139
|
+
|
|
140
|
+
Numbers closer to 1 will attempt to return only the most relevant results, but
|
|
141
|
+
may return fewer results.
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class FileSearch(TypedDict, total=False):
|
|
146
|
+
type: Required[Literal["file_search"]]
|
|
147
|
+
"""The type of the file search tool. Always `file_search`."""
|
|
148
|
+
|
|
149
|
+
vector_store_ids: Required[SequenceNotStr[str]]
|
|
150
|
+
"""The IDs of the vector stores to search."""
|
|
151
|
+
|
|
152
|
+
filters: Optional[FileSearchFilters]
|
|
153
|
+
"""A filter to apply."""
|
|
154
|
+
|
|
155
|
+
max_num_results: int
|
|
156
|
+
"""The maximum number of results to return.
|
|
157
|
+
|
|
158
|
+
This number should be between 1 and 50 inclusive.
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
ranking_options: FileSearchRankingOptions
|
|
162
|
+
"""Ranking options for search."""
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
class ComputerUsePreview(TypedDict, total=False):
|
|
166
|
+
display_height: Required[int]
|
|
167
|
+
"""The height of the computer display."""
|
|
168
|
+
|
|
169
|
+
display_width: Required[int]
|
|
170
|
+
"""The width of the computer display."""
|
|
171
|
+
|
|
172
|
+
environment: Required[Literal["windows", "mac", "linux", "ubuntu", "browser"]]
|
|
173
|
+
"""The type of computer environment to control."""
|
|
174
|
+
|
|
175
|
+
type: Required[Literal["computer_use_preview"]]
|
|
176
|
+
"""The type of the computer use tool. Always `computer_use_preview`."""
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class WebSearchToolFilters(TypedDict, total=False):
|
|
180
|
+
allowed_domains: Optional[SequenceNotStr[str]]
|
|
181
|
+
"""Allowed domains for the search.
|
|
182
|
+
|
|
183
|
+
If not provided, all domains are allowed. Subdomains of the provided domains are
|
|
184
|
+
allowed as well.
|
|
185
|
+
|
|
186
|
+
Example: `["pubmed.ncbi.nlm.nih.gov"]`
|
|
187
|
+
"""
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class WebSearchToolUserLocation(TypedDict, total=False):
|
|
191
|
+
city: Optional[str]
|
|
192
|
+
"""Free text input for the city of the user, e.g. `San Francisco`."""
|
|
193
|
+
|
|
194
|
+
country: Optional[str]
|
|
195
|
+
"""
|
|
196
|
+
The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of
|
|
197
|
+
the user, e.g. `US`.
|
|
198
|
+
"""
|
|
199
|
+
|
|
200
|
+
region: Optional[str]
|
|
201
|
+
"""Free text input for the region of the user, e.g. `California`."""
|
|
202
|
+
|
|
203
|
+
timezone: Optional[str]
|
|
204
|
+
"""
|
|
205
|
+
The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the
|
|
206
|
+
user, e.g. `America/Los_Angeles`.
|
|
207
|
+
"""
|
|
208
|
+
|
|
209
|
+
type: Literal["approximate"]
|
|
210
|
+
"""The type of location approximation. Always `approximate`."""
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class WebSearchTool(TypedDict, total=False):
|
|
214
|
+
type: Required[Literal["web_search", "web_search_2025_08_26"]]
|
|
215
|
+
"""The type of the web search tool.
|
|
216
|
+
|
|
217
|
+
One of `web_search` or `web_search_2025_08_26`.
|
|
218
|
+
"""
|
|
219
|
+
|
|
220
|
+
filters: Optional[WebSearchToolFilters]
|
|
221
|
+
"""Filters for the search."""
|
|
222
|
+
|
|
223
|
+
search_context_size: Literal["low", "medium", "high"]
|
|
224
|
+
"""High level guidance for the amount of context window space to use for the
|
|
225
|
+
search.
|
|
226
|
+
|
|
227
|
+
One of `low`, `medium`, or `high`. `medium` is the default.
|
|
228
|
+
"""
|
|
229
|
+
|
|
230
|
+
user_location: Optional[WebSearchToolUserLocation]
|
|
231
|
+
"""The approximate location of the user."""
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
McpAllowedTools: TypeAlias = Union[SequenceNotStr[str], McpToolFilterParam]
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
class McpRequireApprovalMcpToolApprovalFilter(TypedDict, total=False):
|
|
238
|
+
always: McpToolFilterParam
|
|
239
|
+
"""A filter object to specify which tools are allowed."""
|
|
240
|
+
|
|
241
|
+
never: McpToolFilterParam
|
|
242
|
+
"""A filter object to specify which tools are allowed."""
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
McpRequireApproval: TypeAlias = Union[McpRequireApprovalMcpToolApprovalFilter, Literal["always", "never"]]
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
class Mcp(TypedDict, total=False):
|
|
249
|
+
server_label: Required[str]
|
|
250
|
+
"""A label for this MCP server, used to identify it in tool calls."""
|
|
251
|
+
|
|
252
|
+
type: Required[Literal["mcp"]]
|
|
253
|
+
"""The type of the MCP tool. Always `mcp`."""
|
|
254
|
+
|
|
255
|
+
allowed_tools: Optional[McpAllowedTools]
|
|
256
|
+
"""List of allowed tool names or a filter object."""
|
|
257
|
+
|
|
258
|
+
authorization: str
|
|
259
|
+
"""
|
|
260
|
+
An OAuth access token that can be used with a remote MCP server, either with a
|
|
261
|
+
custom MCP server URL or a service connector. Your application must handle the
|
|
262
|
+
OAuth authorization flow and provide the token here.
|
|
263
|
+
"""
|
|
264
|
+
|
|
265
|
+
connector_id: Literal[
|
|
266
|
+
"connector_dropbox",
|
|
267
|
+
"connector_gmail",
|
|
268
|
+
"connector_googlecalendar",
|
|
269
|
+
"connector_googledrive",
|
|
270
|
+
"connector_microsoftteams",
|
|
271
|
+
"connector_outlookcalendar",
|
|
272
|
+
"connector_outlookemail",
|
|
273
|
+
"connector_sharepoint",
|
|
274
|
+
]
|
|
275
|
+
"""Identifier for service connectors, like those available in ChatGPT.
|
|
276
|
+
|
|
277
|
+
One of `server_url` or `connector_id` must be provided. Learn more about service
|
|
278
|
+
connectors
|
|
279
|
+
[here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
|
|
280
|
+
|
|
281
|
+
Currently supported `connector_id` values are:
|
|
282
|
+
|
|
283
|
+
- Dropbox: `connector_dropbox`
|
|
284
|
+
- Gmail: `connector_gmail`
|
|
285
|
+
- Google Calendar: `connector_googlecalendar`
|
|
286
|
+
- Google Drive: `connector_googledrive`
|
|
287
|
+
- Microsoft Teams: `connector_microsoftteams`
|
|
288
|
+
- Outlook Calendar: `connector_outlookcalendar`
|
|
289
|
+
- Outlook Email: `connector_outlookemail`
|
|
290
|
+
- SharePoint: `connector_sharepoint`
|
|
291
|
+
"""
|
|
292
|
+
|
|
293
|
+
headers: Optional[Dict[str, str]]
|
|
294
|
+
"""Optional HTTP headers to send to the MCP server.
|
|
295
|
+
|
|
296
|
+
Use for authentication or other purposes.
|
|
297
|
+
"""
|
|
298
|
+
|
|
299
|
+
require_approval: Optional[McpRequireApproval]
|
|
300
|
+
"""Specify which of the MCP server's tools require approval."""
|
|
301
|
+
|
|
302
|
+
server_description: str
|
|
303
|
+
"""Optional description of the MCP server, used to provide more context."""
|
|
304
|
+
|
|
305
|
+
server_url: str
|
|
306
|
+
"""The URL for the MCP server.
|
|
307
|
+
|
|
308
|
+
One of `server_url` or `connector_id` must be provided.
|
|
309
|
+
"""
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
class CodeInterpreterContainerCodeInterpreterToolAuto(TypedDict, total=False):
|
|
313
|
+
type: Required[Literal["auto"]]
|
|
314
|
+
"""Always `auto`."""
|
|
315
|
+
|
|
316
|
+
file_ids: SequenceNotStr[str]
|
|
317
|
+
"""An optional list of uploaded files to make available to your code."""
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
CodeInterpreterContainer: TypeAlias = Union[str, CodeInterpreterContainerCodeInterpreterToolAuto]
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
class CodeInterpreter(TypedDict, total=False):
|
|
324
|
+
container: Required[CodeInterpreterContainer]
|
|
325
|
+
"""The code interpreter container.
|
|
326
|
+
|
|
327
|
+
Can be a container ID or an object that specifies uploaded file IDs to make
|
|
328
|
+
available to your code.
|
|
329
|
+
"""
|
|
330
|
+
|
|
331
|
+
type: Required[Literal["code_interpreter"]]
|
|
332
|
+
"""The type of the code interpreter tool. Always `code_interpreter`."""
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
class ImageGenerationInputImageMask(TypedDict, total=False):
|
|
336
|
+
file_id: str
|
|
337
|
+
"""File ID for the mask image."""
|
|
338
|
+
|
|
339
|
+
image_url: str
|
|
340
|
+
"""Base64-encoded mask image."""
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
class ImageGeneration(TypedDict, total=False):
|
|
344
|
+
type: Required[Literal["image_generation"]]
|
|
345
|
+
"""The type of the image generation tool. Always `image_generation`."""
|
|
346
|
+
|
|
347
|
+
background: Literal["transparent", "opaque", "auto"]
|
|
348
|
+
"""Background type for the generated image.
|
|
349
|
+
|
|
350
|
+
One of `transparent`, `opaque`, or `auto`. Default: `auto`.
|
|
351
|
+
"""
|
|
352
|
+
|
|
353
|
+
input_fidelity: Optional[Literal["high", "low"]]
|
|
354
|
+
"""
|
|
355
|
+
Control how much effort the model will exert to match the style and features,
|
|
356
|
+
especially facial features, of input images. This parameter is only supported
|
|
357
|
+
for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and
|
|
358
|
+
`low`. Defaults to `low`.
|
|
359
|
+
"""
|
|
360
|
+
|
|
361
|
+
input_image_mask: ImageGenerationInputImageMask
|
|
362
|
+
"""Optional mask for inpainting.
|
|
363
|
+
|
|
364
|
+
Contains `image_url` (string, optional) and `file_id` (string, optional).
|
|
365
|
+
"""
|
|
366
|
+
|
|
367
|
+
model: Literal["gpt-image-1", "gpt-image-1-mini"]
|
|
368
|
+
"""The image generation model to use. Default: `gpt-image-1`."""
|
|
369
|
+
|
|
370
|
+
moderation: Literal["auto", "low"]
|
|
371
|
+
"""Moderation level for the generated image. Default: `auto`."""
|
|
372
|
+
|
|
373
|
+
output_compression: int
|
|
374
|
+
"""Compression level for the output image. Default: 100."""
|
|
375
|
+
|
|
376
|
+
output_format: Literal["png", "webp", "jpeg"]
|
|
377
|
+
"""The output format of the generated image.
|
|
378
|
+
|
|
379
|
+
One of `png`, `webp`, or `jpeg`. Default: `png`.
|
|
380
|
+
"""
|
|
381
|
+
|
|
382
|
+
partial_images: int
|
|
383
|
+
"""
|
|
384
|
+
Number of partial images to generate in streaming mode, from 0 (default value)
|
|
385
|
+
to 3.
|
|
386
|
+
"""
|
|
387
|
+
|
|
388
|
+
quality: Literal["low", "medium", "high", "auto"]
|
|
389
|
+
"""The quality of the generated image.
|
|
390
|
+
|
|
391
|
+
One of `low`, `medium`, `high`, or `auto`. Default: `auto`.
|
|
392
|
+
"""
|
|
393
|
+
|
|
394
|
+
size: Literal["1024x1024", "1024x1536", "1536x1024", "auto"]
|
|
395
|
+
"""The size of the generated image.
|
|
396
|
+
|
|
397
|
+
One of `1024x1024`, `1024x1536`, `1536x1024`, or `auto`. Default: `auto`.
|
|
398
|
+
"""
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
class LocalShell(TypedDict, total=False):
|
|
402
|
+
type: Required[Literal["local_shell"]]
|
|
403
|
+
"""The type of the local shell tool. Always `local_shell`."""
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
class CustomFormatText(TypedDict, total=False):
|
|
407
|
+
type: Required[Literal["text"]]
|
|
408
|
+
"""Unconstrained text format. Always `text`."""
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
class CustomFormatGrammar(TypedDict, total=False):
|
|
412
|
+
definition: Required[str]
|
|
413
|
+
"""The grammar definition."""
|
|
414
|
+
|
|
415
|
+
syntax: Required[Literal["lark", "regex"]]
|
|
416
|
+
"""The syntax of the grammar definition. One of `lark` or `regex`."""
|
|
417
|
+
|
|
418
|
+
type: Required[Literal["grammar"]]
|
|
419
|
+
"""Grammar format. Always `grammar`."""
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
CustomFormat: TypeAlias = Union[CustomFormatText, CustomFormatGrammar]
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
class Custom(TypedDict, total=False):
|
|
426
|
+
name: Required[str]
|
|
427
|
+
"""The name of the custom tool, used to identify it in tool calls."""
|
|
428
|
+
|
|
429
|
+
type: Required[Literal["custom"]]
|
|
430
|
+
"""The type of the custom tool. Always `custom`."""
|
|
431
|
+
|
|
432
|
+
description: str
|
|
433
|
+
"""Optional description of the custom tool, used to provide more context."""
|
|
434
|
+
|
|
435
|
+
format: CustomFormat
|
|
436
|
+
"""The input format for the custom tool. Default is unconstrained text."""
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
class WebSearchPreviewToolUserLocation(TypedDict, total=False):
|
|
440
|
+
type: Required[Literal["approximate"]]
|
|
441
|
+
"""The type of location approximation. Always `approximate`."""
|
|
442
|
+
|
|
443
|
+
city: Optional[str]
|
|
444
|
+
"""Free text input for the city of the user, e.g. `San Francisco`."""
|
|
445
|
+
|
|
446
|
+
country: Optional[str]
|
|
447
|
+
"""
|
|
448
|
+
The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of
|
|
449
|
+
the user, e.g. `US`.
|
|
450
|
+
"""
|
|
451
|
+
|
|
452
|
+
region: Optional[str]
|
|
453
|
+
"""Free text input for the region of the user, e.g. `California`."""
|
|
454
|
+
|
|
455
|
+
timezone: Optional[str]
|
|
456
|
+
"""
|
|
457
|
+
The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the
|
|
458
|
+
user, e.g. `America/Los_Angeles`.
|
|
459
|
+
"""
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
class WebSearchPreviewTool(TypedDict, total=False):
|
|
463
|
+
type: Required[Literal["web_search_preview", "web_search_preview_2025_03_11"]]
|
|
464
|
+
"""The type of the web search tool.
|
|
465
|
+
|
|
466
|
+
One of `web_search_preview` or `web_search_preview_2025_03_11`.
|
|
467
|
+
"""
|
|
468
|
+
|
|
469
|
+
search_context_size: Literal["low", "medium", "high"]
|
|
470
|
+
"""High level guidance for the amount of context window space to use for the
|
|
471
|
+
search.
|
|
472
|
+
|
|
473
|
+
One of `low`, `medium`, or `high`. `medium` is the default.
|
|
474
|
+
"""
|
|
475
|
+
|
|
476
|
+
user_location: Optional[WebSearchPreviewToolUserLocation]
|
|
477
|
+
"""The user's location."""
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
ResponseToolParam: TypeAlias = Union[
|
|
481
|
+
Function,
|
|
482
|
+
FileSearch,
|
|
483
|
+
ComputerUsePreview,
|
|
484
|
+
WebSearchTool,
|
|
485
|
+
Mcp,
|
|
486
|
+
CodeInterpreter,
|
|
487
|
+
ImageGeneration,
|
|
488
|
+
LocalShell,
|
|
489
|
+
Custom,
|
|
490
|
+
WebSearchPreviewTool,
|
|
491
|
+
]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, Union, Optional
|
|
4
|
+
from typing_extensions import Literal, Annotated, TypeAlias
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._utils import PropertyInfo
|
|
9
|
+
from .._models import BaseModel
|
|
10
|
+
|
|
11
|
+
__all__ = ["TextResponseFormatConfiguration", "Text", "JsonSchema", "JsonObject"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Text(BaseModel):
|
|
15
|
+
type: Literal["text"]
|
|
16
|
+
"""The type of response format being defined. Always `text`."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class JsonSchema(BaseModel):
|
|
20
|
+
name: str
|
|
21
|
+
"""The name of the response format.
|
|
22
|
+
|
|
23
|
+
Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length
|
|
24
|
+
of 64.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
schema_: Dict[str, object] = FieldInfo(alias="schema")
|
|
28
|
+
"""
|
|
29
|
+
The schema for the response format, described as a JSON Schema object. Learn how
|
|
30
|
+
to build JSON schemas [here](https://json-schema.org/).
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
type: Literal["json_schema"]
|
|
34
|
+
"""The type of response format being defined. Always `json_schema`."""
|
|
35
|
+
|
|
36
|
+
description: Optional[str] = None
|
|
37
|
+
"""
|
|
38
|
+
A description of what the response format is for, used by the model to determine
|
|
39
|
+
how to respond in the format.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
strict: Optional[bool] = None
|
|
43
|
+
"""
|
|
44
|
+
Whether to enable strict schema adherence when generating the output. If set to
|
|
45
|
+
true, the model will always follow the exact schema defined in the `schema`
|
|
46
|
+
field. Only a subset of JSON Schema is supported when `strict` is `true`. To
|
|
47
|
+
learn more, read the
|
|
48
|
+
[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class JsonObject(BaseModel):
|
|
53
|
+
type: Literal["json_object"]
|
|
54
|
+
"""The type of response format being defined. Always `json_object`."""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
TextResponseFormatConfiguration: TypeAlias = Annotated[
|
|
58
|
+
Union[Text, JsonSchema, JsonObject], PropertyInfo(discriminator="type")
|
|
59
|
+
]
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Union, Optional
|
|
6
|
+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["TextResponseFormatConfigurationParam", "Text", "JsonSchema", "JsonObject"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Text(TypedDict, total=False):
|
|
12
|
+
type: Required[Literal["text"]]
|
|
13
|
+
"""The type of response format being defined. Always `text`."""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class JsonSchema(TypedDict, total=False):
|
|
17
|
+
name: Required[str]
|
|
18
|
+
"""The name of the response format.
|
|
19
|
+
|
|
20
|
+
Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length
|
|
21
|
+
of 64.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
schema: Required[Dict[str, object]]
|
|
25
|
+
"""
|
|
26
|
+
The schema for the response format, described as a JSON Schema object. Learn how
|
|
27
|
+
to build JSON schemas [here](https://json-schema.org/).
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
type: Required[Literal["json_schema"]]
|
|
31
|
+
"""The type of response format being defined. Always `json_schema`."""
|
|
32
|
+
|
|
33
|
+
description: str
|
|
34
|
+
"""
|
|
35
|
+
A description of what the response format is for, used by the model to determine
|
|
36
|
+
how to respond in the format.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
strict: Optional[bool]
|
|
40
|
+
"""
|
|
41
|
+
Whether to enable strict schema adherence when generating the output. If set to
|
|
42
|
+
true, the model will always follow the exact schema defined in the `schema`
|
|
43
|
+
field. Only a subset of JSON Schema is supported when `strict` is `true`. To
|
|
44
|
+
learn more, read the
|
|
45
|
+
[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class JsonObject(TypedDict, total=False):
|
|
50
|
+
type: Required[Literal["json_object"]]
|
|
51
|
+
"""The type of response format being defined. Always `json_object`."""
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
TextResponseFormatConfigurationParam: TypeAlias = Union[Text, JsonSchema, JsonObject]
|