Package dyntabs.ai.cdi
Class EasyAIExtension
java.lang.Object
dyntabs.ai.cdi.EasyAIExtension
- All Implemented Interfaces:
jakarta.enterprise.inject.spi.Extension
CDI Extension that discovers interfaces annotated with
EasyAIAssistant
and produces injectable ApplicationScoped beans for them.
Basic usage — just inject:
@Inject SupportBot bot; // automatically created and ready to use
With auto-wired tools — declare tool classes in the annotation, the extension resolves their CDI/EJB instances automatically:
@EasyAIAssistant(
systemMessage = "You are a sales bot",
tools = {OrderService.class, InventoryService.class}
)
public interface SalesBot { String ask(String question); }
@Inject SalesBot bot; // OrderService and InventoryService are wired in
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterBeanDiscovery(jakarta.enterprise.inject.spi.AfterBeanDiscovery abd, jakarta.enterprise.inject.spi.BeanManager bm) <T> voidprocessAnnotatedType(jakarta.enterprise.inject.spi.ProcessAnnotatedType<T> pat)
-
Constructor Details
-
EasyAIExtension
public EasyAIExtension()
-
-
Method Details
-
processAnnotatedType
public <T> void processAnnotatedType(@Observes jakarta.enterprise.inject.spi.ProcessAnnotatedType<T> pat) -
afterBeanDiscovery
public void afterBeanDiscovery(@Observes jakarta.enterprise.inject.spi.AfterBeanDiscovery abd, jakarta.enterprise.inject.spi.BeanManager bm)
-