Class AskInput.Builder
- java.lang.Object
-
- de.xima.fc.prompt.ms.impl.service.generic_oai.client.model.AskInput.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AskInput.BuilderaddFile(FileContent file)Adds a file to be included in the request.AskInputbuild()Creates a new request instance from the builder.AskInput.Builderfiles(List<FileContent> files)Sets the optional file to include in the request.AskInput.BuilderfrequencyPenalty(Double frequencyPenalty)Number between -2.0 and 2.0.AskInput.BuilderjsonSchema(String jsonSchema)Sets the JSON schema for the response format, as a serialized string.AskInput.BuilderjsonSchemaDescription(String jsonSchemaDescription)Sets the description of the JSON schema to aid the model in understanding the purpose of the schema.AskInput.BuilderjsonSchemaName(String jsonSchemaName)The name of the JSON schema, to aid the model in understanding the purpose of the schema.AskInput.BuildermaxTokens(long maxTokens)Sets the maximum number of new tokens to generate.AskInput.Buildermodel(String model)Sets the model to use for the request.AskInput.BuilderpresencePenalty(Double presencePenalty)Number between -2.0 and 2.0.AskInput.Builderprompt(String prompt)Sets the prompt for the request.AskInput.BuilderreasoningEffort(String reasoningEffort)Constrains effort on reasoning for reasoning models.AskInput.BuildersafetyIdentifier(String safetyIdentifier)A stable identifier used to help detect users of your application that may be violating the service's usage policies.AskInput.Buildersystem(String system)Sets the optional system prompt to guide the model's behavior.AskInput.Buildertemperature(double temperature)Sets the temperature for the request.AskInput.BuildertopP(double topP)Sets the top-p value for the request.
-
-
-
Method Detail
-
addFile
@CanIgnoreReturnValue public AskInput.Builder addFile(FileContent file)
Adds a file to be included in the request. If given, the model will use the file as context for generating a response.- Parameters:
file- The file to be included in the request.- Returns:
- The builder for chaining method calls.
-
build
public AskInput build()
Creates a new request instance from the builder.- Returns:
- The new request instance.
-
files
@CanIgnoreReturnValue public AskInput.Builder files(List<FileContent> files)
Sets the optional file to include in the request. If given, the model will use the file as context for generating a response.- Parameters:
files- The files to be included in the request.- Returns:
- The builder for chaining method calls.
-
frequencyPenalty
@CanIgnoreReturnValue public AskInput.Builder frequencyPenalty(Double frequencyPenalty)
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.- Parameters:
frequencyPenalty- The frequency penalty.- Returns:
- The builder for chaining method calls.
-
jsonSchema
@CanIgnoreReturnValue public AskInput.Builder jsonSchema(String jsonSchema)
Sets the JSON schema for the response format, as a serialized string.- Parameters:
jsonSchema- The JSON schema, serialized as a string.- Returns:
- The builder for chaining method calls.
-
jsonSchemaDescription
@CanIgnoreReturnValue public AskInput.Builder jsonSchemaDescription(String jsonSchemaDescription)
Sets the description of the JSON schema to aid the model in understanding the purpose of the schema.- Parameters:
jsonSchemaDescription- The description of the JSON schema.- Returns:
- The builder for chaining method calls.
-
jsonSchemaName
@CanIgnoreReturnValue public AskInput.Builder jsonSchemaName(String jsonSchemaName)
The name of the JSON schema, to aid the model in understanding the purpose of the schema.- Parameters:
jsonSchemaName- The name of the JSON schema.- Returns:
- The builder for chaining method calls.
-
maxTokens
@CanIgnoreReturnValue public AskInput.Builder maxTokens(long maxTokens)
Sets the maximum number of new tokens to generate. Must be greater than or equal to 1. Default is implementation-specific.- Parameters:
maxTokens- The maximum number of tokens to generate.- Returns:
- The builder for chaining method calls.
-
model
public AskInput.Builder model(String model)
Sets the model to use for the request.- Parameters:
model- The model to use for the request.- Returns:
- The builder for chaining method calls.
-
presencePenalty
@CanIgnoreReturnValue public AskInput.Builder presencePenalty(Double presencePenalty)
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.- Parameters:
presencePenalty- The presence penalty.- Returns:
- The builder for chaining method calls.
-
prompt
@CanIgnoreReturnValue public AskInput.Builder prompt(String prompt)
Sets the prompt for the request. This is required.- Parameters:
prompt- The prompt for the request.- Returns:
- The builder for chaining method calls.
-
reasoningEffort
@CanIgnoreReturnValue public AskInput.Builder reasoningEffort(String reasoningEffort)
Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.- Parameters:
reasoningEffort- The reasoning effort.- Returns:
- The builder for chaining method calls.
-
safetyIdentifier
@CanIgnoreReturnValue public AskInput.Builder safetyIdentifier(String safetyIdentifier)
A stable identifier used to help detect users of your application that may be violating the service's usage policies. The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information.- Parameters:
safetyIdentifier- The stable identifier.- Returns:
- The builder for chaining method calls.
-
system
@CanIgnoreReturnValue public AskInput.Builder system(String system)
Sets the optional system prompt to guide the model's behavior.- Parameters:
system- The system prompt to guide the model's behavior.- Returns:
- The builder for chaining method calls.
-
temperature
@CanIgnoreReturnValue public AskInput.Builder temperature(double temperature)
Sets the temperature for the request. Must be between 0 and 1. Default is implementation-specific.- Parameters:
temperature- The temperature for the request.- Returns:
- The builder for chaining method calls.
-
topP
@CanIgnoreReturnValue public AskInput.Builder topP(double topP)
Sets the top-p value for the request. Must be between 0 and 1. Default is implementation-specific.- Parameters:
topP- The top-p value for the request.- Returns:
- The builder for chaining method calls.
-
-