Class OpenaiChatResponse

java.lang.Object
com.intellijava.core.model.BaseRemoteModel
com.intellijava.core.model.OpenaiChatResponse

public class OpenaiChatResponse extends BaseRemoteModel
OpenaiChatResponse is a model class used to parse the response from the OpenAI ChatGPT API. choices, Usage and Message are nested classes.
Author:
github.com/Barqawiz
  • Constructor Details

    • OpenaiChatResponse

      public OpenaiChatResponse()
      OpenaiChatResponse default constructor.
  • Method Details

    • getObject

      public String getObject()
      Gets the object type of the API response.
      Returns:
      the value of object property
    • setObject

      public void setObject(String object)
      Sets the object type of the API response.
      Parameters:
      object - the new value of the object property
    • getCreated

      public long getCreated()
      Gets the timestamp for the API response.
      Returns:
      the value of created property
    • setCreated

      public void setCreated(long created)
      Set the timestamp for the API response.
      Parameters:
      created - the timestamp when the API request was created.
    • getModel

      public String getModel()
      Gets the name of the language model
      Returns:
      the model id or name used to generate the API response
    • setModel

      public void setModel(String model)
      Setsthe name of the language model
      Parameters:
      model - the model id or name used to generate the API response
    • getUsage

      public OpenaiChatResponse.Usage getUsage()
      Gets the usage statistics for generating the API response.
      Returns:
      the usage object that contains usage statistics of the API request
    • setUsage

      public void setUsage(OpenaiChatResponse.Usage usage)
      Set the usage statistics for generating the API response.
      Parameters:
      usage - the usage object that contains usage statistics of the API request
    • getChoices

      public List<OpenaiChatResponse.Choice> getChoices()
      Gets the choices property
      Returns:
      list of Choice objects that contain the generated completions and additional information
    • setChoices

      public void setChoices(List<OpenaiChatResponse.Choice> choices)
      Sets the choices property
      Parameters:
      choices - list of Choice objects that contain the generated completions and additional information