Package com.azure.ai.openai.models
Class ChatRequestAssistantMessage
java.lang.Object
com.azure.ai.openai.models.ChatRequestMessage
com.azure.ai.openai.models.ChatRequestAssistantMessage
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatRequestMessage>
A request chat message representing response or action from the assistant.
-
Constructor Summary
ConstructorsConstructorDescriptionChatRequestAssistantMessage(String content) Creates an instance of ChatRequestAssistantMessage class.Creates an instance of ChatRequestAssistantMessage class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ChatRequestAssistantMessagefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ChatRequestAssistantMessage from the JsonReader.com.azure.core.util.BinaryDataGet the content property: The content of the message.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.getName()Get the name property: An optional name for the participant.Get the refusal property: The refusal message by the assistant.getRole()Get the role property: The chat role associated with this 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.setFunctionCall(FunctionCall functionCall) Set 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.Set the name property: An optional name for the participant.setRefusal(String refusal) Set the refusal property: The refusal message by the assistant.setToolCalls(List<ChatCompletionsToolCall> toolCalls) Set 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) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ChatRequestAssistantMessage
Creates an instance of ChatRequestAssistantMessage class.- Parameters:
content- the String content value to set.
-
ChatRequestAssistantMessage
Creates an instance of ChatRequestAssistantMessage class.- Parameters:
content- the List of ChatMessageContentItem content value to set.
-
-
Method Details
-
getContent
public com.azure.core.util.BinaryData getContent()Get the content property: The content of the message.- Returns:
- the content value.
-
getName
Get the name property: An optional name for the participant.- Returns:
- the name value.
-
setName
Set the name property: An optional name for the participant.- Parameters:
name- the name value to set.- Returns:
- the ChatRequestAssistantMessage object itself.
-
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.
-
setToolCalls
Set 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.- Parameters:
toolCalls- the toolCalls value to set.- Returns:
- the ChatRequestAssistantMessage object itself.
-
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.
-
setFunctionCall
Set 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.- Parameters:
functionCall- the functionCall value to set.- Returns:
- the ChatRequestAssistantMessage object itself.
-
getRole
Get the role property: The chat role associated with this message.- Overrides:
getRolein classChatRequestMessage- Returns:
- the role value.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ChatRequestMessage>- Overrides:
toJsonin classChatRequestMessage- Throws:
IOException
-
fromJson
public static ChatRequestAssistantMessage fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of ChatRequestAssistantMessage from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ChatRequestAssistantMessage 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 ChatRequestAssistantMessage.
-
getRefusal
Get the refusal property: The refusal message by the assistant.- Returns:
- the refusal value.
-
setRefusal
Set the refusal property: The refusal message by the assistant.- Parameters:
refusal- the refusal value to set.- Returns:
- the ChatRequestAssistantMessage object itself.
-