class Agent
Main agent class
The Agent class has represents a currently running agent. It corresponds 1:1 to an <Agent> tag in your code.
You do not construct the Agent class yourself. It is created for you when your <Agent> gets rendered by the runtime.
To get a handle to the Agent class, use one of the following:
useAgent hook
- Any component nested within and <Agent>can call theuseAgenthook to get a handle to the underlyingAgentclass.
handler callback
- Each handlerin your agent (such as<Action handler={(event) => {/* ... */}}>or<Perception handler={(event) => {/* ... */}}>) has anagentkey on theevent.data. You can use this for convenient access to the currently runningagent. e.g.
useRef hook
- Every <Agent>has an internalrefthat resolves to theAgentinstance. You can access it the usual way using React'suseRef:
When you have a handle to your agent, you can access its methods.
Methods
TBD