agents / Exports / FileUsageStorage
Class: FileUsageStorage
File storage implementation for usage statistics
Implements
Table of contents
Constructors
Methods
Constructors
constructor
• new FileUsageStorage(filePath): FileUsageStorage
Parameters
| Name | Type |
|---|---|
filePath | string |
Returns
Defined in
packages/agents/src/plugins/usage/storages/file-storage.ts:12
Methods
save
▸ save(entry): Promise<void>
Parameters
| Name | Type |
|---|---|
entry | UsageStats |
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/file-storage.ts:17
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/file-storage.ts:40
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/file-storage.ts:58
clear
▸ clear(): Promise<void>
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/file-storage.ts:90
flush
▸ flush(): Promise<void>
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/file-storage.ts:105
close
▸ close(): Promise<void>
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/file-storage.ts:119