Interface GenerativeAIFunctionServer

All Superinterfaces:
AutoCloseable, Closeable

@Experimental public interface GenerativeAIFunctionServer extends Closeable
Plugin to integrate external functions into generative AI requests.
Since:
5.2.251104
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull List<Function>
    Returns a list of available functions.
    @NotNull String
    Returns the name of the function server, which is used for identification of the server as well as a prefix for the identification of functions from different servers when performing AI requests.
    @Nullable Serializable
    Implementation of a previously specified Function.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • getName

      @NotNull @NotNull String getName()
      Returns the name of the function server, which is used for identification of the server as well as a prefix for the identification of functions from different servers when performing AI requests.
      Returns:
      The name of the function server.
      Since:
      5.2.251104
    • getFunctions

      @NotNull @NotNull List<Function> getFunctions()
      Returns a list of available functions.
      Returns:
      The available functions.
      Since:
      5.2.251104
    • perform

      @Nullable @Nullable Serializable perform(@NotNull @NotNull GenerativeAIFunctionServerCall call) throws IOException
      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:
      call - The function call context.
      Returns:
      The result object of the function call.
      Throws:
      IOException - If the call failed for some reason.
      Since:
      5.2.251104