Class VectorServiceOptions

java.lang.Object
com.datastax.astra.client.core.vectorize.VectorServiceOptions

public class VectorServiceOptions extends Object
Configuration options for the Vector Service.

This class provides customizable options such as LLM provider, model name, authentication credentials, and free-form parameters to configure a vector service.

Example usage:


 VectorServiceOptions options = new VectorServiceOptions()
     .provider("OpenAI")
     .modelName("gpt-4")
     .addAuthentication("apiKey", "your-key")
     .parameters(Map.of("temperature", 0.7));
 
  • Constructor Details

    • VectorServiceOptions

      public VectorServiceOptions()
      Default constructor for serialization purposes.
  • Method Details

    • addAuthentication

      public VectorServiceOptions addAuthentication(String key, Object value)
      Adds a single authentication key-value pair to the authentication map.
      Parameters:
      key - the key for the authentication entry
      value - the value for the authentication entry
      Returns:
      the current VectorServiceOptions instance for method chaining
    • authentication

      public VectorServiceOptions authentication(Map<String,Object> auth)
      Sets the authentication map.
      Parameters:
      auth - the map containing authentication details
      Returns:
      the current VectorServiceOptions instance for method chaining
    • modelName

      public VectorServiceOptions modelName(String modelName)
      Sets the LLM model name.
      Parameters:
      modelName - the name of the model
      Returns:
      the current VectorServiceOptions instance for method chaining
    • provider

      public VectorServiceOptions provider(String provider)
      Sets the LLM provider.
      Parameters:
      provider - the name of the provider
      Returns:
      the current VectorServiceOptions instance for method chaining
    • parameters

      public VectorServiceOptions parameters(Map<String,Object> parameters)
      Sets the parameters map.
      Parameters:
      parameters - a map of free-form parameters
      Returns:
      the current VectorServiceOptions instance for method chaining