Package com.intellijava.core.model
Class OpenaiChatResponse
java.lang.Object
com.intellijava.core.model.BaseRemoteModel
com.intellijava.core.model.OpenaiChatResponse
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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A nested class for the API response's choice represents the model output.static class
Message represents a message exchanged in a chat session.static class
Usage is a nested class that represents a Usage object returned in the API response. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the choices propertylong
Gets the timestamp for the API response.getModel()
Gets the name of the language modelGets the object type of the API response.getUsage()
Gets the usage statistics for generating the API response.void
setChoices
(List<OpenaiChatResponse.Choice> choices) Sets the choices propertyvoid
setCreated
(long created) Set the timestamp for the API response.void
Setsthe name of the language modelvoid
Sets the object type of the API response.void
setUsage
(OpenaiChatResponse.Usage usage) Set the usage statistics for generating the API response.Methods inherited from class com.intellijava.core.model.BaseRemoteModel
getId, setId
-
Constructor Details
-
OpenaiChatResponse
public OpenaiChatResponse()OpenaiChatResponse default constructor.
-
-
Method Details
-
getObject
Gets the object type of the API response.- Returns:
- the value of object property
-
setObject
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
Gets the name of the language model- Returns:
- the model id or name used to generate the API response
-
setModel
Setsthe name of the language model- Parameters:
model
- the model id or name used to generate the API response
-
getUsage
Gets the usage statistics for generating the API response.- Returns:
- the usage object that contains usage statistics of the API request
-
setUsage
Set the usage statistics for generating the API response.- Parameters:
usage
- the usage object that contains usage statistics of the API request
-
getChoices
Gets the choices property- Returns:
- list of Choice objects that contain the generated completions and additional information
-
setChoices
Sets the choices property- Parameters:
choices
- list of Choice objects that contain the generated completions and additional information
-