openai 0.6.0 → 0.7.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +1 -1
- data/lib/openai/internal/util.rb +8 -9
- data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +67 -1
- data/lib/openai/models/evals/run_cancel_response.rb +77 -1
- data/lib/openai/models/evals/run_create_params.rb +79 -1
- data/lib/openai/models/evals/run_create_response.rb +77 -1
- data/lib/openai/models/evals/run_list_response.rb +76 -1
- data/lib/openai/models/evals/run_retrieve_response.rb +77 -1
- data/lib/openai/resources/chat/completions.rb +2 -0
- data/lib/openai/resources/responses.rb +2 -0
- data/lib/openai/version.rb +1 -1
- data/rbi/openai/internal/util.rbi +2 -0
- data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +110 -0
- data/rbi/openai/models/evals/run_cancel_response.rbi +187 -0
- data/rbi/openai/models/evals/run_create_params.rbi +222 -0
- data/rbi/openai/models/evals/run_create_response.rbi +187 -0
- data/rbi/openai/models/evals/run_list_response.rbi +187 -0
- data/rbi/openai/models/evals/run_retrieve_response.rbi +187 -0
- data/sig/openai/models/evals/create_eval_completions_run_data_source.rbs +29 -0
- data/sig/openai/models/evals/run_cancel_response.rbs +39 -0
- data/sig/openai/models/evals/run_create_params.rbs +39 -0
- data/sig/openai/models/evals/run_create_response.rbs +39 -0
- data/sig/openai/models/evals/run_list_response.rbs +39 -0
- data/sig/openai/models/evals/run_retrieve_response.rbs +39 -0
- metadata +2 -2
@@ -1052,6 +1052,66 @@ module OpenAI
|
|
1052
1052
|
sig { params(temperature: Float).void }
|
1053
1053
|
attr_writer :temperature
|
1054
1054
|
|
1055
|
+
# Configuration options for a text response from the model. Can be plain text or
|
1056
|
+
# structured JSON data. Learn more:
|
1057
|
+
#
|
1058
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
1059
|
+
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
1060
|
+
sig do
|
1061
|
+
returns(
|
1062
|
+
T.nilable(
|
1063
|
+
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::SamplingParams::Text
|
1064
|
+
)
|
1065
|
+
)
|
1066
|
+
end
|
1067
|
+
attr_reader :text
|
1068
|
+
|
1069
|
+
sig do
|
1070
|
+
params(
|
1071
|
+
text:
|
1072
|
+
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::SamplingParams::Text::OrHash
|
1073
|
+
).void
|
1074
|
+
end
|
1075
|
+
attr_writer :text
|
1076
|
+
|
1077
|
+
# An array of tools the model may call while generating a response. You can
|
1078
|
+
# specify which tool to use by setting the `tool_choice` parameter.
|
1079
|
+
#
|
1080
|
+
# The two categories of tools you can provide the model are:
|
1081
|
+
#
|
1082
|
+
# - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
|
1083
|
+
# capabilities, like
|
1084
|
+
# [web search](https://platform.openai.com/docs/guides/tools-web-search) or
|
1085
|
+
# [file search](https://platform.openai.com/docs/guides/tools-file-search).
|
1086
|
+
# Learn more about
|
1087
|
+
# [built-in tools](https://platform.openai.com/docs/guides/tools).
|
1088
|
+
# - **Function calls (custom tools)**: Functions that are defined by you, enabling
|
1089
|
+
# the model to call your own code. Learn more about
|
1090
|
+
# [function calling](https://platform.openai.com/docs/guides/function-calling).
|
1091
|
+
sig do
|
1092
|
+
returns(T.nilable(T::Array[OpenAI::Responses::Tool::Variants]))
|
1093
|
+
end
|
1094
|
+
attr_reader :tools
|
1095
|
+
|
1096
|
+
sig do
|
1097
|
+
params(
|
1098
|
+
tools:
|
1099
|
+
T::Array[
|
1100
|
+
T.any(
|
1101
|
+
OpenAI::Responses::FunctionTool::OrHash,
|
1102
|
+
OpenAI::Responses::FileSearchTool::OrHash,
|
1103
|
+
OpenAI::Responses::ComputerTool::OrHash,
|
1104
|
+
OpenAI::Responses::Tool::Mcp::OrHash,
|
1105
|
+
OpenAI::Responses::Tool::CodeInterpreter::OrHash,
|
1106
|
+
OpenAI::Responses::Tool::ImageGeneration::OrHash,
|
1107
|
+
OpenAI::Responses::Tool::LocalShell::OrHash,
|
1108
|
+
OpenAI::Responses::WebSearchTool::OrHash
|
1109
|
+
)
|
1110
|
+
]
|
1111
|
+
).void
|
1112
|
+
end
|
1113
|
+
attr_writer :tools
|
1114
|
+
|
1055
1115
|
# An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
|
1056
1116
|
sig { returns(T.nilable(Float)) }
|
1057
1117
|
attr_reader :top_p
|
@@ -1064,6 +1124,21 @@ module OpenAI
|
|
1064
1124
|
max_completion_tokens: Integer,
|
1065
1125
|
seed: Integer,
|
1066
1126
|
temperature: Float,
|
1127
|
+
text:
|
1128
|
+
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::SamplingParams::Text::OrHash,
|
1129
|
+
tools:
|
1130
|
+
T::Array[
|
1131
|
+
T.any(
|
1132
|
+
OpenAI::Responses::FunctionTool::OrHash,
|
1133
|
+
OpenAI::Responses::FileSearchTool::OrHash,
|
1134
|
+
OpenAI::Responses::ComputerTool::OrHash,
|
1135
|
+
OpenAI::Responses::Tool::Mcp::OrHash,
|
1136
|
+
OpenAI::Responses::Tool::CodeInterpreter::OrHash,
|
1137
|
+
OpenAI::Responses::Tool::ImageGeneration::OrHash,
|
1138
|
+
OpenAI::Responses::Tool::LocalShell::OrHash,
|
1139
|
+
OpenAI::Responses::WebSearchTool::OrHash
|
1140
|
+
)
|
1141
|
+
],
|
1067
1142
|
top_p: Float
|
1068
1143
|
).returns(T.attached_class)
|
1069
1144
|
end
|
@@ -1074,6 +1149,27 @@ module OpenAI
|
|
1074
1149
|
seed: nil,
|
1075
1150
|
# A higher temperature increases randomness in the outputs.
|
1076
1151
|
temperature: nil,
|
1152
|
+
# Configuration options for a text response from the model. Can be plain text or
|
1153
|
+
# structured JSON data. Learn more:
|
1154
|
+
#
|
1155
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
1156
|
+
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
1157
|
+
text: nil,
|
1158
|
+
# An array of tools the model may call while generating a response. You can
|
1159
|
+
# specify which tool to use by setting the `tool_choice` parameter.
|
1160
|
+
#
|
1161
|
+
# The two categories of tools you can provide the model are:
|
1162
|
+
#
|
1163
|
+
# - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
|
1164
|
+
# capabilities, like
|
1165
|
+
# [web search](https://platform.openai.com/docs/guides/tools-web-search) or
|
1166
|
+
# [file search](https://platform.openai.com/docs/guides/tools-file-search).
|
1167
|
+
# Learn more about
|
1168
|
+
# [built-in tools](https://platform.openai.com/docs/guides/tools).
|
1169
|
+
# - **Function calls (custom tools)**: Functions that are defined by you, enabling
|
1170
|
+
# the model to call your own code. Learn more about
|
1171
|
+
# [function calling](https://platform.openai.com/docs/guides/function-calling).
|
1172
|
+
tools: nil,
|
1077
1173
|
# An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
|
1078
1174
|
top_p: nil
|
1079
1175
|
)
|
@@ -1085,12 +1181,103 @@ module OpenAI
|
|
1085
1181
|
max_completion_tokens: Integer,
|
1086
1182
|
seed: Integer,
|
1087
1183
|
temperature: Float,
|
1184
|
+
text:
|
1185
|
+
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::SamplingParams::Text,
|
1186
|
+
tools: T::Array[OpenAI::Responses::Tool::Variants],
|
1088
1187
|
top_p: Float
|
1089
1188
|
}
|
1090
1189
|
)
|
1091
1190
|
end
|
1092
1191
|
def to_hash
|
1093
1192
|
end
|
1193
|
+
|
1194
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
1195
|
+
OrHash =
|
1196
|
+
T.type_alias do
|
1197
|
+
T.any(
|
1198
|
+
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::SamplingParams::Text,
|
1199
|
+
OpenAI::Internal::AnyHash
|
1200
|
+
)
|
1201
|
+
end
|
1202
|
+
|
1203
|
+
# An object specifying the format that the model must output.
|
1204
|
+
#
|
1205
|
+
# Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
|
1206
|
+
# ensures the model will match your supplied JSON schema. Learn more in the
|
1207
|
+
# [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
1208
|
+
#
|
1209
|
+
# The default format is `{ "type": "text" }` with no additional options.
|
1210
|
+
#
|
1211
|
+
# **Not recommended for gpt-4o and newer models:**
|
1212
|
+
#
|
1213
|
+
# Setting to `{ "type": "json_object" }` enables the older JSON mode, which
|
1214
|
+
# ensures the message the model generates is valid JSON. Using `json_schema` is
|
1215
|
+
# preferred for models that support it.
|
1216
|
+
sig do
|
1217
|
+
returns(
|
1218
|
+
T.nilable(
|
1219
|
+
OpenAI::Responses::ResponseFormatTextConfig::Variants
|
1220
|
+
)
|
1221
|
+
)
|
1222
|
+
end
|
1223
|
+
attr_reader :format_
|
1224
|
+
|
1225
|
+
sig do
|
1226
|
+
params(
|
1227
|
+
format_:
|
1228
|
+
T.any(
|
1229
|
+
OpenAI::ResponseFormatText::OrHash,
|
1230
|
+
OpenAI::Responses::ResponseFormatTextJSONSchemaConfig::OrHash,
|
1231
|
+
OpenAI::ResponseFormatJSONObject::OrHash
|
1232
|
+
)
|
1233
|
+
).void
|
1234
|
+
end
|
1235
|
+
attr_writer :format_
|
1236
|
+
|
1237
|
+
# Configuration options for a text response from the model. Can be plain text or
|
1238
|
+
# structured JSON data. Learn more:
|
1239
|
+
#
|
1240
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
1241
|
+
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
1242
|
+
sig do
|
1243
|
+
params(
|
1244
|
+
format_:
|
1245
|
+
T.any(
|
1246
|
+
OpenAI::ResponseFormatText::OrHash,
|
1247
|
+
OpenAI::Responses::ResponseFormatTextJSONSchemaConfig::OrHash,
|
1248
|
+
OpenAI::ResponseFormatJSONObject::OrHash
|
1249
|
+
)
|
1250
|
+
).returns(T.attached_class)
|
1251
|
+
end
|
1252
|
+
def self.new(
|
1253
|
+
# An object specifying the format that the model must output.
|
1254
|
+
#
|
1255
|
+
# Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
|
1256
|
+
# ensures the model will match your supplied JSON schema. Learn more in the
|
1257
|
+
# [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
1258
|
+
#
|
1259
|
+
# The default format is `{ "type": "text" }` with no additional options.
|
1260
|
+
#
|
1261
|
+
# **Not recommended for gpt-4o and newer models:**
|
1262
|
+
#
|
1263
|
+
# Setting to `{ "type": "json_object" }` enables the older JSON mode, which
|
1264
|
+
# ensures the message the model generates is valid JSON. Using `json_schema` is
|
1265
|
+
# preferred for models that support it.
|
1266
|
+
format_: nil
|
1267
|
+
)
|
1268
|
+
end
|
1269
|
+
|
1270
|
+
sig do
|
1271
|
+
override.returns(
|
1272
|
+
{
|
1273
|
+
format_:
|
1274
|
+
OpenAI::Responses::ResponseFormatTextConfig::Variants
|
1275
|
+
}
|
1276
|
+
)
|
1277
|
+
end
|
1278
|
+
def to_hash
|
1279
|
+
end
|
1280
|
+
end
|
1094
1281
|
end
|
1095
1282
|
end
|
1096
1283
|
|
@@ -1058,6 +1058,66 @@ module OpenAI
|
|
1058
1058
|
sig { params(temperature: Float).void }
|
1059
1059
|
attr_writer :temperature
|
1060
1060
|
|
1061
|
+
# Configuration options for a text response from the model. Can be plain text or
|
1062
|
+
# structured JSON data. Learn more:
|
1063
|
+
#
|
1064
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
1065
|
+
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
1066
|
+
sig do
|
1067
|
+
returns(
|
1068
|
+
T.nilable(
|
1069
|
+
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::SamplingParams::Text
|
1070
|
+
)
|
1071
|
+
)
|
1072
|
+
end
|
1073
|
+
attr_reader :text
|
1074
|
+
|
1075
|
+
sig do
|
1076
|
+
params(
|
1077
|
+
text:
|
1078
|
+
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::SamplingParams::Text::OrHash
|
1079
|
+
).void
|
1080
|
+
end
|
1081
|
+
attr_writer :text
|
1082
|
+
|
1083
|
+
# An array of tools the model may call while generating a response. You can
|
1084
|
+
# specify which tool to use by setting the `tool_choice` parameter.
|
1085
|
+
#
|
1086
|
+
# The two categories of tools you can provide the model are:
|
1087
|
+
#
|
1088
|
+
# - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
|
1089
|
+
# capabilities, like
|
1090
|
+
# [web search](https://platform.openai.com/docs/guides/tools-web-search) or
|
1091
|
+
# [file search](https://platform.openai.com/docs/guides/tools-file-search).
|
1092
|
+
# Learn more about
|
1093
|
+
# [built-in tools](https://platform.openai.com/docs/guides/tools).
|
1094
|
+
# - **Function calls (custom tools)**: Functions that are defined by you, enabling
|
1095
|
+
# the model to call your own code. Learn more about
|
1096
|
+
# [function calling](https://platform.openai.com/docs/guides/function-calling).
|
1097
|
+
sig do
|
1098
|
+
returns(T.nilable(T::Array[OpenAI::Responses::Tool::Variants]))
|
1099
|
+
end
|
1100
|
+
attr_reader :tools
|
1101
|
+
|
1102
|
+
sig do
|
1103
|
+
params(
|
1104
|
+
tools:
|
1105
|
+
T::Array[
|
1106
|
+
T.any(
|
1107
|
+
OpenAI::Responses::FunctionTool::OrHash,
|
1108
|
+
OpenAI::Responses::FileSearchTool::OrHash,
|
1109
|
+
OpenAI::Responses::ComputerTool::OrHash,
|
1110
|
+
OpenAI::Responses::Tool::Mcp::OrHash,
|
1111
|
+
OpenAI::Responses::Tool::CodeInterpreter::OrHash,
|
1112
|
+
OpenAI::Responses::Tool::ImageGeneration::OrHash,
|
1113
|
+
OpenAI::Responses::Tool::LocalShell::OrHash,
|
1114
|
+
OpenAI::Responses::WebSearchTool::OrHash
|
1115
|
+
)
|
1116
|
+
]
|
1117
|
+
).void
|
1118
|
+
end
|
1119
|
+
attr_writer :tools
|
1120
|
+
|
1061
1121
|
# An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
|
1062
1122
|
sig { returns(T.nilable(Float)) }
|
1063
1123
|
attr_reader :top_p
|
@@ -1070,6 +1130,21 @@ module OpenAI
|
|
1070
1130
|
max_completion_tokens: Integer,
|
1071
1131
|
seed: Integer,
|
1072
1132
|
temperature: Float,
|
1133
|
+
text:
|
1134
|
+
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::SamplingParams::Text::OrHash,
|
1135
|
+
tools:
|
1136
|
+
T::Array[
|
1137
|
+
T.any(
|
1138
|
+
OpenAI::Responses::FunctionTool::OrHash,
|
1139
|
+
OpenAI::Responses::FileSearchTool::OrHash,
|
1140
|
+
OpenAI::Responses::ComputerTool::OrHash,
|
1141
|
+
OpenAI::Responses::Tool::Mcp::OrHash,
|
1142
|
+
OpenAI::Responses::Tool::CodeInterpreter::OrHash,
|
1143
|
+
OpenAI::Responses::Tool::ImageGeneration::OrHash,
|
1144
|
+
OpenAI::Responses::Tool::LocalShell::OrHash,
|
1145
|
+
OpenAI::Responses::WebSearchTool::OrHash
|
1146
|
+
)
|
1147
|
+
],
|
1073
1148
|
top_p: Float
|
1074
1149
|
).returns(T.attached_class)
|
1075
1150
|
end
|
@@ -1080,6 +1155,27 @@ module OpenAI
|
|
1080
1155
|
seed: nil,
|
1081
1156
|
# A higher temperature increases randomness in the outputs.
|
1082
1157
|
temperature: nil,
|
1158
|
+
# Configuration options for a text response from the model. Can be plain text or
|
1159
|
+
# structured JSON data. Learn more:
|
1160
|
+
#
|
1161
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
1162
|
+
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
1163
|
+
text: nil,
|
1164
|
+
# An array of tools the model may call while generating a response. You can
|
1165
|
+
# specify which tool to use by setting the `tool_choice` parameter.
|
1166
|
+
#
|
1167
|
+
# The two categories of tools you can provide the model are:
|
1168
|
+
#
|
1169
|
+
# - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
|
1170
|
+
# capabilities, like
|
1171
|
+
# [web search](https://platform.openai.com/docs/guides/tools-web-search) or
|
1172
|
+
# [file search](https://platform.openai.com/docs/guides/tools-file-search).
|
1173
|
+
# Learn more about
|
1174
|
+
# [built-in tools](https://platform.openai.com/docs/guides/tools).
|
1175
|
+
# - **Function calls (custom tools)**: Functions that are defined by you, enabling
|
1176
|
+
# the model to call your own code. Learn more about
|
1177
|
+
# [function calling](https://platform.openai.com/docs/guides/function-calling).
|
1178
|
+
tools: nil,
|
1083
1179
|
# An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
|
1084
1180
|
top_p: nil
|
1085
1181
|
)
|
@@ -1091,12 +1187,103 @@ module OpenAI
|
|
1091
1187
|
max_completion_tokens: Integer,
|
1092
1188
|
seed: Integer,
|
1093
1189
|
temperature: Float,
|
1190
|
+
text:
|
1191
|
+
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::SamplingParams::Text,
|
1192
|
+
tools: T::Array[OpenAI::Responses::Tool::Variants],
|
1094
1193
|
top_p: Float
|
1095
1194
|
}
|
1096
1195
|
)
|
1097
1196
|
end
|
1098
1197
|
def to_hash
|
1099
1198
|
end
|
1199
|
+
|
1200
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
1201
|
+
OrHash =
|
1202
|
+
T.type_alias do
|
1203
|
+
T.any(
|
1204
|
+
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::SamplingParams::Text,
|
1205
|
+
OpenAI::Internal::AnyHash
|
1206
|
+
)
|
1207
|
+
end
|
1208
|
+
|
1209
|
+
# An object specifying the format that the model must output.
|
1210
|
+
#
|
1211
|
+
# Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
|
1212
|
+
# ensures the model will match your supplied JSON schema. Learn more in the
|
1213
|
+
# [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
1214
|
+
#
|
1215
|
+
# The default format is `{ "type": "text" }` with no additional options.
|
1216
|
+
#
|
1217
|
+
# **Not recommended for gpt-4o and newer models:**
|
1218
|
+
#
|
1219
|
+
# Setting to `{ "type": "json_object" }` enables the older JSON mode, which
|
1220
|
+
# ensures the message the model generates is valid JSON. Using `json_schema` is
|
1221
|
+
# preferred for models that support it.
|
1222
|
+
sig do
|
1223
|
+
returns(
|
1224
|
+
T.nilable(
|
1225
|
+
OpenAI::Responses::ResponseFormatTextConfig::Variants
|
1226
|
+
)
|
1227
|
+
)
|
1228
|
+
end
|
1229
|
+
attr_reader :format_
|
1230
|
+
|
1231
|
+
sig do
|
1232
|
+
params(
|
1233
|
+
format_:
|
1234
|
+
T.any(
|
1235
|
+
OpenAI::ResponseFormatText::OrHash,
|
1236
|
+
OpenAI::Responses::ResponseFormatTextJSONSchemaConfig::OrHash,
|
1237
|
+
OpenAI::ResponseFormatJSONObject::OrHash
|
1238
|
+
)
|
1239
|
+
).void
|
1240
|
+
end
|
1241
|
+
attr_writer :format_
|
1242
|
+
|
1243
|
+
# Configuration options for a text response from the model. Can be plain text or
|
1244
|
+
# structured JSON data. Learn more:
|
1245
|
+
#
|
1246
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
1247
|
+
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
1248
|
+
sig do
|
1249
|
+
params(
|
1250
|
+
format_:
|
1251
|
+
T.any(
|
1252
|
+
OpenAI::ResponseFormatText::OrHash,
|
1253
|
+
OpenAI::Responses::ResponseFormatTextJSONSchemaConfig::OrHash,
|
1254
|
+
OpenAI::ResponseFormatJSONObject::OrHash
|
1255
|
+
)
|
1256
|
+
).returns(T.attached_class)
|
1257
|
+
end
|
1258
|
+
def self.new(
|
1259
|
+
# An object specifying the format that the model must output.
|
1260
|
+
#
|
1261
|
+
# Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
|
1262
|
+
# ensures the model will match your supplied JSON schema. Learn more in the
|
1263
|
+
# [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
1264
|
+
#
|
1265
|
+
# The default format is `{ "type": "text" }` with no additional options.
|
1266
|
+
#
|
1267
|
+
# **Not recommended for gpt-4o and newer models:**
|
1268
|
+
#
|
1269
|
+
# Setting to `{ "type": "json_object" }` enables the older JSON mode, which
|
1270
|
+
# ensures the message the model generates is valid JSON. Using `json_schema` is
|
1271
|
+
# preferred for models that support it.
|
1272
|
+
format_: nil
|
1273
|
+
)
|
1274
|
+
end
|
1275
|
+
|
1276
|
+
sig do
|
1277
|
+
override.returns(
|
1278
|
+
{
|
1279
|
+
format_:
|
1280
|
+
OpenAI::Responses::ResponseFormatTextConfig::Variants
|
1281
|
+
}
|
1282
|
+
)
|
1283
|
+
end
|
1284
|
+
def to_hash
|
1285
|
+
end
|
1286
|
+
end
|
1100
1287
|
end
|
1101
1288
|
end
|
1102
1289
|
|
@@ -303,8 +303,10 @@ module OpenAI
|
|
303
303
|
type sampling_params =
|
304
304
|
{
|
305
305
|
max_completion_tokens: Integer,
|
306
|
+
response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format,
|
306
307
|
seed: Integer,
|
307
308
|
temperature: Float,
|
309
|
+
tools: ::Array[OpenAI::Chat::ChatCompletionTool],
|
308
310
|
top_p: Float
|
309
311
|
}
|
310
312
|
|
@@ -313,6 +315,12 @@ module OpenAI
|
|
313
315
|
|
314
316
|
def max_completion_tokens=: (Integer) -> Integer
|
315
317
|
|
318
|
+
attr_reader response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format?
|
319
|
+
|
320
|
+
def response_format=: (
|
321
|
+
OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format
|
322
|
+
) -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format
|
323
|
+
|
316
324
|
attr_reader seed: Integer?
|
317
325
|
|
318
326
|
def seed=: (Integer) -> Integer
|
@@ -321,23 +329,44 @@ module OpenAI
|
|
321
329
|
|
322
330
|
def temperature=: (Float) -> Float
|
323
331
|
|
332
|
+
attr_reader tools: ::Array[OpenAI::Chat::ChatCompletionTool]?
|
333
|
+
|
334
|
+
def tools=: (
|
335
|
+
::Array[OpenAI::Chat::ChatCompletionTool]
|
336
|
+
) -> ::Array[OpenAI::Chat::ChatCompletionTool]
|
337
|
+
|
324
338
|
attr_reader top_p: Float?
|
325
339
|
|
326
340
|
def top_p=: (Float) -> Float
|
327
341
|
|
328
342
|
def initialize: (
|
329
343
|
?max_completion_tokens: Integer,
|
344
|
+
?response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format,
|
330
345
|
?seed: Integer,
|
331
346
|
?temperature: Float,
|
347
|
+
?tools: ::Array[OpenAI::Chat::ChatCompletionTool],
|
332
348
|
?top_p: Float
|
333
349
|
) -> void
|
334
350
|
|
335
351
|
def to_hash: -> {
|
336
352
|
max_completion_tokens: Integer,
|
353
|
+
response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format,
|
337
354
|
seed: Integer,
|
338
355
|
temperature: Float,
|
356
|
+
tools: ::Array[OpenAI::Chat::ChatCompletionTool],
|
339
357
|
top_p: Float
|
340
358
|
}
|
359
|
+
|
360
|
+
type response_format =
|
361
|
+
OpenAI::ResponseFormatText
|
362
|
+
| OpenAI::ResponseFormatJSONSchema
|
363
|
+
| OpenAI::ResponseFormatJSONObject
|
364
|
+
|
365
|
+
module ResponseFormat
|
366
|
+
extend OpenAI::Internal::Type::Union
|
367
|
+
|
368
|
+
def self?.variants: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format]
|
369
|
+
end
|
341
370
|
end
|
342
371
|
end
|
343
372
|
end
|
@@ -427,6 +427,8 @@ module OpenAI
|
|
427
427
|
max_completion_tokens: Integer,
|
428
428
|
seed: Integer,
|
429
429
|
temperature: Float,
|
430
|
+
text: OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::SamplingParams::Text,
|
431
|
+
tools: ::Array[OpenAI::Models::Responses::tool],
|
430
432
|
top_p: Float
|
431
433
|
}
|
432
434
|
|
@@ -443,6 +445,18 @@ module OpenAI
|
|
443
445
|
|
444
446
|
def temperature=: (Float) -> Float
|
445
447
|
|
448
|
+
attr_reader text: OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::SamplingParams::Text?
|
449
|
+
|
450
|
+
def text=: (
|
451
|
+
OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::SamplingParams::Text
|
452
|
+
) -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::SamplingParams::Text
|
453
|
+
|
454
|
+
attr_reader tools: ::Array[OpenAI::Models::Responses::tool]?
|
455
|
+
|
456
|
+
def tools=: (
|
457
|
+
::Array[OpenAI::Models::Responses::tool]
|
458
|
+
) -> ::Array[OpenAI::Models::Responses::tool]
|
459
|
+
|
446
460
|
attr_reader top_p: Float?
|
447
461
|
|
448
462
|
def top_p=: (Float) -> Float
|
@@ -451,6 +465,8 @@ module OpenAI
|
|
451
465
|
?max_completion_tokens: Integer,
|
452
466
|
?seed: Integer,
|
453
467
|
?temperature: Float,
|
468
|
+
?text: OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::SamplingParams::Text,
|
469
|
+
?tools: ::Array[OpenAI::Models::Responses::tool],
|
454
470
|
?top_p: Float
|
455
471
|
) -> void
|
456
472
|
|
@@ -458,8 +474,31 @@ module OpenAI
|
|
458
474
|
max_completion_tokens: Integer,
|
459
475
|
seed: Integer,
|
460
476
|
temperature: Float,
|
477
|
+
text: OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::SamplingParams::Text,
|
478
|
+
tools: ::Array[OpenAI::Models::Responses::tool],
|
461
479
|
top_p: Float
|
462
480
|
}
|
481
|
+
|
482
|
+
type text =
|
483
|
+
{
|
484
|
+
format_: OpenAI::Models::Responses::response_format_text_config
|
485
|
+
}
|
486
|
+
|
487
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
488
|
+
attr_reader format_: OpenAI::Models::Responses::response_format_text_config?
|
489
|
+
|
490
|
+
def format_=: (
|
491
|
+
OpenAI::Models::Responses::response_format_text_config
|
492
|
+
) -> OpenAI::Models::Responses::response_format_text_config
|
493
|
+
|
494
|
+
def initialize: (
|
495
|
+
?format_: OpenAI::Models::Responses::response_format_text_config
|
496
|
+
) -> void
|
497
|
+
|
498
|
+
def to_hash: -> {
|
499
|
+
format_: OpenAI::Models::Responses::response_format_text_config
|
500
|
+
}
|
501
|
+
end
|
463
502
|
end
|
464
503
|
end
|
465
504
|
|
@@ -390,6 +390,8 @@ module OpenAI
|
|
390
390
|
max_completion_tokens: Integer,
|
391
391
|
seed: Integer,
|
392
392
|
temperature: Float,
|
393
|
+
text: OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams::Text,
|
394
|
+
tools: ::Array[OpenAI::Models::Responses::tool],
|
393
395
|
top_p: Float
|
394
396
|
}
|
395
397
|
|
@@ -406,6 +408,18 @@ module OpenAI
|
|
406
408
|
|
407
409
|
def temperature=: (Float) -> Float
|
408
410
|
|
411
|
+
attr_reader text: OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams::Text?
|
412
|
+
|
413
|
+
def text=: (
|
414
|
+
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams::Text
|
415
|
+
) -> OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams::Text
|
416
|
+
|
417
|
+
attr_reader tools: ::Array[OpenAI::Models::Responses::tool]?
|
418
|
+
|
419
|
+
def tools=: (
|
420
|
+
::Array[OpenAI::Models::Responses::tool]
|
421
|
+
) -> ::Array[OpenAI::Models::Responses::tool]
|
422
|
+
|
409
423
|
attr_reader top_p: Float?
|
410
424
|
|
411
425
|
def top_p=: (Float) -> Float
|
@@ -414,6 +428,8 @@ module OpenAI
|
|
414
428
|
?max_completion_tokens: Integer,
|
415
429
|
?seed: Integer,
|
416
430
|
?temperature: Float,
|
431
|
+
?text: OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams::Text,
|
432
|
+
?tools: ::Array[OpenAI::Models::Responses::tool],
|
417
433
|
?top_p: Float
|
418
434
|
) -> void
|
419
435
|
|
@@ -421,8 +437,31 @@ module OpenAI
|
|
421
437
|
max_completion_tokens: Integer,
|
422
438
|
seed: Integer,
|
423
439
|
temperature: Float,
|
440
|
+
text: OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams::Text,
|
441
|
+
tools: ::Array[OpenAI::Models::Responses::tool],
|
424
442
|
top_p: Float
|
425
443
|
}
|
444
|
+
|
445
|
+
type text =
|
446
|
+
{
|
447
|
+
format_: OpenAI::Models::Responses::response_format_text_config
|
448
|
+
}
|
449
|
+
|
450
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
451
|
+
attr_reader format_: OpenAI::Models::Responses::response_format_text_config?
|
452
|
+
|
453
|
+
def format_=: (
|
454
|
+
OpenAI::Models::Responses::response_format_text_config
|
455
|
+
) -> OpenAI::Models::Responses::response_format_text_config
|
456
|
+
|
457
|
+
def initialize: (
|
458
|
+
?format_: OpenAI::Models::Responses::response_format_text_config
|
459
|
+
) -> void
|
460
|
+
|
461
|
+
def to_hash: -> {
|
462
|
+
format_: OpenAI::Models::Responses::response_format_text_config
|
463
|
+
}
|
464
|
+
end
|
426
465
|
end
|
427
466
|
end
|
428
467
|
|