Class AiServiceConfiguration

java.lang.Object
io.micronaut.langchain4j.aiservices.AiServiceConfiguration

@EachProperty("langchain4j.ai-services") public final class AiServiceConfiguration extends Object
Configuration of the AI services.

The settings under langchain4j.ai-services.default apply to every AI service. The settings under langchain4j.ai-services.<name> apply to the AI service with that name and replace the default ones.

Since:
2.4.0
  • Field Details

  • Constructor Details

    • AiServiceConfiguration

      public AiServiceConfiguration(@Parameter String name)
      Parameters:
      name - The name of the AI service, or "default"
  • Method Details

    • getName

      public String getName()
      Returns:
      The name of the AI service, or "default"
    • getMaxToolCallingRoundTrips

      public @Nullable Integer getMaxToolCallingRoundTrips()
      Returns:
      The maximum number of tool calling round trips with the model per AI service call
    • setMaxToolCallingRoundTrips

      public void setMaxToolCallingRoundTrips(@Nullable Integer maxToolCallingRoundTrips)
      Sets the maximum number of tool calling round trips with the model per AI service call. Defaults to LangChain4j's limit.
      Parameters:
      maxToolCallingRoundTrips - The maximum number of round trips
    • isExecuteToolsConcurrently

      public boolean isExecuteToolsConcurrently()
      Returns:
      Whether the tools requested in a single model response are executed concurrently
    • setExecuteToolsConcurrently

      public void setExecuteToolsConcurrently(boolean executeToolsConcurrently)
      Sets whether the tools requested in a single model response are executed concurrently. Defaults to false.
      Parameters:
      executeToolsConcurrently - Whether to execute the tools concurrently
      See Also:
    • getToolExecutor

      public @Nullable String getToolExecutor()
      Returns:
      The name of the executor that executes the tools concurrently
    • setToolExecutor

      public void setToolExecutor(@Nullable String toolExecutor)
      Sets the name of the Micronaut executor (for example blocking or virtual) that executes the tools when isExecuteToolsConcurrently() is enabled. Defaults to LangChain4j's executor.
      Parameters:
      toolExecutor - The executor name