Package com.azure.ai.openai.models
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>
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 Summary
ConstructorsConstructorDescriptionCreates a new instance of ChatRequestDeveloperMessage using a collection of structured content.ChatRequestDeveloperMessage(String content) Creates an instance of ChatRequestDeveloperMessage class.Creates an instance of ChatRequestDeveloperMessage class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ChatRequestDeveloperMessagefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ChatRequestDeveloperMessage from the JsonReader.Get the content property: The contents of the user message, with available input types varying by selected model.com.azure.core.util.BinaryDataGet the content property: An array of content parts with a defined type.Get the content property: The contents of the user message, with available input types varying by selected model.getName()Get the name property: An optional name for the participant.getRole()Get the role property: The chat role associated with this message.Get the content property: The contents of the user message, with available input types varying by selected model.Set the name property: An optional name for the participant.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
-
ChatRequestDeveloperMessage
Creates an instance of ChatRequestDeveloperMessage class.- Parameters:
content- the content value to set.
-
ChatRequestDeveloperMessage
Creates an instance of ChatRequestDeveloperMessage class.- Parameters:
content- the content value to set.
-
ChatRequestDeveloperMessage
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
Get the role property: The chat role associated with this message.- Overrides:
getRolein classChatRequestMessage- 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
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
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
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
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
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
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ChatRequestMessage>- Overrides:
toJsonin classChatRequestMessage- 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.
-