InMemoryAgentFileStore Class

Definition

An in-memory implementation of AgentFileStore that stores files in a dictionary.

public sealed class InMemoryAgentFileStore : Microsoft.Agents.AI.AgentFileStore
type InMemoryAgentFileStore = class
    inherit AgentFileStore
Public NotInheritable Class InMemoryAgentFileStore
Inherits AgentFileStore
Inheritance
InMemoryAgentFileStore

Remarks

This implementation is suitable for testing and lightweight scenarios where persistence is not required. Directory concepts are simulated using path prefixes — no explicit directory structure is maintained.

Constructors

Name Description
InMemoryAgentFileStore()

Methods

Name Description
CreateDirectoryAsync(String, CancellationToken)

Ensures a directory exists, creating it if necessary.

DeleteAsync(String, CancellationToken)

Deletes a file.

FileExistsAsync(String, CancellationToken)

Checks whether a file exists.

ListChildrenAsync(String, CancellationToken)

Lists the direct children (files and subdirectories) of a directory.

ReadAsync(String, CancellationToken)

Reads the content of a file.

SearchAsync(String, String, String, Boolean, CancellationToken)

Searches for files whose content matches a regular expression pattern.

WriteAsync(String, String, CancellationToken)

Writes content to a file, creating or overwriting it.

Applies to