v3.3.0
Released: September 13, 2026
Highlights
maxTokensrun option (@toolpack-sdk/agents) — callers can now cap output tokens for a single agent run viaAgentRunOptions.maxTokens, mapped directly tomax_tokenson the provider request
@toolpack-sdk/agents
AgentRunOptions.maxTokens
A new optional field on AgentRunOptions that hard-caps output tokens for one agent run. When set, it is passed as max_tokens to the underlying provider request, overriding any model default. Useful for platforms that need to throttle output size (for example, when an org's credit balance is low).
const result = await agent.run('Summarise this document', {
maxTokens: 512,
});
It is independent of maxToolRounds — both can be set together:
const result = await agent.run('Analyse and respond', {
maxToolRounds: 3,
maxTokens: 1024,
});
The field is optional and has no effect when omitted.
| Field | Type | Default |
|---|---|---|
maxTokens | number (optional) | Provider default |
Install
npm install toolpack-sdk@3.3.0
npm install @toolpack-sdk/knowledge@3.3.0
npm install @toolpack-sdk/agents@3.3.0