Class ChatMessageContent<T>
- java.lang.Object
-
- com.microsoft.semantickernel.services.KernelContent<T>
-
- com.microsoft.semantickernel.services.chatcompletion.ChatMessageContent<T>
-
- Type Parameters:
T- the type of the inner content within the messages
public class ChatMessageContent<T> extends KernelContent<T>
Represents the content of a chat message
-
-
Constructor Summary
Constructors Constructor Description ChatMessageContent(AuthorRole authorRole, String content)Creates a new instance of theChatMessageContentclass.ChatMessageContent(AuthorRole authorRole, String content, String modelId, T innerContent, Charset encoding, FunctionResultMetadata metadata)Creates a new instance of theChatMessageContentclass.ChatMessageContent(AuthorRole authorRole, List<KernelContent<T>> items, String modelId, T innerContent, Charset encoding, FunctionResultMetadata metadata)Creates a new instance of theChatMessageContentclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorRolegetAuthorRole()Gets the author role that generated the contentStringgetContent()Gets the contentCharsetgetEncoding()Gets the encoding of the contentList<KernelContent<T>>getItems()Gets theKernelContentitems that comprise the content.StringtoString()-
Methods inherited from class com.microsoft.semantickernel.services.KernelContent
getInnerContent, getMetadata, getModelId
-
-
-
-
Constructor Detail
-
ChatMessageContent
public ChatMessageContent(AuthorRole authorRole, String content)
Creates a new instance of theChatMessageContentclass.- Parameters:
authorRole- the author role that generated the contentcontent- the content
-
ChatMessageContent
public ChatMessageContent(AuthorRole authorRole, String content, @Nullable String modelId, @Nullable T innerContent, @Nullable Charset encoding, @Nullable FunctionResultMetadata metadata)
Creates a new instance of theChatMessageContentclass.- Parameters:
authorRole- the author role that generated the contentcontent- the contentmodelId- the model idinnerContent- the inner contentencoding- the encodingmetadata- the metadata
-
ChatMessageContent
public ChatMessageContent(AuthorRole authorRole, List<KernelContent<T>> items, String modelId, T innerContent, Charset encoding, FunctionResultMetadata metadata)
Creates a new instance of theChatMessageContentclass.- Parameters:
authorRole- the author role that generated the contentitems- the itemsmodelId- the model idinnerContent- the inner contentencoding- the encodingmetadata- the metadata
-
-
Method Detail
-
getAuthorRole
public AuthorRole getAuthorRole()
Gets the author role that generated the content- Returns:
- the author role that generated the content
-
getContent
@Nullable public String getContent()
Gets the content- Specified by:
getContentin classKernelContent<T>- Returns:
- the content, which may be
null
-
getItems
public List<KernelContent<T>> getItems()
Gets theKernelContentitems that comprise the content.- Returns:
- the items, which may be
null
-
getEncoding
@Nullable public Charset getEncoding()
Gets the encoding of the content- Returns:
- the encoding, which may be
null
-
-