Class ChatRequestAssistantMessage

java.lang.Object
com.azure.ai.inference.models.ChatRequestMessage
com.azure.ai.inference.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()
      Creates an instance of ChatRequestAssistantMessage class.
    • ChatRequestAssistantMessage

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

    • getRole

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

      public String getContent()
      Get the content property: The content of the message.
      Returns:
      the content value.
    • setContent

      public ChatRequestAssistantMessage setContent(String content)
      Set the content property: The content of the message.
      Parameters:
      content - the content 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.
    • 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:
      IOException - If an error occurs while reading the ChatRequestAssistantMessage.