agents / Exports / LimitsPluginOptions
Interface: LimitsPluginOptions
Limits plugin configuration
Hierarchy
↳
LimitsPluginOptions
Table of contents
Properties
- enabled
- category
- priority
- moduleEvents
- subscribeToAllModuleEvents
- strategy
- maxTokens
- maxRequests
- timeWindow
- maxCost
- tokenCostPer1000
- refillRate
- bucketSize
- costCalculator
Properties
enabled
• Optional enabled: boolean
Whether the plugin is enabled
Inherited from
Defined in
packages/agents/src/abstracts/base-plugin.ts:125
category
• Optional category: PluginCategory
Plugin category for classification
Inherited from
Defined in
packages/agents/src/abstracts/base-plugin.ts:127
priority
• Optional priority: number
Plugin priority for execution order
Inherited from
Defined in
packages/agents/src/abstracts/base-plugin.ts:129
moduleEvents
• Optional moduleEvents: EventType[]
Events to subscribe to from modules
Inherited from
BasePluginOptions.moduleEvents
Defined in
packages/agents/src/abstracts/base-plugin.ts:131
subscribeToAllModuleEvents
• Optional subscribeToAllModuleEvents: boolean
Whether to subscribe to all module events
Inherited from
BasePluginOptions.subscribeToAllModuleEvents
Defined in
packages/agents/src/abstracts/base-plugin.ts:133
strategy
• strategy: LimitsStrategy
Rate limiting strategy
Defined in
packages/agents/src/plugins/limits/types.ts:13
maxTokens
• Optional maxTokens: number
Maximum tokens per time window
Defined in
packages/agents/src/plugins/limits/types.ts:15
maxRequests
• Optional maxRequests: number
Maximum requests per time window
Defined in
packages/agents/src/plugins/limits/types.ts:17
timeWindow
• Optional timeWindow: number
Time window in milliseconds
Defined in
packages/agents/src/plugins/limits/types.ts:19
maxCost
• Optional maxCost: number
Maximum cost per time window (in USD)
Defined in
packages/agents/src/plugins/limits/types.ts:21
tokenCostPer1000
• Optional tokenCostPer1000: number
Token cost per 1000 tokens (in USD)
Defined in
packages/agents/src/plugins/limits/types.ts:23
refillRate
• Optional refillRate: number
Bucket refill rate for token bucket strategy
Defined in
packages/agents/src/plugins/limits/types.ts:25
bucketSize
• Optional bucketSize: number
Initial bucket size for token bucket strategy
Defined in
packages/agents/src/plugins/limits/types.ts:27
costCalculator
• Optional costCalculator: (tokens: number, model: string) => number
Custom cost calculator
Type declaration
▸ (tokens, model): number
Parameters
| Name | Type |
|---|---|
tokens | number |
model | string |
Returns
number