Package io.micronaut.langchain4j.processor
@NullMarked
package io.micronaut.langchain4j.processor
Annotation processing: the model configurations, factories and native image metadata.
-
ClassesClassDescriptionAdds the
AllowsReflectionstereotype to the LangChain4j annotations that LangChain4j reads reflectively from the Java class (@SystemMessage,@UserMessage,@V,@Agent,@SequenceAgent,@Description, ...), so that a compiler generating the Java class for a declaration written in another language (the Python compiler) copies them onto the generated class without the user declaring@AllowsReflectionor themicronaut.introspection.allow-reflectionoption.The@Agentannotation.The declarative agentic annotations:@SequenceAgent,@ParallelAgent,@Output, ...The annotations of AI services:@SystemMessage,@UserMessage,@V,@MemoryId, ...The@Descriptionannotation of the structured outputs.The tool annotations:@Tool,@P,@ToolMemoryId, ...Makes theCompensateFormethods executable, so that the tool registry finds them without reflection and reports that their compensating actions are not registered.Writes the GraalVM native image metadata (META-INF/native-image/.../reachability-metadata.json) of the types LangChain4j still reads and implements reflectively: the AI service interfaces, which LangChain4j implements withProxyand whose methods, annotations and parameters it reads reflectively, and the agentic services and agents, which LangChain4j also implements with proxies combining the agent type with its own interfaces and whose static@Agent,@Output,@ExitCondition, ...When Micronaut Serialization is on the annotation processor path, imports into it (@SerdeImport) the records LangChain4j maps to and from JSON: the structured outputs of the AI services and agents, and the parameters and results of the tools, with the records they are made of.