inputsarrayrequired[{ type: "text", content }], images included. An empty array throws.
outputsarrayOverrides what the agent was created with, for this run.
historyarrayThe conversation to send. Absent uses the agent's own; [] starts fresh.
onStepfunctionCalled with each step as it happens.
signalAbortSignalCancels the request.
What a step carries
{
index: 2,
kind: "tool",
tool: "search",
input: "customer churn definition",
reasoning: "I will look up how they define churn.",
summary: "5 result(s)",
error: "",
credits: 7,
durationMs: 1840,
meta: { enginesUsed: [...], results: [...] }
}{
"index": 2,
"kind": "tool",
"tool": "search",
"input": "customer churn definition",
"reasoning": "I will look up how they define churn.",
"summary": "5 result(s)",
"error": "",
"credits": 7,
"durationMs": 1840,
"meta": {"enginesUsed": [...], "results": [...]},
}credits is the run's running total, not this step's. meta is whatever the tool reports — the pages it opened, the sources it found, the figures of a generation.
Three refusals arrive as a step's error
| error | When |
|---|---|
| Unknown tool | The model named something you did not declare. The message lists what is available. |
| Missing argument | A tool that needs one was called without it. |
| Already done | The same tool with the same argument, twice. |
| Refused: … credits needed | The declared cost would pass budget. |
The run continues after each of them — a refusal is information the model can act on.
Errors keep their type through the stream
import { NotEnoughCredits, Unauthorized, IaGenifyError } from "iagenify";
try {
await agent.run({ inputs });
} catch (err) {
if (err instanceof NotEnoughCredits) { /* … */ }
}from iagenify import IaGenifyError, NotEnoughCredits, Unauthorized
try:
agent.run(inputs=inputs)
except NotEnoughCredits:
pass # …It travels as JSON, and is rebuilt into the same class the rest of the package throws — so instanceof works here as it does everywhere else, instead of giving you a bare Error you cannot tell from a network failure.
An unknown builtin is refused outright
A tool whose builtin the platform does not know fails the run rather than being dropped. A workflow quietly missing the tool it was built around is the kind of failure nobody ever diagnoses.
Local work pauses the run
When a step needs the caller's computer, the run asks and waits for your process to answer. Abandon the request and that step never completes.