SmartSession.MessageCollection
Wisej.AI.SmartSession MessageCollection
Last updated
Wisej.AI.SmartSession MessageCollection
Last updated
Namespace: Wisej.AI
Assembly: Wisej.AI (3.5.0.0)
Represents a collection of messages in a session.
Initializes a new instance of .
Adds a message with the specified role and content.
role
The role of the message.
content
The content of the message.
Returns: . The current instance.
Throws:
Adds a range of messages to the collection.
messages
The messages to add.
Creates a shallow clone of the collection.
Inserts a message at the specified index.
index
The zero-based index at which the message should be inserted.
item
The message to insert.
Moves a message from one index to another.
oldIndex
The zero-based index specifying the location to move from.
newIndex
The zero-based index specifying the location to move to.
Removes all messages that match the specified predicate.
predicate
The predicate to match messages.
Removes the last message(s) from the collection.
The number of messages to remove. Default is 1.
Thrown when the content is null.
Returns: . The current instance.
Returns: . A shallow clone of the .
Returns: . The current instance.
count
Returns: . The current instance.