Constructor: Initializes a new ChatMetadataImpl instance with the given options, validating the participants and length.
The options to create the metadata from
Readonly
keywordsThe keywords associated with the chat segment
Readonly
lengthThe length of the chat segment
Readonly
participantsThe participants in the chat segment
Readonly
positionThe position of the speaker in the chat segment
Readonly
speakerThe speaker in the chat segment
Optional
Readonly
timestampThe timestamp of the chat segment
Constructor: Initializes a new ChatMetadataImpl instance with the given options, validating the participants and length. fromParser: Creates a new ChatMetadataImpl instance from parser results, allowing empty participants. setLength: Creates a new metadata instance with an updated length. addParticipants: Creates a new metadata instance with additional participants. addKeywords: Creates a new metadata instance with additional keywords. merge: Merges this metadata with another metadata instance, creating a new instance with merged data. validateOptions: Validates the options passed to the constructor, throwing errors for invalid participants or length. fromContent: Creates metadata from a chat segment content, extracting the speaker, keywords, and timestamp. extractSpeaker: Extracts the speaker from a chat segment content. extractKeywords: Extracts keywords from a chat segment content. extractTimestamp: Extracts the timestamp from a chat segment content.
Creates a new metadata instance with additional keywords
{string[]} The new keywords to add
A new metadata instance with additional keywords
Creates a new metadata instance with additional participants
{string[]} The new participants to add
A new metadata instance with additional participants
Merges this metadata with another metadata instance
The other metadata to merge with
A new metadata instance with merged data
Creates a new metadata instance with updated length
{number} The new length to set
A new metadata instance with updated length
Static
fromCreates metadata from a chat segment content
{string} The content to create metadata from
{number} The position of the segment in the chat
A new metadata instance created from the content
Static
fromCreates a ChatMetadataImpl instance from parser results, allowing empty participants
{SegmentMetadataOptions} The options to create the metadata from
A new ChatMetadataImpl instance
Class representing metadata for a chat segment.
ChatMetadataImpl {ChatMetadata}