Class InProcessEmbeddingModelConfig.BuilderBase<BUILDER extends InProcessEmbeddingModelConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends InProcessEmbeddingModelConfig>

java.lang.Object
io.helidon.integrations.langchain4j.providers.lc4jinprocess.InProcessEmbeddingModelConfig.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
InProcessEmbeddingModelConfig.Builder
Enclosing interface:
InProcessEmbeddingModelConfig

public abstract static class InProcessEmbeddingModelConfig.BuilderBase<BUILDER extends InProcessEmbeddingModelConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends InProcessEmbeddingModelConfig> extends Object implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for InProcessEmbeddingModelConfig.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(InProcessEmbeddingModelConfig prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      @Deprecated public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends InProcessEmbeddingModelConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends InProcessEmbeddingModelConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends InProcessEmbeddingModelConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends InProcessEmbeddingModelConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • enabled

      public BUILDER enabled(boolean enabled)
      Whether the embedding model is enabled. If set to false, the model will not be available even if configured.
      Parameters:
      enabled - whether the embedding model is enabled, defaults to true
      Returns:
      updated builder instance
      See Also:
    • clearExecutor

      public BUILDER clearExecutor()
      Clear existing value of executor.
      Returns:
      updated builder instance
      See Also:
    • executor

      public BUILDER executor(ThreadPoolConfig executor)
      Executor configuration used by the embedding model.
      Parameters:
      executor - optional executor configuration
      Returns:
      updated builder instance
      See Also:
    • type

      public BUILDER type(InProcessModelType type)
      Which in-process ONNX model variant should be used.
      Parameters:
      type - in-process ONNX model provided type
      Returns:
      updated builder instance
      See Also:
    • clearPathToModel

      public BUILDER clearPathToModel()
      Clear existing value of pathToModel.
      Returns:
      updated builder instance
      See Also:
    • pathToModel

      public BUILDER pathToModel(Path pathToModel)
      The path to the modelPath file (e.g., "/path/to/model.onnx").
      Parameters:
      pathToModel - an Optional containing the configured model path, or an empty Optional if not set
      Returns:
      updated builder instance
      See Also:
    • clearPathToTokenizer

      public BUILDER clearPathToTokenizer()
      Clear existing value of pathToTokenizer.
      Returns:
      updated builder instance
      See Also:
    • pathToTokenizer

      public BUILDER pathToTokenizer(Path pathToTokenizer)
      The path to the tokenizer file (e.g., "/path/to/tokenizer.json").
      Parameters:
      pathToTokenizer - an Optional containing the configured tokenizer path, or an empty Optional if not set
      Returns:
      updated builder instance
      See Also:
    • clearPoolingMode

      public BUILDER clearPoolingMode()
      Clear existing value of poolingMode.
      Returns:
      updated builder instance
      See Also:
    • poolingMode

      public BUILDER poolingMode(dev.langchain4j.model.embedding.onnx.PoolingMode poolingMode)
      The pooling model to use. Can be found in the ".../1_Pooling/config.json" file on HuggingFace. Here is an example. "pooling_mode_mean_tokens": true means that PoolingMode.MEAN should be used.
      Parameters:
      poolingMode - an Optional containing the configured PoolingMode, or an empty Optional if no pooling mode is explicitly configured
      Returns:
      updated builder instance
      See Also:
    • enabled

      public boolean enabled()
      Whether the embedding model is enabled. If set to false, the model will not be available even if configured.
      Returns:
      whether the embedding model is enabled, defaults to true
    • executor

      public Optional<ThreadPoolConfig> executor()
      Executor configuration used by the embedding model.
      Returns:
      optional executor configuration
    • type

      public Optional<InProcessModelType> type()
      Which in-process ONNX model variant should be used.
      Returns:
      in-process ONNX model provided type
    • pathToModel

      public Optional<Path> pathToModel()
      The path to the modelPath file (e.g., "/path/to/model.onnx").
      Returns:
      an Optional containing the configured model path, or an empty Optional if not set
    • pathToTokenizer

      public Optional<Path> pathToTokenizer()
      The path to the tokenizer file (e.g., "/path/to/tokenizer.json").
      Returns:
      an Optional containing the configured tokenizer path, or an empty Optional if not set
    • poolingMode

      public Optional<dev.langchain4j.model.embedding.onnx.PoolingMode> poolingMode()
      The pooling model to use. Can be found in the ".../1_Pooling/config.json" file on HuggingFace. Here is an example. "pooling_mode_mean_tokens": true means that PoolingMode.MEAN should be used.
      Returns:
      an Optional containing the configured PoolingMode, or an empty Optional if no pooling mode is explicitly configured
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.
    • config

      protected Optional<Config> config()
      Configuration used to configure this instance.
      Returns:
      config instance