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,328 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Union, Optional
|
|
4
|
+
from typing_extensions import Literal, Annotated, TypeAlias
|
|
5
|
+
|
|
6
|
+
from .._utils import PropertyInfo
|
|
7
|
+
from .._models import BaseModel
|
|
8
|
+
from .response_tool import ResponseTool
|
|
9
|
+
from .conversations.input_file_content import InputFileContent
|
|
10
|
+
from .conversations.input_text_content import InputTextContent
|
|
11
|
+
from .conversations.input_image_content import InputImageContent
|
|
12
|
+
from .text_response_format_configuration import TextResponseFormatConfiguration
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"ResponseProperties",
|
|
16
|
+
"Prompt",
|
|
17
|
+
"PromptVariables",
|
|
18
|
+
"Reasoning",
|
|
19
|
+
"Text",
|
|
20
|
+
"ToolChoice",
|
|
21
|
+
"ToolChoiceToolChoiceOptions",
|
|
22
|
+
"ToolChoiceAllowedTools",
|
|
23
|
+
"ToolChoiceToolChoiceTypes",
|
|
24
|
+
"ToolChoiceFunction",
|
|
25
|
+
"ToolChoiceMcp",
|
|
26
|
+
"ToolChoiceCustom",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
PromptVariables: TypeAlias = Union[str, InputTextContent, InputImageContent, InputFileContent]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class Prompt(BaseModel):
|
|
33
|
+
id: str
|
|
34
|
+
"""The unique identifier of the prompt template to use."""
|
|
35
|
+
|
|
36
|
+
variables: Optional[Dict[str, PromptVariables]] = None
|
|
37
|
+
"""Optional map of values to substitute in for variables in your prompt.
|
|
38
|
+
|
|
39
|
+
The substitution values can either be strings, or other Response input types
|
|
40
|
+
like images or files.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
version: Optional[str] = None
|
|
44
|
+
"""Optional version of the prompt template."""
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class Reasoning(BaseModel):
|
|
48
|
+
effort: Optional[Literal["minimal", "low", "medium", "high"]] = None
|
|
49
|
+
"""
|
|
50
|
+
Constrains effort on reasoning for
|
|
51
|
+
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
52
|
+
supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
53
|
+
effort can result in faster responses and fewer tokens used on reasoning in a
|
|
54
|
+
response.
|
|
55
|
+
|
|
56
|
+
Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
|
|
57
|
+
effort.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
generate_summary: Optional[Literal["auto", "concise", "detailed"]] = None
|
|
61
|
+
"""**Deprecated:** use `summary` instead.
|
|
62
|
+
|
|
63
|
+
A summary of the reasoning performed by the model. This can be useful for
|
|
64
|
+
debugging and understanding the model's reasoning process. One of `auto`,
|
|
65
|
+
`concise`, or `detailed`.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
summary: Optional[Literal["auto", "concise", "detailed"]] = None
|
|
69
|
+
"""A summary of the reasoning performed by the model.
|
|
70
|
+
|
|
71
|
+
This can be useful for debugging and understanding the model's reasoning
|
|
72
|
+
process. One of `auto`, `concise`, or `detailed`.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class Text(BaseModel):
|
|
77
|
+
format: Optional[TextResponseFormatConfiguration] = None
|
|
78
|
+
"""An object specifying the format that the model must output.
|
|
79
|
+
|
|
80
|
+
Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
|
|
81
|
+
ensures the model will match your supplied JSON schema. Learn more in the
|
|
82
|
+
[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
83
|
+
|
|
84
|
+
The default format is `{ "type": "text" }` with no additional options.
|
|
85
|
+
|
|
86
|
+
**Not recommended for gpt-4o and newer models:**
|
|
87
|
+
|
|
88
|
+
Setting to `{ "type": "json_object" }` enables the older JSON mode, which
|
|
89
|
+
ensures the message the model generates is valid JSON. Using `json_schema` is
|
|
90
|
+
preferred for models that support it.
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
verbosity: Optional[Literal["low", "medium", "high"]] = None
|
|
94
|
+
"""Constrains the verbosity of the model's response.
|
|
95
|
+
|
|
96
|
+
Lower values will result in more concise responses, while higher values will
|
|
97
|
+
result in more verbose responses. Currently supported values are `low`,
|
|
98
|
+
`medium`, and `high`.
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class ToolChoiceToolChoiceOptions(BaseModel):
|
|
103
|
+
type: Literal["none", "auto", "required"]
|
|
104
|
+
"""Controls which (if any) tool is called by the model.
|
|
105
|
+
|
|
106
|
+
`none` means the model will not call any tool and instead generates a message.
|
|
107
|
+
|
|
108
|
+
`auto` means the model can pick between generating a message or calling one or
|
|
109
|
+
more tools.
|
|
110
|
+
|
|
111
|
+
`required` means the model must call one or more tools.
|
|
112
|
+
|
|
113
|
+
Allowed values are:
|
|
114
|
+
|
|
115
|
+
- `none`
|
|
116
|
+
- `auto`
|
|
117
|
+
- `required`
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class ToolChoiceAllowedTools(BaseModel):
|
|
122
|
+
mode: Literal["auto", "required"]
|
|
123
|
+
"""Constrains the tools available to the model to a pre-defined set.
|
|
124
|
+
|
|
125
|
+
`auto` allows the model to pick from among the allowed tools and generate a
|
|
126
|
+
message.
|
|
127
|
+
|
|
128
|
+
`required` requires the model to call one or more of the allowed tools.
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
tools: List[Dict[str, object]]
|
|
132
|
+
"""A list of tool definitions that the model should be allowed to call.
|
|
133
|
+
|
|
134
|
+
For the Responses API, the list of tool definitions might look like:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
[
|
|
138
|
+
{ "type": "function", "name": "get_weather" },
|
|
139
|
+
{ "type": "mcp", "server_label": "deepwiki" },
|
|
140
|
+
{ "type": "image_generation" }
|
|
141
|
+
]
|
|
142
|
+
```
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
type: Literal["allowed_tools"]
|
|
146
|
+
"""Allowed tool configuration type. Always `allowed_tools`."""
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class ToolChoiceToolChoiceTypes(BaseModel):
|
|
150
|
+
type: Literal[
|
|
151
|
+
"file_search",
|
|
152
|
+
"web_search_preview",
|
|
153
|
+
"computer_use_preview",
|
|
154
|
+
"web_search_preview_2025_03_11",
|
|
155
|
+
"image_generation",
|
|
156
|
+
"code_interpreter",
|
|
157
|
+
]
|
|
158
|
+
"""The type of hosted tool the model should to use.
|
|
159
|
+
|
|
160
|
+
Learn more about
|
|
161
|
+
[built-in tools](https://platform.openai.com/docs/guides/tools).
|
|
162
|
+
|
|
163
|
+
Allowed values are:
|
|
164
|
+
|
|
165
|
+
- `file_search`
|
|
166
|
+
- `web_search_preview`
|
|
167
|
+
- `computer_use_preview`
|
|
168
|
+
- `code_interpreter`
|
|
169
|
+
- `image_generation`
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class ToolChoiceFunction(BaseModel):
|
|
174
|
+
name: str
|
|
175
|
+
"""The name of the function to call."""
|
|
176
|
+
|
|
177
|
+
type: Literal["function"]
|
|
178
|
+
"""For function calling, the type is always `function`."""
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class ToolChoiceMcp(BaseModel):
|
|
182
|
+
server_label: str
|
|
183
|
+
"""The label of the MCP server to use."""
|
|
184
|
+
|
|
185
|
+
type: Literal["mcp"]
|
|
186
|
+
"""For MCP tools, the type is always `mcp`."""
|
|
187
|
+
|
|
188
|
+
name: Optional[str] = None
|
|
189
|
+
"""The name of the tool to call on the server."""
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class ToolChoiceCustom(BaseModel):
|
|
193
|
+
name: str
|
|
194
|
+
"""The name of the custom tool to call."""
|
|
195
|
+
|
|
196
|
+
type: Literal["custom"]
|
|
197
|
+
"""For custom tool calling, the type is always `custom`."""
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
ToolChoice: TypeAlias = Annotated[
|
|
201
|
+
Union[
|
|
202
|
+
ToolChoiceToolChoiceOptions,
|
|
203
|
+
ToolChoiceAllowedTools,
|
|
204
|
+
ToolChoiceToolChoiceTypes,
|
|
205
|
+
ToolChoiceFunction,
|
|
206
|
+
ToolChoiceMcp,
|
|
207
|
+
ToolChoiceCustom,
|
|
208
|
+
],
|
|
209
|
+
PropertyInfo(discriminator="type"),
|
|
210
|
+
]
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class ResponseProperties(BaseModel):
|
|
214
|
+
background: Optional[bool] = None
|
|
215
|
+
"""
|
|
216
|
+
Whether to run the model response in the background.
|
|
217
|
+
[Learn more](https://platform.openai.com/docs/guides/background).
|
|
218
|
+
"""
|
|
219
|
+
|
|
220
|
+
max_output_tokens: Optional[int] = None
|
|
221
|
+
"""
|
|
222
|
+
An upper bound for the number of tokens that can be generated for a response,
|
|
223
|
+
including visible output tokens and
|
|
224
|
+
[reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
|
|
225
|
+
"""
|
|
226
|
+
|
|
227
|
+
max_tool_calls: Optional[int] = None
|
|
228
|
+
"""
|
|
229
|
+
The maximum number of total calls to built-in tools that can be processed in a
|
|
230
|
+
response. This maximum number applies across all built-in tool calls, not per
|
|
231
|
+
individual tool. Any further attempts to call a tool by the model will be
|
|
232
|
+
ignored.
|
|
233
|
+
"""
|
|
234
|
+
|
|
235
|
+
model: Optional[
|
|
236
|
+
Literal[
|
|
237
|
+
"o1-pro",
|
|
238
|
+
"o1-pro-2025-03-19",
|
|
239
|
+
"o3-pro",
|
|
240
|
+
"o3-pro-2025-06-10",
|
|
241
|
+
"o3-deep-research",
|
|
242
|
+
"o3-deep-research-2025-06-26",
|
|
243
|
+
"o4-mini-deep-research",
|
|
244
|
+
"o4-mini-deep-research-2025-06-26",
|
|
245
|
+
"computer-use-preview",
|
|
246
|
+
"computer-use-preview-2025-03-11",
|
|
247
|
+
"gpt-5-codex",
|
|
248
|
+
"gpt-5-pro",
|
|
249
|
+
"gpt-5-pro-2025-10-06",
|
|
250
|
+
]
|
|
251
|
+
] = None
|
|
252
|
+
"""Model ID used to generate the response, like `gpt-4o` or `o3`.
|
|
253
|
+
|
|
254
|
+
OpenAI offers a wide range of models with different capabilities, performance
|
|
255
|
+
characteristics, and price points. Refer to the
|
|
256
|
+
[model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
257
|
+
available models.
|
|
258
|
+
"""
|
|
259
|
+
|
|
260
|
+
previous_response_id: Optional[str] = None
|
|
261
|
+
"""The unique ID of the previous response to the model.
|
|
262
|
+
|
|
263
|
+
Use this to create multi-turn conversations. Learn more about
|
|
264
|
+
[conversation state](https://platform.openai.com/docs/guides/conversation-state).
|
|
265
|
+
Cannot be used in conjunction with `conversation`.
|
|
266
|
+
"""
|
|
267
|
+
|
|
268
|
+
prompt: Optional[Prompt] = None
|
|
269
|
+
"""
|
|
270
|
+
Reference to a prompt template and its variables.
|
|
271
|
+
[Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
|
|
272
|
+
"""
|
|
273
|
+
|
|
274
|
+
reasoning: Optional[Reasoning] = None
|
|
275
|
+
"""**gpt-5 and o-series models only**
|
|
276
|
+
|
|
277
|
+
Configuration options for
|
|
278
|
+
[reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
279
|
+
"""
|
|
280
|
+
|
|
281
|
+
text: Optional[Text] = None
|
|
282
|
+
"""Configuration options for a text response from the model.
|
|
283
|
+
|
|
284
|
+
Can be plain text or structured JSON data. Learn more:
|
|
285
|
+
|
|
286
|
+
- [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
287
|
+
- [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
288
|
+
"""
|
|
289
|
+
|
|
290
|
+
tool_choice: Optional[ToolChoice] = None
|
|
291
|
+
"""
|
|
292
|
+
How the model should select which tool (or tools) to use when generating a
|
|
293
|
+
response. See the `tools` parameter to see how to specify which tools the model
|
|
294
|
+
can call.
|
|
295
|
+
"""
|
|
296
|
+
|
|
297
|
+
tools: Optional[List[ResponseTool]] = None
|
|
298
|
+
"""An array of tools the model may call while generating a response.
|
|
299
|
+
|
|
300
|
+
You can specify which tool to use by setting the `tool_choice` parameter.
|
|
301
|
+
|
|
302
|
+
We support the following categories of tools:
|
|
303
|
+
|
|
304
|
+
- **Built-in tools**: Tools that are provided by OpenAI that extend the model's
|
|
305
|
+
capabilities, like
|
|
306
|
+
[web search](https://platform.openai.com/docs/guides/tools-web-search) or
|
|
307
|
+
[file search](https://platform.openai.com/docs/guides/tools-file-search).
|
|
308
|
+
Learn more about
|
|
309
|
+
[built-in tools](https://platform.openai.com/docs/guides/tools).
|
|
310
|
+
- **MCP Tools**: Integrations with third-party systems via custom MCP servers or
|
|
311
|
+
predefined connectors such as Google Drive and SharePoint. Learn more about
|
|
312
|
+
[MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).
|
|
313
|
+
- **Function calls (custom tools)**: Functions that are defined by you, enabling
|
|
314
|
+
the model to call your own code with strongly typed arguments and outputs.
|
|
315
|
+
Learn more about
|
|
316
|
+
[function calling](https://platform.openai.com/docs/guides/function-calling).
|
|
317
|
+
You can also use custom tools to call your own code.
|
|
318
|
+
"""
|
|
319
|
+
|
|
320
|
+
truncation: Optional[Literal["auto", "disabled"]] = None
|
|
321
|
+
"""The truncation strategy to use for the model response.
|
|
322
|
+
|
|
323
|
+
- `auto`: If the input to this Response exceeds the model's context window size,
|
|
324
|
+
the model will truncate the response to fit the context window by dropping
|
|
325
|
+
items from the beginning of the conversation.
|
|
326
|
+
- `disabled` (default): If the input size will exceed the context window size
|
|
327
|
+
for a model, the request will fail with a 400 error.
|
|
328
|
+
"""
|
|
@@ -0,0 +1,42 @@
|
|
|
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 List
|
|
6
|
+
from typing_extensions import TypedDict
|
|
7
|
+
|
|
8
|
+
from .conversations.includable import Includable
|
|
9
|
+
|
|
10
|
+
__all__ = ["ResponseRetrieveParams"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ResponseRetrieveParams(TypedDict, total=False):
|
|
14
|
+
include: List[Includable]
|
|
15
|
+
"""Additional fields to include in the response.
|
|
16
|
+
|
|
17
|
+
See the `include` parameter for Response creation above for more information.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
include_obfuscation: bool
|
|
21
|
+
"""When true, stream obfuscation will be enabled.
|
|
22
|
+
|
|
23
|
+
Stream obfuscation adds random characters to an `obfuscation` field on streaming
|
|
24
|
+
delta events to normalize payload sizes as a mitigation to certain side-channel
|
|
25
|
+
attacks. These obfuscation fields are included by default, but add a small
|
|
26
|
+
amount of overhead to the data stream. You can set `include_obfuscation` to
|
|
27
|
+
false to optimize for bandwidth if you trust the network links between your
|
|
28
|
+
application and the OpenAI API.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
starting_after: int
|
|
32
|
+
"""The sequence number of the event after which to start streaming."""
|
|
33
|
+
|
|
34
|
+
stream: bool
|
|
35
|
+
"""
|
|
36
|
+
If set to true, the model response data will be streamed to the client as it is
|
|
37
|
+
generated using
|
|
38
|
+
[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
|
|
39
|
+
See the
|
|
40
|
+
[Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
|
|
41
|
+
for more information.
|
|
42
|
+
"""
|