agents / Exports / MemoryUsageStorage
Class: MemoryUsageStorage
Memory storage implementation for usage statistics
Implements
Table of contents
Constructors
Methods
Constructors
constructor
• new MemoryUsageStorage(maxEntries?): MemoryUsageStorage
Parameters
| Name | Type | Default value |
|---|---|---|
maxEntries | number | 10000 |
Returns
Defined in
packages/agents/src/plugins/usage/storages/memory-storage.ts:10
Methods
save
▸ save(entry): Promise<void>
Parameters
| Name | Type |
|---|---|
entry | UsageStats |
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/memory-storage.ts:14
getStats
▸ getStats(conversationId?, timeRange?): Promise<UsageStats[]>
Parameters
| Name | Type |
|---|---|
conversationId? | string |
timeRange? | Object |
timeRange.start | Date |
timeRange.end | Date |
Returns
Promise<UsageStats[]>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/memory-storage.ts:23
getAggregatedStats
▸ getAggregatedStats(timeRange?): Promise<AggregatedUsageStats>
Parameters
| Name | Type |
|---|---|
timeRange? | Object |
timeRange.start | Date |
timeRange.end | Date |
Returns
Promise<AggregatedUsageStats>
Implementation of
UsageStorage.getAggregatedStats
Defined in
packages/agents/src/plugins/usage/storages/memory-storage.ts:39
clear
▸ clear(): Promise<void>
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/memory-storage.ts:120
flush
▸ flush(): Promise<void>
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/memory-storage.ts:124
close
▸ close(): Promise<void>
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/memory-storage.ts:128