Interface GenerativeAIFunction

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@Experimental @FunctionalInterface public interface GenerativeAIFunction
Callback for a specific Function used for a generative AI request.
Since:
5.2.250908
  • Method Details

    • perform

      @Nullable @Nullable Serializable perform(@NotNull @NotNull GenerativeAIFunctionArguments arguments)
      Implementation of a previously specified Function. The AI expects the function to return a String, even if the result is a JSON object. For convenience the API will try to convert the returned object to an appropriate JSON string type, which may not be supported for some complex Java object types.
      Parameters:
      arguments - The arguments specified by the AI.
      Returns:
      The result object.
      Since:
      5.2.250908