Class AllowsReflectionRemapper

java.lang.Object
io.micronaut.langchain4j.processor.AllowsReflectionRemapper
All Implemented Interfaces:
io.micronaut.inject.annotation.AnnotationRemapper
Direct Known Subclasses:
AllowsReflectionRemapper.Agentic, AllowsReflectionRemapper.AgenticDeclarative, AllowsReflectionRemapper.AiServices, AllowsReflectionRemapper.StructuredOutputs, AllowsReflectionRemapper.Tools

@Internal public abstract sealed class AllowsReflectionRemapper extends Object implements io.micronaut.inject.annotation.AnnotationRemapper permits AllowsReflectionRemapper.AiServices, AllowsReflectionRemapper.Agentic, AllowsReflectionRemapper.AgenticDeclarative, AllowsReflectionRemapper.Tools, AllowsReflectionRemapper.StructuredOutputs
Adds the AllowsReflection stereotype 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 @AllowsReflection or the micronaut.introspection.allow-reflection option.

An AnnotationRemapper applies to the annotations of exactly one package: a subclass is registered per package.

Since:
2.4.0
  • Method Details

    • getPackageName

      public final String getPackageName()
      Specified by:
      getPackageName in interface io.micronaut.inject.annotation.AnnotationRemapper
    • remap

      public final List<io.micronaut.core.annotation.AnnotationValue<?>> remap(io.micronaut.core.annotation.AnnotationValue<?> annotation, io.micronaut.inject.visitor.VisitorContext visitorContext)
      Specified by:
      remap in interface io.micronaut.inject.annotation.AnnotationRemapper