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

java.lang.Object
io.helidon.integrations.langchain4j.providers.mock.MockStreamingChatModelConfig.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:
MockStreamingChatModelConfig.Builder
Enclosing interface:
MockStreamingChatModelConfig

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

    • BuilderBase

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

    • from

      public BUILDER from(MockStreamingChatModelConfig 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 MockStreamingChatModelConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends MockStreamingChatModelConfig>
      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 MockStreamingChatModelConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends MockStreamingChatModelConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • enabled

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

      public BUILDER clearRules()
      Clear all rules.
      Returns:
      updated builder instance
      See Also:
    • rules

      public BUILDER rules(List<? extends MockChatRule> rules)
      The list of MockChatRules that the mock chat model evaluates.

      Rules can be defined in configuration under langchain4j.mock.chat-model.rules and may also be provided as Service singletons.

      Parameters:
      rules - an immutable list of mock chat rules
      Returns:
      updated builder instance
      See Also:
    • addRules

      public BUILDER addRules(List<? extends MockChatRule> rules)
      The list of MockChatRules that the mock chat model evaluates.

      Rules can be defined in configuration under langchain4j.mock.chat-model.rules and may also be provided as Service singletons.

      Parameters:
      rules - an immutable list of mock chat rules
      Returns:
      updated builder instance
      See Also:
    • addRule

      public BUILDER addRule(MockChatRule rule)
      The list of MockChatRules that the mock chat model evaluates.

      Rules can be defined in configuration under langchain4j.mock.chat-model.rules and may also be provided as Service singletons.

      Parameters:
      rule - add single an immutable list of mock chat rules
      Returns:
      updated builder instance
      See Also:
    • addRule

      public BUILDER addRule(Consumer<MockChatRuleConfig.Builder> consumer)
      The list of MockChatRules that the mock chat model evaluates.

      Rules can be defined in configuration under langchain4j.mock.chat-model.rules and may also be provided as Service singletons.

      Parameters:
      consumer - consumer of builder for an immutable list of mock chat rules
      Returns:
      updated builder instance
      See Also:
    • enabled

      public boolean enabled()
      If set to false , MockChatModel will not be available even if configured.
      Returns:
      whether MockChatModel is enabled, defaults to true
    • rules

      public List<MockChatRule> rules()
      The list of MockChatRules that the mock chat model evaluates.

      Rules can be defined in configuration under langchain4j.mock.chat-model.rules and may also be provided as Service singletons.

      Returns:
      an immutable list of mock chat rules
    • 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