Class CreateEvalCompletionsRunDataSource.SamplingParams.Builder
-
- All Implemented Interfaces:
public final class CreateEvalCompletionsRunDataSource.SamplingParams.Builder
A builder for SamplingParams.
-
-
Method Summary
-
-
Method Detail
-
maxCompletionTokens
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder maxCompletionTokens(Long maxCompletionTokens)
The maximum number of tokens in the generated output.
-
maxCompletionTokens
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder maxCompletionTokens(JsonField<Long> maxCompletionTokens)
Sets Builder.maxCompletionTokens to an arbitrary JSON value.
You should usually call Builder.maxCompletionTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
responseFormat
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder responseFormat(CreateEvalCompletionsRunDataSource.SamplingParams.ResponseFormat responseFormat)
An object specifying the format that the model must output.
Setting to
{ "type": "json_schema", "json_schema": {...} }
enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.Setting to
{ "type": "json_object" }
enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schema
is preferred for models that support it.
-
responseFormat
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder responseFormat(JsonField<CreateEvalCompletionsRunDataSource.SamplingParams.ResponseFormat> responseFormat)
Sets Builder.responseFormat to an arbitrary JSON value.
You should usually call Builder.responseFormat with a well-typed ResponseFormat value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
responseFormat
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder responseFormat(ResponseFormatText text)
Alias for calling responseFormat with
ResponseFormat.ofText(text)
.
-
responseFormat
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder responseFormat(ResponseFormatJsonSchema jsonSchema)
Alias for calling responseFormat with
ResponseFormat.ofJsonSchema(jsonSchema)
.
-
responseFormat
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder responseFormat(ResponseFormatJsonObject jsonObject)
Alias for calling responseFormat with
ResponseFormat.ofJsonObject(jsonObject)
.
-
seed
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder seed(Long seed)
A seed value to initialize the randomness, during sampling.
-
seed
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder seed(JsonField<Long> seed)
Sets Builder.seed to an arbitrary JSON value.
You should usually call Builder.seed with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
temperature
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder temperature(Double temperature)
A higher temperature increases randomness in the outputs.
-
temperature
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder temperature(JsonField<Double> temperature)
Sets Builder.temperature to an arbitrary JSON value.
You should usually call Builder.temperature with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
tools
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder tools(List<ChatCompletionTool> tools)
A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
-
tools
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder tools(JsonField<List<ChatCompletionTool>> tools)
Sets Builder.tools to an arbitrary JSON value.
You should usually call Builder.tools with a well-typed
List<ChatCompletionTool>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addTool
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder addTool(ChatCompletionTool tool)
Adds a single ChatCompletionTool to tools.
-
topP
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder topP(Double topP)
An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
-
topP
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder topP(JsonField<Double> topP)
Sets Builder.topP to an arbitrary JSON value.
You should usually call Builder.topP with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final CreateEvalCompletionsRunDataSource.SamplingParams.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final CreateEvalCompletionsRunDataSource.SamplingParams build()
Returns an immutable instance of SamplingParams.
Further updates to this Builder will not mutate the returned instance.
-
-
-
-