Class ResolvedParameters
java.lang.Object
dev.langchain4j.agentic.internal.ResolvedParameters
The parameters of a static method declared on an agent type, split once, when the agent is created, between the
parameters provided by a registered
SupplierParameterResolver and the parameters provided by the agentic
framework, like the AgenticScope, its state, the memory id or a value passed by the caller.
Only the parameters provided by the framework are agent arguments: the resolved ones are never read from the
AgenticScope, nor reported to listeners and planners.
-
Method Summary
Modifier and TypeMethodDescriptionObject[]Builds the positional arguments of the method, resolving its resolved parameters and taking the parameters provided by the framework from the given values, in their order.Checks that all the parameters are provided by a resolver, as required for the methods, like the suppliers of tools or of the planner, that are invoked without any value from the framework.checkFrameworkParameters(Class<?>... expected) Checks that the parameters provided by the framework are exactly the expected ones, in this order.frameworkParameter(int position) intinvocationArguments(AgenticScope agenticScope, Map<String, Object> additionalArgs, boolean writeConvertedValues) Builds the invocation arguments of the method: the parameters provided by the framework are read from theAgenticScope, or taken from the additional arguments, and they are the only named arguments.<T> TInvokes the static method, with the parameters provided by the framework taken from the given values.method()static ResolvedParametersSplits the parameters of the given method using theSupplierParameterResolvers registered inDeclarativeUtil.
-
Method Details
-
of
Splits the parameters of the given method using theSupplierParameterResolvers registered inDeclarativeUtil.- Parameters:
agentType- the agent class or interface declaring the method, or inheriting itmethod- the static method to invoke
-
method
-
frameworkArguments
- Returns:
- the parameters provided by the framework, as agent arguments, in the order they are declared
-
frameworkParameterCount
public int frameworkParameterCount()- Returns:
- the number of parameters provided by the framework
-
frameworkParameter
- Returns:
- the parameter at the given position among the ones provided by the framework
-
checkFrameworkParameters
Checks that the parameters provided by the framework are exactly the expected ones, in this order.- Throws:
IllegalArgumentException- if they are not
-
checkAllResolved
Checks that all the parameters are provided by a resolver, as required for the methods, like the suppliers of tools or of the planner, that are invoked without any value from the framework.- Throws:
AgenticSystemConfigurationException- if a parameter is not supported by any resolver
-
arguments
Builds the positional arguments of the method, resolving its resolved parameters and taking the parameters provided by the framework from the given values, in their order. The parameters provided by the framework without a corresponding value arenull. -
invocationArguments
public AgentInvocationArguments invocationArguments(AgenticScope agenticScope, Map<String, Object> additionalArgs, boolean writeConvertedValues) Builds the invocation arguments of the method: the parameters provided by the framework are read from theAgenticScope, or taken from the additional arguments, and they are the only named arguments. Without anAgenticScopethe parameters provided by the framework arenull. -
invoke
Invokes the static method, with the parameters provided by the framework taken from the given values. Failures are reported as byDeclarativeUtil.invokeStatic(Method, Object...).
-