Class ChatRequestDeveloperMessage

java.lang.Object
com.azure.ai.openai.models.ChatRequestMessage
com.azure.ai.openai.models.ChatRequestDeveloperMessage
All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatRequestMessage>

public final class ChatRequestDeveloperMessage extends ChatRequestMessage
Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, `developer` messages replace the previous `system` messages.".
  • Constructor Details

    • ChatRequestDeveloperMessage

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

      public ChatRequestDeveloperMessage(List<ChatMessageContentItem> content)
      Creates an instance of ChatRequestDeveloperMessage class.
      Parameters:
      content - the content value to set.
    • ChatRequestDeveloperMessage

      public ChatRequestDeveloperMessage(ChatMessageContentItem[] content)
      Creates a new instance of ChatRequestDeveloperMessage using a collection of structured content.
      Parameters:
      content - The collection of structured content associated with the message.
  • 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 com.azure.core.util.BinaryData getContent()
      Get the content property: An array of content parts with a defined type. For developer messages, only type `text` is supported.
      Returns:
      the content value.
    • getListContent

      public List<ChatMessageContentItem> getListContent()
      Get the content property: The contents of the user message, with available input types varying by selected model. If the result of this method is `null`, it means that the content could be a String or null altogether.
      Returns:
      the content value if defined as a list
    • getArrayContent

      public ChatMessageContentItem[] getArrayContent()
      Get the content property: The contents of the user message, with available input types varying by selected model. If the result of this method is `null`, it means that the content could be a String or null altogether.
      Returns:
      the content value if defined as an array
    • getStringContent

      public String getStringContent()
      Get the content property: The contents of the user message, with available input types varying by selected model. If the result of this method is `null`, it means that the content could be a list or null altogether.
      Returns:
      the content value if defined as a string
    • getName

      public String getName()
      Get the name property: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
      Returns:
      the name value.
    • setName

      public ChatRequestDeveloperMessage setName(String name)
      Set the name property: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
      Parameters:
      name - the name value to set.
      Returns:
      the ChatRequestDeveloperMessage 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 ChatRequestDeveloperMessage fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ChatRequestDeveloperMessage from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ChatRequestDeveloperMessage 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 ChatRequestDeveloperMessage.