Method SaveInformationAsync
SaveInformationAsync(string, string, string, MetadataCollection, CancellationToken)
Asynchronously saves text information into the specified memory collection.
public Task<DataSource> SaveInformationAsync(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
- Task<DataSource>
A task that represents the asynchronous save operation. The task result is a DataSource encapsulating the stored data.
Exceptions
- ArgumentException
Thrown if
collection
,text
, orid
is null or empty.