API ReferenceComponents
<PerceptionModifier>
Intercept and modify agent perception handling.
The PerceptionModifier
component is used to modify and enhance perception handling within the agent's context. It acts as a middleware layer for perception events, allowing you to transform, filter, or augment incoming perceptions.
Import
Usage
Here's an example of how to use the PerceptionModifier
component:
Props
Prop | Type | Default |
---|---|---|
before | Function(perception) => perception | N/A |
after | Function(result) => result | N/A |
Best Practices
Efficient Processing
- Keep modification logic lightweight
- Use async functions for heavy processing
- Implement proper error handling
Proper Chaining
- Multiple modifiers can be chained
- Consider the order of modifications
- Return modified data in the correct format