public static class GenerativeModel.Builder extends Object
GenerativeModel.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
GenerativeModel |
build() |
GenerativeModel.Builder |
setGenerationConfig(GenerationConfig generationConfig)
Sets
GenerationConfig that will be used by default to
interact with the generative model. |
GenerativeModel.Builder |
setModelName(String modelName)
Sets the name of the generative model.
|
GenerativeModel.Builder |
setSafetySettings(List<SafetySetting> safetySettings)
Sets a list of
SafetySetting that will be used by
default to interact with the generative model. |
GenerativeModel.Builder |
setSystemInstruction(Content systemInstruction)
Sets a system instruction that will be used by default to interact with the generative model.
|
GenerativeModel.Builder |
setToolConfig(ToolConfig toolConfig)
Sets a
ToolConfig that will be used by default to
interact with the generative model. |
GenerativeModel.Builder |
setTools(List<Tool> tools)
Sets a list of
Tool that will be used by default to
interact with the generative model. |
GenerativeModel.Builder |
setVertexAi(VertexAI vertexAi)
Sets
VertexAI that contains the default configs for the
generative model. |
public GenerativeModel build()
@CanIgnoreReturnValue public GenerativeModel.Builder setModelName(String modelName)
@CanIgnoreReturnValue public GenerativeModel.Builder setVertexAi(VertexAI vertexAi)
VertexAI that contains the default configs for the
generative model. This is required for building a GenerativeModel instance.@CanIgnoreReturnValue public GenerativeModel.Builder setGenerationConfig(GenerationConfig generationConfig)
GenerationConfig that will be used by default to
interact with the generative model.@CanIgnoreReturnValue public GenerativeModel.Builder setSafetySettings(List<SafetySetting> safetySettings)
SafetySetting that will be used by
default to interact with the generative model.@CanIgnoreReturnValue public GenerativeModel.Builder setTools(List<Tool> tools)
Tool that will be used by default to
interact with the generative model.@CanIgnoreReturnValue public GenerativeModel.Builder setToolConfig(ToolConfig toolConfig)
ToolConfig that will be used by default to
interact with the generative model.@CanIgnoreReturnValue public GenerativeModel.Builder setSystemInstruction(Content systemInstruction)
Copyright © 2025 Google LLC. All rights reserved.