Class InteractionParams.ModelInteractionParams.Builder
java.lang.Object
io.github.glaforge.gemini.interactions.model.InteractionParams.ModelInteractionParams.Builder
- Enclosing class:
InteractionParams.ModelInteractionParams
Builder for CreateModelInteractionParams.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackground(Boolean background) Sets the background flag.build()Builds the CreateModelInteractionParams.generationConfig(Config.GenerationConfig generationConfig) Sets the generation config.imageConfig(Config.ImageConfig imageConfig) Sets the image config.Sets the input content as a list of Content objects.input(Interaction.Turn... turns) Sets the input content as a list of Turns (multi-turn history).Sets the input content as a string.inputContents(List<Content> content) Sets the input content as a list of Content objects.inputTurns(List<Interaction.Turn> turns) Sets the input content as a list of Turns (multi-turn history).Sets the model.previousInteractionId(String previousInteractionId) Sets the previous interaction ID.responseFormat(Schema schema) Sets the response format using a Schema object.responseFormat(Object responseFormat) Sets the response format.responseMimeType(String responseMimeType) Sets the response MIME type.responseModalities(Interaction.Modality... responseModalities) Sets the response modalities.responseModalities(List<Interaction.Modality> responseModalities) Sets the response modalities.speechConfig(Config.SpeechConfig speechConfig) Sets the speech config.speechConfigs(List<Config.SpeechConfig> speechConfigs) Sets the speech configs.Sets the store flag.Sets the stream flag.systemInstruction(String systemInstruction) Sets the system instruction.Sets the tools.Sets the tools.
-
Constructor Details
-
Builder
public Builder()Creates a new Builder.
-
-
Method Details
-
model
Sets the model.- Parameters:
model- The model to use.- Returns:
- This builder.
-
input
Sets the input content as a string.- Parameters:
text- The input text.- Returns:
- This builder.
-
input
Sets the input content as a list of Content objects.- Parameters:
content- The input content.- Returns:
- This builder.
-
inputContents
Sets the input content as a list of Content objects.- Parameters:
content- The input content.- Returns:
- This builder.
-
input
Sets the input content as a list of Turns (multi-turn history).- Parameters:
turns- The input turns.- Returns:
- This builder.
-
inputTurns
Sets the input content as a list of Turns (multi-turn history).- Parameters:
turns- The input turns.- Returns:
- This builder.
-
generationConfig
public InteractionParams.ModelInteractionParams.Builder generationConfig(Config.GenerationConfig generationConfig) Sets the generation config.- Parameters:
generationConfig- The generation configuration.- Returns:
- This builder.
-
tools
Sets the tools.- Parameters:
tools- The tools.- Returns:
- This builder.
-
tools
Sets the tools.- Parameters:
tools- The list of tools.- Returns:
- This builder.
-
stream
Sets the stream flag.- Parameters:
stream- Whether to stream the response.- Returns:
- This builder.
-
store
Sets the store flag.- Parameters:
store- Whether to store the interaction.- Returns:
- This builder.
-
background
Sets the background flag.- Parameters:
background- Whether to run in background.- Returns:
- This builder.
-
systemInstruction
Sets the system instruction.- Parameters:
systemInstruction- The system instruction.- Returns:
- This builder.
-
responseModalities
public InteractionParams.ModelInteractionParams.Builder responseModalities(Interaction.Modality... responseModalities) Sets the response modalities.- Parameters:
responseModalities- The response modalities.- Returns:
- This builder.
-
responseModalities
public InteractionParams.ModelInteractionParams.Builder responseModalities(List<Interaction.Modality> responseModalities) Sets the response modalities.- Parameters:
responseModalities- The response modalities.- Returns:
- This builder.
-
responseFormat
Sets the response format.- Parameters:
responseFormat- The response format.- Returns:
- This builder.
-
responseFormat
Sets the response format using a Schema object.- Parameters:
schema- The schema to use as response format.- Returns:
- This builder.
-
responseMimeType
Sets the response MIME type.- Parameters:
responseMimeType- The response MIME type.- Returns:
- This builder.
-
previousInteractionId
public InteractionParams.ModelInteractionParams.Builder previousInteractionId(String previousInteractionId) Sets the previous interaction ID.- Parameters:
previousInteractionId- The previous interaction ID.- Returns:
- This builder.
-
imageConfig
Sets the image config.- Parameters:
imageConfig- The image configuration.- Returns:
- This builder.
-
speechConfig
public InteractionParams.ModelInteractionParams.Builder speechConfig(Config.SpeechConfig speechConfig) Sets the speech config.- Parameters:
speechConfig- The speech configuration.- Returns:
- This builder.
-
speechConfigs
public InteractionParams.ModelInteractionParams.Builder speechConfigs(List<Config.SpeechConfig> speechConfigs) Sets the speech configs.- Parameters:
speechConfigs- The speech configurations.- Returns:
- This builder.
-
build
Builds the CreateModelInteractionParams.- Returns:
- The CreateModelInteractionParams parameters.
-