@senselab-ai/sensei. It comes with its TypeScript types.
SENSEI_API_KEY, or from the config file sensei login writes.
To update, run npm install @senselab-ai/sensei@latest. VERSION says which version is installed. say needs 0.3.0 or later.
Run something
run waits until the run has finished or has a question for a person. start takes the same arguments and returns at once.
Sensei
what is read like this.
For a task of one word, pass
task: sensei.run(null, { task: "Summarise" }).
input is the agent’s input. The rest are options of the run.
sensei.runs, sensei.agents, sensei.tools, sensei.settings and sensei.schedules are the lower-level groups described under Client.
RunResult
Answer a waiting run
correct takes what to do instead, and the text is kept for the agent’s later runs. answer waits for what comes next unless you pass { wait: false }.
Record an outcome
{ step: "refund" } names the step that was wrong.
Many at once
waiting, and the others are not held up by it.
Several changes to one repository
ref, instructions, parallel, together, deliver, limit, check and secrets. See Several changes at once.
Settings and secrets
Client
Client is the HTTP API with nothing added. Every method returns the API’s JSON.
events ends when the run is done or waiting. If the connection closes before that, it connects again from the last event it saw.
Errors
A response that is not a success throwsSenseiError, with the status, code and message the service sent.
FileError, which says what is wrong with the file.