ChatResponseMessage Class

  • java.lang.Object
    • com.azure.ai.openai.models.ChatResponseMessage

Implements

public final class ChatResponseMessage
implements JsonSerializable<ChatResponseMessage>

A representation of a chat message as received in a response.

Method Summary

Modifier and Type Method and Description
static ChatResponseMessage fromJson(JsonReader jsonReader)

Reads an instance of ChatResponseMessage from the JsonReader.

String getContent()

Get the content property: The content of the message.

AzureChatExtensionsMessageContext 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.

FunctionCall 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.

String getRefusal()

Get the refusal property: The refusal message generated by the model.

ChatRole getRole()

Get the role property: The chat role associated with the message.

List<ChatCompletionsToolCall> 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.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static ChatResponseMessage fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

getContent

public String getContent()

Get the content property: The content of the message.

Returns:

the content value.

getContext

public AzureChatExtensionsMessageContext 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.

getFunctionCall

public FunctionCall 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.

getRefusal

public String getRefusal()

Get the refusal property: The refusal message generated by the model.

Returns:

the refusal value.

getRole

public ChatRole getRole()

Get the role property: The chat role associated with the message.

Returns:

the role value.

getToolCalls

public List 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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to