Class ChatMessageTextContent
- java.lang.Object
-
- com.microsoft.semantickernel.services.KernelContent<T>
-
- com.microsoft.semantickernel.services.chatcompletion.ChatMessageContent<String>
-
- com.microsoft.semantickernel.services.chatcompletion.message.ChatMessageTextContent
-
public class ChatMessageTextContent extends ChatMessageContent<String>
Represents the content of a chat message which contains text
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classChatMessageTextContent.Builder
-
Constructor Summary
Constructors Constructor Description ChatMessageTextContent(AuthorRole authorRole, String content, String modelId, Charset encoding, FunctionResultMetadata metadata)Creates a new instance of theChatMessageTextContentclass.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ChatMessageTextContentassistantMessage(String content)Create a message with the author role set toAuthorRole.ASSISTANTstatic ChatMessageTextContent.Builderbuilder()Create a new builder for theChatMessageTextContentclass.static ChatMessageTextContentsystemMessage(String content)Create a message with the author role set toAuthorRole.SYSTEMstatic ChatMessageTextContentuserMessage(String content)Create a message with the author role set toAuthorRole.USER-
Methods inherited from class com.microsoft.semantickernel.services.chatcompletion.ChatMessageContent
getAuthorRole, getContent, getContentType, getEncoding, getItems, toString
-
Methods inherited from class com.microsoft.semantickernel.services.KernelContent
getInnerContent, getMetadata
-
-
-
-
Constructor Detail
-
ChatMessageTextContent
public ChatMessageTextContent(AuthorRole authorRole, String content, @Nullable String modelId, @Nullable Charset encoding, @Nullable FunctionResultMetadata metadata)
Creates a new instance of theChatMessageTextContentclass.- Parameters:
authorRole- the author role that generated the contentcontent- the contentmodelId- the model idencoding- the encoding of the contentmetadata- the metadata
-
-
Method Detail
-
builder
public static ChatMessageTextContent.Builder builder()
Create a new builder for theChatMessageTextContentclass.- Returns:
- a new builder
-
userMessage
public static ChatMessageTextContent userMessage(String content)
Create a message with the author role set toAuthorRole.USER- Parameters:
content- The content of the message- Returns:
- The message
-
assistantMessage
public static ChatMessageTextContent assistantMessage(String content)
Create a message with the author role set toAuthorRole.ASSISTANT- Parameters:
content- The content of the message- Returns:
- The message
-
systemMessage
public static ChatMessageTextContent systemMessage(String content)
Create a message with the author role set toAuthorRole.SYSTEM- Parameters:
content- The content of the message- Returns:
- The message
-
-