Method SaveInformation
SaveInformation(string, string, string, MetadataCollection, CancellationToken)
Synchronously saves text information into the specified memory collection.
public DataSource SaveInformation(string collection, string text, string id, MetadataCollection additionalMetadata = null, CancellationToken cancellationToken = default)
Parameters
collection
stringThe identifier for the memory collection where the information will be stored.
text
stringThe text content to be saved.
id
stringA unique identifier for the stored piece of information.
additionalMetadata
MetadataCollectionOptional additional metadata to associate with the stored information.
cancellationToken
CancellationTokenOptional token to monitor for cancellation requests.
Returns
- DataSource
A DataSource instance representing the stored data.
Exceptions
- ArgumentException
Thrown if
collection
,text
, orid
is null or empty.