Class KnowledgeBaseMessage

java.lang.Object
com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessage
All Implemented Interfaces:
com.azure.json.JsonSerializable<KnowledgeBaseMessage>

public final class KnowledgeBaseMessage extends Object implements com.azure.json.JsonSerializable<KnowledgeBaseMessage>
The natural language message style object.
  • Constructor Details

    • KnowledgeBaseMessage

      public KnowledgeBaseMessage(List<KnowledgeBaseMessageContent> content)
      Creates an instance of KnowledgeBaseMessage class.
      Parameters:
      content - the content value to set.
  • Method Details

    • getRole

      public String getRole()
      Get the role property: The role of the tool response.
      Returns:
      the role value.
    • setRole

      public KnowledgeBaseMessage setRole(String role)
      Set the role property: The role of the tool response.
      Parameters:
      role - the role value to set.
      Returns:
      the KnowledgeBaseMessage object itself.
    • getContent

      public List<KnowledgeBaseMessageContent> getContent()
      Get the content property: The content property.
      Returns:
      the content value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<KnowledgeBaseMessage>
      Throws:
      IOException
    • fromJson

      public static KnowledgeBaseMessage fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of KnowledgeBaseMessage from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of KnowledgeBaseMessage 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 KnowledgeBaseMessage.