InMemoryAgentFileStore Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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. |