Class AgenticServiceInterceptor
java.lang.Object
io.micronaut.langchain4j.agentic.AgenticServiceInterceptor
- All Implemented Interfaces:
io.micronaut.aop.Interceptor<Object,Object>, io.micronaut.aop.MethodInterceptor<Object, Object>, io.micronaut.core.order.Ordered
@InterceptorBean(AgenticService.class)
public final class AgenticServiceInterceptor
extends Object
implements io.micronaut.aop.MethodInterceptor<Object,Object>
Interceptor that builds and caches a LangChain4j declarative agentic service instance
from an interface annotated with
AgenticService.
Agents are created via AgenticServiceFactory.buildAgenticService(BeanContext, AgenticServiceInfo)
which delegates to LangChain4j's declarative API (AgenticServices.createAgenticSystem).-
Field Summary
FieldsFields inherited from interface io.micronaut.aop.Interceptor
ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGETFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionAgenticServiceInterceptor(io.micronaut.context.BeanContext beanContext, AgentRegistry agentRegistry, AgenticServiceFactory agenticServiceFactory) -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.aop.MethodInterceptor
interceptMethods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Field Details
-
TOOLS_MEMBER
- See Also:
-
NAMED_MEMBER
- See Also:
-
OUTPUT_KEY_MEMBER
- See Also:
-
-
Constructor Details
-
AgenticServiceInterceptor
public AgenticServiceInterceptor(io.micronaut.context.BeanContext beanContext, AgentRegistry agentRegistry, AgenticServiceFactory agenticServiceFactory)
-
-
Method Details
-
intercept
-
resolveAgentInterface
For Micronaut introduction proxies (e.g. GreeterAgent$Intercepted), return the original agent interface annotated withAgenticService, otherwise return the given type.- Parameters:
beanType- The bean type that may be an intercepted class- Returns:
- The agent interface annotated with
AgenticServiceor the provided type if already an interface
-