Interface GenerativeAIFunctionRequest.EvaluatedResponse

All Known Subinterfaces:
GenerativeAIFunctionRequest.EvaluatedResponseStream
Enclosing interface:
GenerativeAIFunctionRequest

public static interface GenerativeAIFunctionRequest.EvaluatedResponse
Evaluated response of the generative AI, potentially containing function call requests.
Since:
5.2.250908
  • Method Details

    • getResponse

      @NotNull @NotNull Response getResponse()
      The response object returned by the generative AI.

      NOTE: To retrieve a combined token usage of all preceding requests use getTokenUsage() instead of retrieving it from the returned response using Response.getTokenUsage().

      Returns:
      The response object.
      Since:
      5.2.250908
    • getTokenUsage

      @NotNull @NotNull Optional<TokenUsage> getTokenUsage()
      Returns information about the combined token usage for the current function calling chain.
      Returns:
      The combined token usage information, if available.
      Since:
      5.2.251104
    • getFunctionCallHandles

      @NotNull @NotNull List<GenerativeAIFunctionRequest.FunctionCallHandle> getFunctionCallHandles()
      Returns a list of function calls requested by the AI.
      Returns:
      The list of function calls.
      Since:
      5.2.250908
    • createRequest

      @NotNull @NotNull Request createRequest()
      Creates a new request using the previously evaluated function calls. Any skipped function call will not be contained in the resulting request. Usually the caller of this method should make sure to perform all function calls.
      Returns:
      The new request to be used with the contextual GenerativeAIFunctionRequest.
      Since:
      5.2.250908