Class OpenAIRequestResponse

java.lang.Object
com.developer.nefarious.zjoule.plugin.chat.openai.OpenAIRequestResponse

public class OpenAIRequestResponse extends Object
Represents the response body from an OpenAI chat completion API request. This class encapsulates information about the response, including choices, token usage, and metadata.
  • Constructor Details

    • OpenAIRequestResponse

      public OpenAIRequestResponse()
  • Method Details

    • getId

      public String getId()
      Retrieves the unique identifier for the response.
      Returns:
      the response ID as a String.
    • setId

      public void setId(String id)
      Sets the unique identifier for the response.
      Parameters:
      id - the response ID as a String.
    • getObject

      public String getObject()
      Retrieves the object type of the response.
      Returns:
      the object type as a String.
    • setObject

      public void setObject(String object)
      Sets the object type of the response.
      Parameters:
      object - the object type as a String.
    • getCreated

      public long getCreated()
      Retrieves the timestamp when the response was created.
      Returns:
      the creation timestamp as a long.
    • setCreated

      public void setCreated(long created)
      Sets the timestamp when the response was created.
      Parameters:
      created - the creation timestamp as a long.
    • getModel

      public String getModel()
      Retrieves the model used to generate the response.
      Returns:
      the model as a String.
    • setModel

      public void setModel(String model)
      Sets the model used to generate the response.
      Parameters:
      model - the model as a String.
    • getChoices

      public List<OpenAIRequestResponse.Choice> getChoices()
      Retrieves the list of choices returned by the OpenAI API.
      Returns:
      a List of OpenAIRequestResponse.Choice objects.
    • setChoices

      public void setChoices(List<OpenAIRequestResponse.Choice> choices)
      Sets the list of choices returned by the OpenAI API.
      Parameters:
      choices - a List of OpenAIRequestResponse.Choice objects.
    • getUsage

      public OpenAIRequestResponse.Usage getUsage()
      Retrieves the token usage details for the request.
      Returns:
      the OpenAIRequestResponse.Usage object containing token usage information.
    • setUsage

      public void setUsage(OpenAIRequestResponse.Usage usage)
      Sets the token usage details for the request.
      Parameters:
      usage - the OpenAIRequestResponse.Usage object containing token usage information.