Annotation Interface AiService


@Target(TYPE) @Introduction @Documented public @interface AiService
Registers an AI service.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    The default no-op customizer.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    A customizer can be registered to customize its creation.
    The name of a configured AI model.
    Class<?>[]
    The types of the tools to include.
    Defines the service name.
  • Element Details

    • value

      @AliasFor(annotation=jakarta.inject.Named.class,member="value") @AliasFor(member="named") String value
      Defines the service name. Same as named().
      Returns:
      The service name
      Default:
      ""
    • named

      @AliasFor(annotation=jakarta.inject.Named.class, member="value") String named
      The name of a configured AI model.
      Returns:
      The model name.
      Default:
      ""
    • tools

      Class<?>[] tools
      The types of the tools to include. Can be set to an empty array to include none.
      Returns:
      The tool types
      Default:
      {}
    • customizer

      Class<? extends AiServiceCustomizer<?>> customizer
      A customizer can be registered to customize its creation.

      Normally these are picked up automatically if declared as beans, using this members allows the chosen customizer to be overridden.

      Returns:
      The customizer
      Default:
      io.micronaut.langchain4j.annotation.AiService.NoOpCustomizer.class