3
3
import { APIResource } from '../../../core/resource' ;
4
4
import * as Shared from '../../shared' ;
5
5
import * as ResponsesAPI from '../../responses/responses' ;
6
+ import * as CompletionsAPI from '../../chat/completions/completions' ;
6
7
import * as OutputItemsAPI from './output-items' ;
7
8
import {
8
9
OutputItemListParams ,
@@ -257,6 +258,23 @@ export namespace CreateEvalCompletionsRunDataSource {
257
258
*/
258
259
max_completion_tokens ?: number ;
259
260
261
+ /**
262
+ * An object specifying the format that the model must output.
263
+ *
264
+ * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
265
+ * Outputs which ensures the model will match your supplied JSON schema. Learn more
266
+ * in the
267
+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
268
+ *
269
+ * Setting to `{ "type": "json_object" }` enables the older JSON mode, which
270
+ * ensures the message the model generates is valid JSON. Using `json_schema` is
271
+ * preferred for models that support it.
272
+ */
273
+ response_format ?:
274
+ | Shared . ResponseFormatText
275
+ | Shared . ResponseFormatJSONSchema
276
+ | Shared . ResponseFormatJSONObject ;
277
+
260
278
/**
261
279
* A seed value to initialize the randomness, during sampling.
262
280
*/
@@ -267,6 +285,13 @@ export namespace CreateEvalCompletionsRunDataSource {
267
285
*/
268
286
temperature ?: number ;
269
287
288
+ /**
289
+ * A list of tools the model may call. Currently, only functions are supported as a
290
+ * tool. Use this to provide a list of functions the model may generate JSON inputs
291
+ * for. A max of 128 functions are supported.
292
+ */
293
+ tools ?: Array < CompletionsAPI . ChatCompletionTool > ;
294
+
270
295
/**
271
296
* An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
272
297
*/
@@ -649,11 +674,66 @@ export namespace RunCreateResponse {
649
674
*/
650
675
temperature ?: number ;
651
676
677
+ /**
678
+ * Configuration options for a text response from the model. Can be plain text or
679
+ * structured JSON data. Learn more:
680
+ *
681
+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
682
+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
683
+ */
684
+ text ?: SamplingParams . Text ;
685
+
686
+ /**
687
+ * An array of tools the model may call while generating a response. You can
688
+ * specify which tool to use by setting the `tool_choice` parameter.
689
+ *
690
+ * The two categories of tools you can provide the model are:
691
+ *
692
+ * - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
693
+ * capabilities, like
694
+ * [web search](https://platform.openai.com/docs/guides/tools-web-search) or
695
+ * [file search](https://platform.openai.com/docs/guides/tools-file-search).
696
+ * Learn more about
697
+ * [built-in tools](https://platform.openai.com/docs/guides/tools).
698
+ * - **Function calls (custom tools)**: Functions that are defined by you, enabling
699
+ * the model to call your own code. Learn more about
700
+ * [function calling](https://platform.openai.com/docs/guides/function-calling).
701
+ */
702
+ tools ?: Array < ResponsesAPI . Tool > ;
703
+
652
704
/**
653
705
* An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
654
706
*/
655
707
top_p ?: number ;
656
708
}
709
+
710
+ export namespace SamplingParams {
711
+ /**
712
+ * Configuration options for a text response from the model. Can be plain text or
713
+ * structured JSON data. Learn more:
714
+ *
715
+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
716
+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
717
+ */
718
+ export interface Text {
719
+ /**
720
+ * An object specifying the format that the model must output.
721
+ *
722
+ * Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
723
+ * ensures the model will match your supplied JSON schema. Learn more in the
724
+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
725
+ *
726
+ * The default format is `{ "type": "text" }` with no additional options.
727
+ *
728
+ * **Not recommended for gpt-4o and newer models:**
729
+ *
730
+ * Setting to `{ "type": "json_object" }` enables the older JSON mode, which
731
+ * ensures the message the model generates is valid JSON. Using `json_schema` is
732
+ * preferred for models that support it.
733
+ */
734
+ format ?: ResponsesAPI . ResponseFormatTextConfig ;
735
+ }
736
+ }
657
737
}
658
738
659
739
export interface PerModelUsage {
@@ -1041,11 +1121,66 @@ export namespace RunRetrieveResponse {
1041
1121
*/
1042
1122
temperature ?: number ;
1043
1123
1124
+ /**
1125
+ * Configuration options for a text response from the model. Can be plain text or
1126
+ * structured JSON data. Learn more:
1127
+ *
1128
+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
1129
+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
1130
+ */
1131
+ text ?: SamplingParams . Text ;
1132
+
1133
+ /**
1134
+ * An array of tools the model may call while generating a response. You can
1135
+ * specify which tool to use by setting the `tool_choice` parameter.
1136
+ *
1137
+ * The two categories of tools you can provide the model are:
1138
+ *
1139
+ * - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
1140
+ * capabilities, like
1141
+ * [web search](https://platform.openai.com/docs/guides/tools-web-search) or
1142
+ * [file search](https://platform.openai.com/docs/guides/tools-file-search).
1143
+ * Learn more about
1144
+ * [built-in tools](https://platform.openai.com/docs/guides/tools).
1145
+ * - **Function calls (custom tools)**: Functions that are defined by you, enabling
1146
+ * the model to call your own code. Learn more about
1147
+ * [function calling](https://platform.openai.com/docs/guides/function-calling).
1148
+ */
1149
+ tools ?: Array < ResponsesAPI . Tool > ;
1150
+
1044
1151
/**
1045
1152
* An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
1046
1153
*/
1047
1154
top_p ?: number ;
1048
1155
}
1156
+
1157
+ export namespace SamplingParams {
1158
+ /**
1159
+ * Configuration options for a text response from the model. Can be plain text or
1160
+ * structured JSON data. Learn more:
1161
+ *
1162
+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
1163
+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
1164
+ */
1165
+ export interface Text {
1166
+ /**
1167
+ * An object specifying the format that the model must output.
1168
+ *
1169
+ * Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
1170
+ * ensures the model will match your supplied JSON schema. Learn more in the
1171
+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
1172
+ *
1173
+ * The default format is `{ "type": "text" }` with no additional options.
1174
+ *
1175
+ * **Not recommended for gpt-4o and newer models:**
1176
+ *
1177
+ * Setting to `{ "type": "json_object" }` enables the older JSON mode, which
1178
+ * ensures the message the model generates is valid JSON. Using `json_schema` is
1179
+ * preferred for models that support it.
1180
+ */
1181
+ format ?: ResponsesAPI . ResponseFormatTextConfig ;
1182
+ }
1183
+ }
1049
1184
}
1050
1185
1051
1186
export interface PerModelUsage {
@@ -1430,11 +1565,66 @@ export namespace RunListResponse {
1430
1565
*/
1431
1566
temperature ?: number ;
1432
1567
1568
+ /**
1569
+ * Configuration options for a text response from the model. Can be plain text or
1570
+ * structured JSON data. Learn more:
1571
+ *
1572
+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
1573
+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
1574
+ */
1575
+ text ?: SamplingParams . Text ;
1576
+
1577
+ /**
1578
+ * An array of tools the model may call while generating a response. You can
1579
+ * specify which tool to use by setting the `tool_choice` parameter.
1580
+ *
1581
+ * The two categories of tools you can provide the model are:
1582
+ *
1583
+ * - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
1584
+ * capabilities, like
1585
+ * [web search](https://platform.openai.com/docs/guides/tools-web-search) or
1586
+ * [file search](https://platform.openai.com/docs/guides/tools-file-search).
1587
+ * Learn more about
1588
+ * [built-in tools](https://platform.openai.com/docs/guides/tools).
1589
+ * - **Function calls (custom tools)**: Functions that are defined by you, enabling
1590
+ * the model to call your own code. Learn more about
1591
+ * [function calling](https://platform.openai.com/docs/guides/function-calling).
1592
+ */
1593
+ tools ?: Array < ResponsesAPI . Tool > ;
1594
+
1433
1595
/**
1434
1596
* An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
1435
1597
*/
1436
1598
top_p ?: number ;
1437
1599
}
1600
+
1601
+ export namespace SamplingParams {
1602
+ /**
1603
+ * Configuration options for a text response from the model. Can be plain text or
1604
+ * structured JSON data. Learn more:
1605
+ *
1606
+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
1607
+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
1608
+ */
1609
+ export interface Text {
1610
+ /**
1611
+ * An object specifying the format that the model must output.
1612
+ *
1613
+ * Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
1614
+ * ensures the model will match your supplied JSON schema. Learn more in the
1615
+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
1616
+ *
1617
+ * The default format is `{ "type": "text" }` with no additional options.
1618
+ *
1619
+ * **Not recommended for gpt-4o and newer models:**
1620
+ *
1621
+ * Setting to `{ "type": "json_object" }` enables the older JSON mode, which
1622
+ * ensures the message the model generates is valid JSON. Using `json_schema` is
1623
+ * preferred for models that support it.
1624
+ */
1625
+ format ?: ResponsesAPI . ResponseFormatTextConfig ;
1626
+ }
1627
+ }
1438
1628
}
1439
1629
1440
1630
export interface PerModelUsage {
@@ -1830,11 +2020,66 @@ export namespace RunCancelResponse {
1830
2020
*/
1831
2021
temperature ?: number ;
1832
2022
2023
+ /**
2024
+ * Configuration options for a text response from the model. Can be plain text or
2025
+ * structured JSON data. Learn more:
2026
+ *
2027
+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
2028
+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
2029
+ */
2030
+ text ?: SamplingParams . Text ;
2031
+
2032
+ /**
2033
+ * An array of tools the model may call while generating a response. You can
2034
+ * specify which tool to use by setting the `tool_choice` parameter.
2035
+ *
2036
+ * The two categories of tools you can provide the model are:
2037
+ *
2038
+ * - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
2039
+ * capabilities, like
2040
+ * [web search](https://platform.openai.com/docs/guides/tools-web-search) or
2041
+ * [file search](https://platform.openai.com/docs/guides/tools-file-search).
2042
+ * Learn more about
2043
+ * [built-in tools](https://platform.openai.com/docs/guides/tools).
2044
+ * - **Function calls (custom tools)**: Functions that are defined by you, enabling
2045
+ * the model to call your own code. Learn more about
2046
+ * [function calling](https://platform.openai.com/docs/guides/function-calling).
2047
+ */
2048
+ tools ?: Array < ResponsesAPI . Tool > ;
2049
+
1833
2050
/**
1834
2051
* An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
1835
2052
*/
1836
2053
top_p ?: number ;
1837
2054
}
2055
+
2056
+ export namespace SamplingParams {
2057
+ /**
2058
+ * Configuration options for a text response from the model. Can be plain text or
2059
+ * structured JSON data. Learn more:
2060
+ *
2061
+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
2062
+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
2063
+ */
2064
+ export interface Text {
2065
+ /**
2066
+ * An object specifying the format that the model must output.
2067
+ *
2068
+ * Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
2069
+ * ensures the model will match your supplied JSON schema. Learn more in the
2070
+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
2071
+ *
2072
+ * The default format is `{ "type": "text" }` with no additional options.
2073
+ *
2074
+ * **Not recommended for gpt-4o and newer models:**
2075
+ *
2076
+ * Setting to `{ "type": "json_object" }` enables the older JSON mode, which
2077
+ * ensures the message the model generates is valid JSON. Using `json_schema` is
2078
+ * preferred for models that support it.
2079
+ */
2080
+ format ?: ResponsesAPI . ResponseFormatTextConfig ;
2081
+ }
2082
+ }
1838
2083
}
1839
2084
1840
2085
export interface PerModelUsage {
@@ -2169,11 +2414,66 @@ export namespace RunCreateParams {
2169
2414
*/
2170
2415
temperature ?: number ;
2171
2416
2417
+ /**
2418
+ * Configuration options for a text response from the model. Can be plain text or
2419
+ * structured JSON data. Learn more:
2420
+ *
2421
+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
2422
+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
2423
+ */
2424
+ text ?: SamplingParams . Text ;
2425
+
2426
+ /**
2427
+ * An array of tools the model may call while generating a response. You can
2428
+ * specify which tool to use by setting the `tool_choice` parameter.
2429
+ *
2430
+ * The two categories of tools you can provide the model are:
2431
+ *
2432
+ * - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
2433
+ * capabilities, like
2434
+ * [web search](https://platform.openai.com/docs/guides/tools-web-search) or
2435
+ * [file search](https://platform.openai.com/docs/guides/tools-file-search).
2436
+ * Learn more about
2437
+ * [built-in tools](https://platform.openai.com/docs/guides/tools).
2438
+ * - **Function calls (custom tools)**: Functions that are defined by you, enabling
2439
+ * the model to call your own code. Learn more about
2440
+ * [function calling](https://platform.openai.com/docs/guides/function-calling).
2441
+ */
2442
+ tools ?: Array < ResponsesAPI . Tool > ;
2443
+
2172
2444
/**
2173
2445
* An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
2174
2446
*/
2175
2447
top_p ?: number ;
2176
2448
}
2449
+
2450
+ export namespace SamplingParams {
2451
+ /**
2452
+ * Configuration options for a text response from the model. Can be plain text or
2453
+ * structured JSON data. Learn more:
2454
+ *
2455
+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
2456
+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
2457
+ */
2458
+ export interface Text {
2459
+ /**
2460
+ * An object specifying the format that the model must output.
2461
+ *
2462
+ * Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
2463
+ * ensures the model will match your supplied JSON schema. Learn more in the
2464
+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
2465
+ *
2466
+ * The default format is `{ "type": "text" }` with no additional options.
2467
+ *
2468
+ * **Not recommended for gpt-4o and newer models:**
2469
+ *
2470
+ * Setting to `{ "type": "json_object" }` enables the older JSON mode, which
2471
+ * ensures the message the model generates is valid JSON. Using `json_schema` is
2472
+ * preferred for models that support it.
2473
+ */
2474
+ format ?: ResponsesAPI . ResponseFormatTextConfig ;
2475
+ }
2476
+ }
2177
2477
}
2178
2478
}
2179
2479
0 commit comments