Table of Contents

Method SaveInformationAsync

Namespace
LMKit.Agents
Assembly
LM-Kit.NET.dll

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 string

The identifier for the memory collection where the information will be stored.

text string

The text content to be saved.

id string

A unique identifier for the stored piece of information.

additionalMetadata MetadataCollection

Optional additional metadata to associate with the stored information.

cancellationToken CancellationToken

Optional 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, or id is null or empty.