5
5
from typing import Dict , List , Union , Iterable , Optional
6
6
from typing_extensions import Literal , Required , TypeAlias , TypedDict
7
7
8
+ from ..responses .tool_param import ToolParam
8
9
from ..shared_params .metadata import Metadata
9
10
from ..shared .reasoning_effort import ReasoningEffort
10
11
from ..responses .response_input_text_param import ResponseInputTextParam
11
12
from .create_eval_jsonl_run_data_source_param import CreateEvalJSONLRunDataSourceParam
13
+ from ..responses .response_format_text_config_param import ResponseFormatTextConfigParam
12
14
from .create_eval_completions_run_data_source_param import CreateEvalCompletionsRunDataSourceParam
13
15
14
16
__all__ = [
29
31
"DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContentOutputText" ,
30
32
"DataSourceCreateEvalResponsesRunDataSourceInputMessagesItemReference" ,
31
33
"DataSourceCreateEvalResponsesRunDataSourceSamplingParams" ,
34
+ "DataSourceCreateEvalResponsesRunDataSourceSamplingParamsText" ,
32
35
]
33
36
34
37
@@ -202,6 +205,24 @@ class DataSourceCreateEvalResponsesRunDataSourceInputMessagesItemReference(Typed
202
205
]
203
206
204
207
208
+ class DataSourceCreateEvalResponsesRunDataSourceSamplingParamsText (TypedDict , total = False ):
209
+ format : ResponseFormatTextConfigParam
210
+ """An object specifying the format that the model must output.
211
+
212
+ Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
213
+ ensures the model will match your supplied JSON schema. Learn more in the
214
+ [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
215
+
216
+ The default format is `{ "type": "text" }` with no additional options.
217
+
218
+ **Not recommended for gpt-4o and newer models:**
219
+
220
+ Setting to `{ "type": "json_object" }` enables the older JSON mode, which
221
+ ensures the message the model generates is valid JSON. Using `json_schema` is
222
+ preferred for models that support it.
223
+ """
224
+
225
+
205
226
class DataSourceCreateEvalResponsesRunDataSourceSamplingParams (TypedDict , total = False ):
206
227
max_completion_tokens : int
207
228
"""The maximum number of tokens in the generated output."""
@@ -212,6 +233,33 @@ class DataSourceCreateEvalResponsesRunDataSourceSamplingParams(TypedDict, total=
212
233
temperature : float
213
234
"""A higher temperature increases randomness in the outputs."""
214
235
236
+ text : DataSourceCreateEvalResponsesRunDataSourceSamplingParamsText
237
+ """Configuration options for a text response from the model.
238
+
239
+ Can be plain text or structured JSON data. Learn more:
240
+
241
+ - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
242
+ - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
243
+ """
244
+
245
+ tools : Iterable [ToolParam ]
246
+ """An array of tools the model may call while generating a response.
247
+
248
+ You can specify which tool to use by setting the `tool_choice` parameter.
249
+
250
+ The two categories of tools you can provide the model are:
251
+
252
+ - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
253
+ capabilities, like
254
+ [web search](https://platform.openai.com/docs/guides/tools-web-search) or
255
+ [file search](https://platform.openai.com/docs/guides/tools-file-search).
256
+ Learn more about
257
+ [built-in tools](https://platform.openai.com/docs/guides/tools).
258
+ - **Function calls (custom tools)**: Functions that are defined by you, enabling
259
+ the model to call your own code. Learn more about
260
+ [function calling](https://platform.openai.com/docs/guides/function-calling).
261
+ """
262
+
215
263
top_p : float
216
264
"""An alternative to temperature for nucleus sampling; 1.0 includes all tokens."""
217
265
0 commit comments