Class AgentUtil
java.lang.Object
dev.langchain4j.agentic.internal.AgentUtil
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionagenticSystemDataTypes(AgentInstance rootAgent) static AgentInvocationArgumentsagentInvocationArguments(AgenticScope agenticScope, Method method) static AgentInvocationArgumentsagentInvocationArguments(AgenticScope agenticScope, List<AgentArgument> agentArguments) static AgentInvocationArgumentsagentInvocationArguments(AgenticScope agenticScope, List<AgentArgument> agentArguments, Map<String, Object> additionalArgs) static List<AgentExecutor> agentsToExecutors(Collection<?> agents) static AgentExecutoragentToExecutor(InternalAgent agent) static AgentExecutoragentToExecutor(Object agent) static AgentArgumentargumentFromParameter(Parameter parameter) static List<AgentArgument> argumentsFromMethod(Method method) static List<AgentArgument> argumentsFromMethod(Method method, Map<String, Object> defaultValues) static List<AgentArgument> static List<AgentArgument> argumentsFromMethod(Method method, Set<String> optionalArgs) static <T> TbuildAgent(Class<T> agentServiceClass, InvocationHandler invocationHandler) getAnnotatedMethodOnClass(Class<?> clazz, Class<? extends Annotation> annotation) static <T> TkeyDefaultValue(Class<? extends TypedKey<T>> key) static Stringstatic AgentInvokernonAiAgentInvoker(Method agenticMethod, String name, String description, String outputKey, boolean async) static AgentExecutornonAiAgentToExecutor(Object agent, Method agenticMethod) static Stringstatic Class<?> static AgentInvocationArgumentsuntypedAgentInvocationArguments(AgenticScope agenticScope) Builds the arguments for an untyped agent, which receives the wholeAgenticScopestate as a singleMap.static MethodvalidateAgentClass(Class<?> agentServiceClass) static MethodvalidateAgentClass(Class<?> agentServiceClass, boolean failOnMissingAnnotation) static MethodvalidateAgentClass(Class<?> agentServiceClass, boolean failOnMissingAnnotation, Class<? extends Annotation> patternAnnotation)
-
Field Details
-
MEMORY_ID_ARG_NAME
- See Also:
-
AGENTIC_SCOPE_ARG_NAME
- See Also:
-
LOOP_COUNTER_ARG_NAME
- See Also:
-
INVOCATION_PARAMETERS_ARG_NAME
- See Also:
-
-
Method Details
-
outputKey
-
keyDefaultValue
-
keyName
-
agentsToExecutors
-
agentToExecutor
-
nonAiAgentToExecutor
-
nonAiAgentInvoker
public static AgentInvoker nonAiAgentInvoker(Method agenticMethod, String name, String description, String outputKey, boolean async) -
agentToExecutor
-
getAnnotatedMethodOnClass
public static Optional<Method> getAnnotatedMethodOnClass(Class<?> clazz, Class<? extends Annotation> annotation) -
argumentsFromMethod
-
argumentsFromMethod
-
argumentsFromMethod
-
argumentsFromMethod
-
argumentFromParameter
-
untypedAgentInvocationArguments
Builds the arguments for an untyped agent, which receives the wholeAgenticScopestate as a singleMap. The map is a filtered copy rather than the state itself: a copy so that the recordedAgentInvocation.input()keeps the state as it was at invocation time instead of following later writes, and filtered so that values which cannot be serialized never reach the agent or the persisted invocation. -
agentInvocationArguments
public static AgentInvocationArguments agentInvocationArguments(AgenticScope agenticScope, Method method) throws MissingArgumentException - Throws:
MissingArgumentException
-
agentInvocationArguments
public static AgentInvocationArguments agentInvocationArguments(AgenticScope agenticScope, List<AgentArgument> agentArguments) throws MissingArgumentException - Throws:
MissingArgumentException
-
agentInvocationArguments
public static AgentInvocationArguments agentInvocationArguments(AgenticScope agenticScope, List<AgentArgument> agentArguments, Map<String, Object> additionalArgs) throws MissingArgumentException- Throws:
MissingArgumentException
-
validateAgentClass
-
validateAgentClass
-
validateAgentClass
public static Method validateAgentClass(Class<?> agentServiceClass, boolean failOnMissingAnnotation, Class<? extends Annotation> patternAnnotation) -
buildAgent
-
agenticSystemDataTypes
-
rawType
-