Building blocks of SpinAI agents
createAction
function to define actions:
context.state
in actionscontext.state
object. This is useful if the value is static, like a user ID or email, which may not make sense to have an LLM determine via parameters.
context.state
in actionsstate
object, which is used to store and retrieve values between actions, as well as all the information you configured your agent with. This includes the input
variable that you called the agent with. See Agents for a full list of all available context variables.
context.state
, it is accessible in other actions during runtime, and after the agent call is complete from the state
variable.
context.state
for values that need to be shared between actions that are robust. Things like customer emails, user IDs, etc.