Learn how to mix autonomous LLM-based reasoning engines
ctx.agents
object is used to interact with agents. Inferable provides a default agent type called react
that is a good starting point for most use cases.
ctx.agents.react
object is used to interact with the React agent. It takes in 5 arguments:
name
: The name of the agent.instructions
: The instructions for the agent. (This gets passed to the system prompt of the LLM)input
: Stringified input for the agent.tools
: The tools that the agent can use. (These are registered with the workflow context)resultSchema
: The schema of the result that the agent will return.searchUsers
tool with the search query.searchUsers
tool again with a new search query.name
: The name of the tool.schema
: The schema of the tool.func
: The function that is called when the tool is used.config
: Optional configuration for the tool.ctx.llm.agents
will use the Claude Sonnet 3.5 model provided by Inferable.
However, this is intended for testing only. You can specify your own Anthropic API details when calling ctx.llm.agents
.
ctx.agents
only supports the Anthropic API and the following model Ids:
retryCountOnStall
: The number of times to retry the tool call if it stalls.timeoutSeconds
: The timeout for the tool call in seconds.workflow.listen()
, it will automatically register all the tools defined and make them available to the agent.