Class CompatOAIPlugin.Builder
java.lang.Object
com.google.genkit.plugins.compatoai.CompatOAIPlugin.Builder
- Enclosing class:
CompatOAIPlugin
Builder for CompatOAIPlugin.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a model to register.Adds a model with a custom label.Adds multiple models.Sets the API key.Sets the base URL for API requests.build()Builds the plugin.organization(String organization) Sets the organization ID (optional).pluginName(String pluginName) Sets the plugin name.timeout(int timeout) Sets the request timeout in seconds.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
pluginName
Sets the plugin name.- Parameters:
pluginName- the plugin name (e.g., "my-provider")- Returns:
- this builder
-
apiKey
Sets the API key.- Parameters:
apiKey- the API key- Returns:
- this builder
-
baseUrl
Sets the base URL for API requests.- Parameters:
baseUrl- the base URL (e.g., "https://api.example.com/v1")- Returns:
- this builder
-
organization
Sets the organization ID (optional).- Parameters:
organization- the organization ID- Returns:
- this builder
-
timeout
Sets the request timeout in seconds.- Parameters:
timeout- the timeout- Returns:
- this builder
-
addModel
Adds a model to register.- Parameters:
modelId- the model ID (e.g., "my-model-v1")- Returns:
- this builder
-
addModel
Adds a model with a custom label.- Parameters:
modelId- the model IDlabel- the display label- Returns:
- this builder
-
addModels
Adds multiple models.- Parameters:
modelIds- the model IDs to add- Returns:
- this builder
-
build
Builds the plugin.- Returns:
- the plugin
-