The Upstreet Agents SDK is now in public beta 🎉 Get started →
API ReferenceAgentclass Agent

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 the useAgent hook to get a handle to the underlying Agent class.
 

handler callback

  • Each handler in your agent (such as <Action handler={(event) => {/* ... */}}> or <Perception handler={(event) => {/* ... */}}>) has an agent key on the event.data. You can use this for convenient access to the currently running agent. e.g.
 

useRef hook

  • Every <Agent> has an internal ref that resolves to the Agent instance. You can access it the usual way using React's useRef:
 

When you have a handle to your agent, you can access its methods.

Methods

TBD