Package com.azure.ai.openai.models
Class ChatResponseMessage
java.lang.Object
com.azure.ai.openai.models.ChatResponseMessage
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatResponseMessage>
public final class ChatResponseMessage
extends Object
implements com.azure.json.JsonSerializable<ChatResponseMessage>
A representation of a chat message as received in a response.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ChatResponseMessagefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ChatResponseMessage from the JsonReader.Get the content property: The content of the message.Get the context property: If Azure OpenAI chat extensions are configured, this array represents the incremental steps performed by those extensions while processing the chat completions request.Get the functionCall property: The function call that must be resolved and have its output appended to subsequent input messages for the chat completions request to resolve as configured.getRole()Get the role property: The chat role associated with the message.Get the toolCalls property: The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat completions request to resolve as configured.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter)
-
Method Details
-
getRole
Get the role property: The chat role associated with the message.- Returns:
- the role value.
-
getContent
Get the content property: The content of the message.- Returns:
- the content value.
-
getToolCalls
Get the toolCalls property: The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat completions request to resolve as configured.- Returns:
- the toolCalls value.
-
getFunctionCall
Get the functionCall property: The function call that must be resolved and have its output appended to subsequent input messages for the chat completions request to resolve as configured.- Returns:
- the functionCall value.
-
getContext
Get the context property: If Azure OpenAI chat extensions are configured, this array represents the incremental steps performed by those extensions while processing the chat completions request.- Returns:
- the context value.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ChatResponseMessage>- Throws:
IOException
-
fromJson
Reads an instance of ChatResponseMessage from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ChatResponseMessage if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the ChatResponseMessage.
-