Class ReflectionMetadata

java.lang.Object
io.micronaut.langchain4j.testutils.ReflectionMetadata

public final class ReflectionMetadata extends Object
Verifies the GraalVM reachability metadata a provider module ships for the LangChain4j types that are mapped with Jackson reflectively (the request and response types of the provider's REST API).

The expected types are the classes of the given packages of the LangChain4j jar, except the model classes (the implementations of LangChain4j's model interfaces) and their builders, the helpers (HTTP clients, mappers, parsers...), the exceptions and the anonymous classes. When LangChain4j adds a type, the verification fails and names it. Run the test with the environment variable "UPDATE_NATIVE_METADATA" set to rewrite the metadata file.

  • Field Details

    • UPDATE

      public static final String UPDATE
      The environment variable that rewrites the metadata file instead of verifying it.
      See Also:
  • Method Details

    • verify

      public static void verify(String module, Class<?> anchor, String... packages)
      Verifies, or rewrites, the metadata file of a module.
      Parameters:
      module - The module name, for example micronaut-langchain4j-ollama
      anchor - A class of the LangChain4j jar that contains the packages
      packages - The packages of the request and response types