Class AgentsConfig.BuilderBase<BUILDER extends AgentsConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AgentsConfig>
- 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:
AgentsConfig.Builder
- Enclosing interface:
AgentsConfig
AgentsConfig.-
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 TypeMethodDescriptionaddInputGuardrail(Class<? extends dev.langchain4j.guardrail.InputGuardrail> inputGuardrail) Input guardrail classes to apply to the agent.addInputGuardrails(Set<Class<? extends dev.langchain4j.guardrail.InputGuardrail>> inputGuardrails) Input guardrail classes to apply to the agent.addMcpClients(Set<String> mcpClients) Names ofMcpClientservices to use for MCP-backed tools.addOutputGuardrail(Class<? extends dev.langchain4j.guardrail.OutputGuardrail> outputGuardrail) Output guardrail classes to apply to the agent.addOutputGuardrails(Set<Class<? extends dev.langchain4j.guardrail.OutputGuardrail>> outputGuardrails) Output guardrail classes to apply to the agent.Tool service classes to register with the agent.async()If true, the agent will be invoked in an asynchronous manner, allowing the workflow to continue without waiting for the agent's result.async(boolean async) If true, the agent will be invoked in an asynchronous manner, allowing the workflow to continue without waiting for the agent's result.Name of theChatMemoryservice to use for this agent.chatMemory(String chatMemory) Name of theChatMemoryservice to use for this agent.Name of theChatMemoryProviderservice to use for this agent.chatMemoryProvider(String chatMemoryProvider) Name of theChatMemoryProviderservice to use for this agent.Name of theChatModelservice to use for this agent.Name of theChatModelservice to use for this agent.Clear existing value of async.Clear existing value of chatMemory.Clear existing value of chatMemoryProvider.Clear existing value of chatModel.Clear existing value of contentRetriever.Clear existing value of description.Clear existing value of executeToolsConcurrently.Clear all inputGuardrails.Clear all mcpClients.Clear existing value of name.Clear all outputGuardrails.Clear existing value of outputKey.Clear existing value of retrievalAugmentor.Clear existing value of toolProvider.Clear all tools.config()Configuration used to configure this instance.Deprecated.Update builder from configuration (node of this type).Name of theContentRetrieverservice to use for this agent.contentRetriever(String contentRetriever) Name of theContentRetrieverservice to use for this agent.Description of the agent.description(String description) Description of the agent.booleanenabled()If set tofalse, agent will not be available even if configured.enabled(boolean enabled) If set tofalse, agent will not be available even if configured.If true, the agent's tools can be invoked in a concurrent manner.executeToolsConcurrently(boolean executeToolsConcurrently) If true, the agent's tools can be invoked in a concurrent manner.from(AgentsConfig prototype) Update this builder from an existing prototype instance.from(AgentsConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Input guardrail classes to apply to the agent.inputGuardrails(Set<Class<? extends dev.langchain4j.guardrail.InputGuardrail>> inputGuardrails) Input guardrail classes to apply to the agent.Names ofMcpClientservices to use for MCP-backed tools.mcpClients(Set<String> mcpClients) Names ofMcpClientservices to use for MCP-backed tools.name()Agent identifier used to label the agent in workflows and/or agent registries.Agent identifier used to label the agent in workflows and/or agent registries.Output guardrail classes to apply to the agent.outputGuardrails(Set<Class<? extends dev.langchain4j.guardrail.OutputGuardrail>> outputGuardrails) Output guardrail classes to apply to the agent.Key of the output variable that will be used to store the result of the agent's invocation.Key of the output variable that will be used to store the result of the agent's invocation.protected voidHandles providers and decorators.Name of theRetrievalAugmentorservice to use for this agent.retrievalAugmentor(String retrievalAugmentor) Name of theRetrievalAugmentorservice to use for this agent.Name of theToolProviderservice to use for this agent.toolProvider(String toolProvider) Name of theToolProviderservice to use for this agent.tools()Tool service classes to register with the agent.Tool service classes to register with the agent.toString()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 AgentsConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends AgentsConfig> - 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 AgentsConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends AgentsConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
enabled
If set tofalse, agent will not be available even if configured.- Parameters:
enabled- whether agent is enabled, defaults totrue- Returns:
- updated builder instance
- See Also:
-
clearName
Clear existing value of name.- Returns:
- updated builder instance
- See Also:
-
name
Agent identifier used to label the agent in workflows and/or agent registries.If configured, this value is applied to the underlying agent builder via
agentBuilder.name(...).- Parameters:
name- configured agent name, or empty if not configured- Returns:
- updated builder instance
- See Also:
-
clearDescription
Clear existing value of description.- Returns:
- updated builder instance
- See Also:
-
description
Description of the agent. It should be clear and descriptive to allow a language model to understand the agent's purpose and its intended use.- Parameters:
description- description of the agent.- Returns:
- updated builder instance
- See Also:
-
clearOutputKey
Clear existing value of outputKey.- Returns:
- updated builder instance
- See Also:
-
outputKey
Key of the output variable that will be used to store the result of the agent's invocation.- Parameters:
outputKey- name of the output variable.- Returns:
- updated builder instance
- See Also:
-
clearAsync
Clear existing value of async.- Returns:
- updated builder instance
- See Also:
-
async
If true, the agent will be invoked in an asynchronous manner, allowing the workflow to continue without waiting for the agent's result.- Parameters:
async- true if the agent should be invoked asynchronously, false otherwise.- Returns:
- updated builder instance
- See Also:
-
clearExecuteToolsConcurrently
Clear existing value of executeToolsConcurrently.- Returns:
- updated builder instance
- See Also:
-
executeToolsConcurrently
If true, the agent's tools can be invoked in a concurrent manner.- Parameters:
executeToolsConcurrently- true if agent's tools can be invoked concurrently.- Returns:
- updated builder instance
- See Also:
-
clearChatModel
Clear existing value of chatModel.- Returns:
- updated builder instance
- See Also:
-
chatModel
Name of theChatModelservice to use for this agent.The value is resolved from the
ServiceRegistry.- Parameters:
chatModel- configured name of the chat model service, or empty if not configured- Returns:
- updated builder instance
- See Also:
-
clearChatMemory
Clear existing value of chatMemory.- Returns:
- updated builder instance
- See Also:
-
chatMemory
Name of theChatMemoryservice to use for this agent.The value is resolved from the
ServiceRegistry.- Parameters:
chatMemory- configured name of the chat memory service, or empty if not configured- Returns:
- updated builder instance
- See Also:
-
clearChatMemoryProvider
Clear existing value of chatMemoryProvider.- Returns:
- updated builder instance
- See Also:
-
chatMemoryProvider
Name of theChatMemoryProviderservice to use for this agent.The value is resolved from the
ServiceRegistry.- Parameters:
chatMemoryProvider- configured name of the chat memory provider service, or empty if not configured- Returns:
- updated builder instance
- See Also:
-
clearContentRetriever
Clear existing value of contentRetriever.- Returns:
- updated builder instance
- See Also:
-
contentRetriever
Name of theContentRetrieverservice to use for this agent.The value is resolved from the
ServiceRegistry.- Parameters:
contentRetriever- configured name of the content retriever service, or empty if not configured- Returns:
- updated builder instance
- See Also:
-
clearRetrievalAugmentor
Clear existing value of retrievalAugmentor.- Returns:
- updated builder instance
- See Also:
-
retrievalAugmentor
Name of theRetrievalAugmentorservice to use for this agent.The value is resolved from the
ServiceRegistry.- Parameters:
retrievalAugmentor- configured name of the retrieval augmentor service, or empty if not configured- Returns:
- updated builder instance
- See Also:
-
clearToolProvider
Clear existing value of toolProvider.- Returns:
- updated builder instance
- See Also:
-
toolProvider
Name of theToolProviderservice to use for this agent.The value is resolved from the
ServiceRegistry.- Parameters:
toolProvider- configured name of the tool provider service, or empty if not configured- Returns:
- updated builder instance
- See Also:
-
clearTools
Clear all tools.- Returns:
- updated builder instance
- See Also:
-
tools
Tool service classes to register with the agent.Each class is resolved from the
ServiceRegistry, and the resulting service instances are registered usingagentBuilder.tools(...).- Parameters:
tools- configured set of tool classes, or an empty set if not configured- Returns:
- updated builder instance
- See Also:
-
addTools
Tool service classes to register with the agent.Each class is resolved from the
ServiceRegistry, and the resulting service instances are registered usingagentBuilder.tools(...).- Parameters:
tools- configured set of tool classes, or an empty set if not configured- Returns:
- updated builder instance
- See Also:
-
clearMcpClients
Clear all mcpClients.- Returns:
- updated builder instance
- See Also:
-
mcpClients
Names ofMcpClientservices to use for MCP-backed tools.Each name is resolved from the
ServiceRegistry, the clients are then used to build anMcpToolProviderwhich is registered as the agent's tool provider.- Parameters:
mcpClients- configured set of MCP client service names, or an empty set if not configured- Returns:
- updated builder instance
- See Also:
-
addMcpClients
Names ofMcpClientservices to use for MCP-backed tools.Each name is resolved from the
ServiceRegistry, the clients are then used to build anMcpToolProviderwhich is registered as the agent's tool provider.- Parameters:
mcpClients- configured set of MCP client service names, or an empty set if not configured- Returns:
- updated builder instance
- See Also:
-
clearInputGuardrails
Clear all inputGuardrails.- Returns:
- updated builder instance
- See Also:
-
inputGuardrails
public BUILDER inputGuardrails(Set<Class<? extends dev.langchain4j.guardrail.InputGuardrail>> inputGuardrails) Input guardrail classes to apply to the agent.Each class is resolved from the
ServiceRegistry.- Parameters:
inputGuardrails- configured set of input guardrail classes, or an empty set if not configured- Returns:
- updated builder instance
- See Also:
-
addInputGuardrails
public BUILDER addInputGuardrails(Set<Class<? extends dev.langchain4j.guardrail.InputGuardrail>> inputGuardrails) Input guardrail classes to apply to the agent.Each class is resolved from the
ServiceRegistry.- Parameters:
inputGuardrails- configured set of input guardrail classes, or an empty set if not configured- Returns:
- updated builder instance
- See Also:
-
addInputGuardrail
public BUILDER addInputGuardrail(Class<? extends dev.langchain4j.guardrail.InputGuardrail> inputGuardrail) Input guardrail classes to apply to the agent.Each class is resolved from the
ServiceRegistry.- Parameters:
inputGuardrail- add single configured set of input guardrail classes, or an empty set if not configured- Returns:
- updated builder instance
- See Also:
-
clearOutputGuardrails
Clear all outputGuardrails.- Returns:
- updated builder instance
- See Also:
-
outputGuardrails
public BUILDER outputGuardrails(Set<Class<? extends dev.langchain4j.guardrail.OutputGuardrail>> outputGuardrails) Output guardrail classes to apply to the agent.Each class is resolved from the
ServiceRegistry,- Parameters:
outputGuardrails- configured set of output guardrail classes, or an empty set if not configured- Returns:
- updated builder instance
- See Also:
-
addOutputGuardrails
public BUILDER addOutputGuardrails(Set<Class<? extends dev.langchain4j.guardrail.OutputGuardrail>> outputGuardrails) Output guardrail classes to apply to the agent.Each class is resolved from the
ServiceRegistry,- Parameters:
outputGuardrails- configured set of output guardrail classes, or an empty set if not configured- Returns:
- updated builder instance
- See Also:
-
addOutputGuardrail
public BUILDER addOutputGuardrail(Class<? extends dev.langchain4j.guardrail.OutputGuardrail> outputGuardrail) Output guardrail classes to apply to the agent.Each class is resolved from the
ServiceRegistry,- Parameters:
outputGuardrail- add single configured set of output guardrail classes, or an empty set if not configured- Returns:
- updated builder instance
- See Also:
-
enabled
public boolean enabled()If set tofalse, agent will not be available even if configured.- Returns:
- whether agent is enabled, defaults to
true
-
name
Agent identifier used to label the agent in workflows and/or agent registries.If configured, this value is applied to the underlying agent builder via
agentBuilder.name(...).- Returns:
- configured agent name, or empty if not configured
-
description
Description of the agent. It should be clear and descriptive to allow a language model to understand the agent's purpose and its intended use.- Returns:
- description of the agent.
-
outputKey
Key of the output variable that will be used to store the result of the agent's invocation.- Returns:
- name of the output variable.
-
async
If true, the agent will be invoked in an asynchronous manner, allowing the workflow to continue without waiting for the agent's result.- Returns:
- true if the agent should be invoked asynchronously, false otherwise.
-
executeToolsConcurrently
If true, the agent's tools can be invoked in a concurrent manner.- Returns:
- true if agent's tools can be invoked concurrently.
-
chatModel
Name of theChatModelservice to use for this agent.The value is resolved from the
ServiceRegistry.- Returns:
- configured name of the chat model service, or empty if not configured
-
chatMemory
Name of theChatMemoryservice to use for this agent.The value is resolved from the
ServiceRegistry.- Returns:
- configured name of the chat memory service, or empty if not configured
-
chatMemoryProvider
Name of theChatMemoryProviderservice to use for this agent.The value is resolved from the
ServiceRegistry.- Returns:
- configured name of the chat memory provider service, or empty if not configured
-
contentRetriever
Name of theContentRetrieverservice to use for this agent.The value is resolved from the
ServiceRegistry.- Returns:
- configured name of the content retriever service, or empty if not configured
-
retrievalAugmentor
Name of theRetrievalAugmentorservice to use for this agent.The value is resolved from the
ServiceRegistry.- Returns:
- configured name of the retrieval augmentor service, or empty if not configured
-
toolProvider
Name of theToolProviderservice to use for this agent.The value is resolved from the
ServiceRegistry.- Returns:
- configured name of the tool provider service, or empty if not configured
-
tools
Tool service classes to register with the agent.Each class is resolved from the
ServiceRegistry, and the resulting service instances are registered usingagentBuilder.tools(...).- Returns:
- configured set of tool classes, or an empty set if not configured
-
mcpClients
Names ofMcpClientservices to use for MCP-backed tools.Each name is resolved from the
ServiceRegistry, the clients are then used to build anMcpToolProviderwhich is registered as the agent's tool provider.- Returns:
- configured set of MCP client service names, or an empty set if not configured
-
inputGuardrails
Input guardrail classes to apply to the agent.Each class is resolved from the
ServiceRegistry.- Returns:
- configured set of input guardrail classes, or an empty set if not configured
-
outputGuardrails
Output guardrail classes to apply to the agent.Each class is resolved from the
ServiceRegistry,- Returns:
- configured set of output guardrail classes, or an empty set if not 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)