Share via


ChatRequestUserMessage Class

public final class ChatRequestUserMessage
extends ChatRequestMessage

A request chat message representing user input to the assistant.

Constructor Summary

Constructor Description
ChatRequestUserMessage(BinaryData content)

Creates an instance of ChatRequestUserMessage class.

ChatRequestUserMessage(String content)

Creates an instance of ChatRequestUserMessage class.

Method Summary

Modifier and Type Method and Description
static ChatRequestUserMessage fromContentItems(List<ChatMessageContentItem> contentItems)

Creates an instance of ChatRequestUserMessage class.

static ChatRequestUserMessage fromJson(JsonReader jsonReader)

Reads an instance of ChatRequestUserMessage from the JsonReader.

static ChatRequestUserMessage fromString(String content)

Creates an instance of ChatRequestUserMessage class.

BinaryData getContent()

Get the content property: The contents of the user message, with available input types varying by selected model.

ChatRole getRole()

Get the role property: The chat role associated with this message.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from ChatRequestMessage

Methods inherited from java.lang.Object

Constructor Details

ChatRequestUserMessage

public ChatRequestUserMessage(BinaryData content)

Creates an instance of ChatRequestUserMessage class.

Parameters:

content - the content value to set.

ChatRequestUserMessage

public ChatRequestUserMessage(String content)

Creates an instance of ChatRequestUserMessage class.

Parameters:

content - the string content value to set.

Method Details

fromContentItems

public static ChatRequestUserMessage fromContentItems(List<ChatMessageContentItem> contentItems)

Creates an instance of ChatRequestUserMessage class.

Parameters:

contentItems - An array of content items to include in the message.

Returns:

An instance of ChatRequestUserMessage if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

fromJson

public static ChatRequestUserMessage fromJson(JsonReader jsonReader)

Reads an instance of ChatRequestUserMessage from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ChatRequestUserMessage if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

fromString

public static ChatRequestUserMessage fromString(String content)

Creates an instance of ChatRequestUserMessage class.

Parameters:

content - the content value to set.

Returns:

An instance of ChatRequestUserMessage if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

getContent

public BinaryData getContent()

Get the content property: The contents of the user message, with available input types varying by selected model.

Returns:

the content value.

getRole

public ChatRole getRole()

Get the role property: The chat role associated with this message.

Overrides:

ChatRequestUserMessage.getRole()

Returns:

the role value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

ChatRequestUserMessage.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to