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>

public final class ChatRequestAssistantMessage extends ChatRequestMessage
A request chat message representing response or action from the assistant.
  • Constructor Details

    • ChatRequestAssistantMessage

      public ChatRequestAssistantMessage(String content)
      Creates an instance of ChatRequestAssistantMessage class.
      Parameters:
      content - the String content value to set.
    • ChatRequestAssistantMessage

      public ChatRequestAssistantMessage(List<ChatMessageContentItem> content)
      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

      public String getName()
      Get the name property: An optional name for the participant.
      Returns:
      the name value.
    • setName

      public ChatRequestAssistantMessage setName(String name)
      Set the name property: An optional name for the participant.
      Parameters:
      name - the name value to set.
      Returns:
      the ChatRequestAssistantMessage object itself.
    • getToolCalls

      public 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.
      Returns:
      the toolCalls value.
    • setToolCalls

      public ChatRequestAssistantMessage 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.
      Parameters:
      toolCalls - the toolCalls value to set.
      Returns:
      the ChatRequestAssistantMessage object itself.
    • 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.
    • setFunctionCall

      public ChatRequestAssistantMessage 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.
      Parameters:
      functionCall - the functionCall value to set.
      Returns:
      the ChatRequestAssistantMessage object itself.
    • getRole

      public ChatRole getRole()
      Get the role property: The chat role associated with this message.
      Overrides:
      getRole in class ChatRequestMessage
      Returns:
      the role value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<ChatRequestMessage>
      Overrides:
      toJson in class ChatRequestMessage
      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

      public String getRefusal()
      Get the refusal property: The refusal message by the assistant.
      Returns:
      the refusal value.
    • setRefusal

      public ChatRequestAssistantMessage setRefusal(String refusal)
      Set the refusal property: The refusal message by the assistant.
      Parameters:
      refusal - the refusal value to set.
      Returns:
      the ChatRequestAssistantMessage object itself.