📚 API ReferenceCognition
<RateLimit>
Let your agent plan and execute tasks.
Import
RateLimit
The RateLimit component allows you to control how frequently users can send messages to your agent. This helps prevent spam and abuse while maintaining a smooth user experience.
- Add the component to your agent:
Props
-
maxUserMessages (number)
- Maximum number of messages a user can send within the time window
- Default: 5
- Set to 0 or Infinity to disable rate limiting
-
maxUserMessagesTime (number)
- Time window in milliseconds for rate limiting
- Default: 86400000 (24 hours)
- Set to 0 or Infinity to disable rate limiting
-
message (string)
- Custom message shown when rate limit is exceeded
- Default: "You are sending messages too quickly. Please wait a moment before sending another message."