Share via


ChatMessageTextContent Class

public class ChatMessageTextContent
extends ChatMessageContent<java.lang.String>

Represents the content of a chat message which contains text

Constructor Summary

Constructor Description
ChatMessageTextContent(AuthorRole authorRole, String content, String modelId, Charset encoding, FunctionResultMetadata metadata)

Creates a new instance of the ChatMessageTextContent class.

Method Summary

Modifier and Type Method and Description
static ChatMessageTextContent assistantMessage(String content)

Create a message with the author role set to ASSISTANT

static Builder builder()

Create a new builder for the ChatMessageTextContent class.

static ChatMessageTextContent systemMessage(String content)

Create a message with the author role set to SYSTEM

static ChatMessageTextContent userMessage(String content)

Create a message with the author role set to USER

Methods inherited from KernelContentImpl

Methods inherited from ChatMessageContent

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

ChatMessageTextContent

public ChatMessageTextContent(AuthorRole authorRole, String content, String modelId, Charset encoding, FunctionResultMetadata metadata)

Creates a new instance of the ChatMessageTextContent class.

Parameters:

authorRole - the author role that generated the content
content - the content
modelId - the model id
encoding - the encoding of the content
metadata - the metadata

Method Details

assistantMessage

public static ChatMessageTextContent assistantMessage(String content)

Create a message with the author role set to ASSISTANT

Parameters:

content - The content of the message

Returns:

The message

builder

public static ChatMessageTextContent.Builder builder()

Create a new builder for the ChatMessageTextContent class.

Returns:

a new builder

systemMessage

public static ChatMessageTextContent systemMessage(String content)

Create a message with the author role set to SYSTEM

Parameters:

content - The content of the message

Returns:

The message

userMessage

public static ChatMessageTextContent userMessage(String content)

Create a message with the author role set to USER

Parameters:

content - The content of the message

Returns:

The message

Applies to