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 builderPROTOTYPE- type of the prototype interface that would be built byPrototype.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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClear existing value of executor.Clear existing value of pathToModel.Clear existing value of pathToTokenizer.Clear existing value of poolingMode.config()Configuration used to configure this instance.Deprecated.Update builder from configuration (node of this type).booleanenabled()Whether the embedding model is enabled.enabled(boolean enabled) Whether the embedding model is enabled.executor()Executor configuration used by the embedding model.executor(ThreadPoolConfig executor) Executor configuration used by the embedding model.from(InProcessEmbeddingModelConfig prototype) Update this builder from an existing prototype instance.from(InProcessEmbeddingModelConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.The path to the modelPath file (e.g., "/path/to/model.onnx").pathToModel(Path pathToModel) The path to the modelPath file (e.g., "/path/to/model.onnx").The path to the tokenizer file (e.g., "/path/to/tokenizer.json").pathToTokenizer(Path pathToTokenizer) The path to the tokenizer file (e.g., "/path/to/tokenizer.json").Optional<dev.langchain4j.model.embedding.onnx.PoolingMode> The pooling model to use.poolingMode(dev.langchain4j.model.embedding.onnx.PoolingMode poolingMode) The pooling model to use.protected voidHandles providers and decorators.toString()type()Which in-process ONNX model variant should be used.type(InProcessModelType type) Which in-process ONNX model variant should be used.protected voidValidates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
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.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.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
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.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
Whether the embedding model is enabled. If set tofalse, the model will not be available even if configured.- Parameters:
enabled- whether the embedding model is enabled, defaults totrue- Returns:
- updated builder instance
- See Also:
-
clearExecutor
Clear existing value of executor.- Returns:
- updated builder instance
- See Also:
-
executor
Executor configuration used by the embedding model.- Parameters:
executor- optional executor configuration- Returns:
- updated builder instance
- See Also:
-
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
Clear existing value of pathToModel.- Returns:
- updated builder instance
- See Also:
-
pathToModel
The path to the modelPath file (e.g., "/path/to/model.onnx").- Parameters:
pathToModel- anOptionalcontaining the configured model path, or an emptyOptionalif not set- Returns:
- updated builder instance
- See Also:
-
clearPathToTokenizer
Clear existing value of pathToTokenizer.- Returns:
- updated builder instance
- See Also:
-
pathToTokenizer
The path to the tokenizer file (e.g., "/path/to/tokenizer.json").- Parameters:
pathToTokenizer- anOptionalcontaining the configured tokenizer path, or an emptyOptionalif not set- Returns:
- updated builder instance
- See Also:
-
clearPoolingMode
Clear existing value of poolingMode.- Returns:
- updated builder instance
- See Also:
-
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": truemeans thatPoolingMode.MEANshould be used.- Parameters:
poolingMode- anOptionalcontaining the configuredPoolingMode, or an emptyOptionalif no pooling mode is explicitly configured- Returns:
- updated builder instance
- See Also:
-
enabled
public boolean enabled()Whether the embedding model is enabled. If set tofalse, the model will not be available even if configured.- Returns:
- whether the embedding model is enabled, defaults to
true
-
executor
Executor configuration used by the embedding model.- Returns:
- optional executor configuration
-
type
Which in-process ONNX model variant should be used.- Returns:
- in-process ONNX model provided type
-
pathToModel
The path to the modelPath file (e.g., "/path/to/model.onnx").- Returns:
- an
Optionalcontaining the configured model path, or an emptyOptionalif not set
-
pathToTokenizer
The path to the tokenizer file (e.g., "/path/to/tokenizer.json").- Returns:
- an
Optionalcontaining the configured tokenizer path, or an emptyOptionalif not set
-
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": truemeans thatPoolingMode.MEANshould be used.- Returns:
- an
Optionalcontaining the configuredPoolingMode, or an emptyOptionalif no pooling mode is explicitly configured
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties. -
config
Configuration used to configure this instance.- Returns:
- config instance
-
config(io.helidon.config.Config)