@proveanything/smartlinks 1.15.2 → 1.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/ai.js +4 -0
- package/dist/docs/API_SUMMARY.md +8 -1
- package/dist/docs/ai.md +94 -0
- package/dist/openapi.yaml +26 -0
- package/dist/types/ai.d.ts +11 -0
- package/docs/API_SUMMARY.md +8 -1
- package/docs/ai.md +94 -0
- package/openapi.yaml +26 -0
- package/package.json +1 -1
package/dist/api/ai.js
CHANGED
|
@@ -28,7 +28,11 @@ var aiInternal;
|
|
|
28
28
|
* @returns Responses API result or async iterable for streaming events
|
|
29
29
|
*/
|
|
30
30
|
async function create(collectionId, request) {
|
|
31
|
+
var _a;
|
|
31
32
|
const path = `/admin/collection/${encodeURIComponent(collectionId)}/ai/v1/responses`;
|
|
33
|
+
if (((_a = request.multi_agent) === null || _a === void 0 ? void 0 : _a.enabled) && request.stream) {
|
|
34
|
+
throw new Error('Streaming is not supported when multi_agent.enabled is true');
|
|
35
|
+
}
|
|
32
36
|
if (request.stream) {
|
|
33
37
|
return requestStream(path, { method: 'POST', body: request });
|
|
34
38
|
}
|
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.15.
|
|
3
|
+
Version: 1.15.3 | Generated: 2026-07-11T13:25:50.969Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -499,6 +499,8 @@ interface ResponseTool {
|
|
|
499
499
|
name?: string
|
|
500
500
|
description?: string
|
|
501
501
|
parameters?: Record<string, any>
|
|
502
|
+
output_schema?: Record<string, any>
|
|
503
|
+
allowed_callers?: Array<'assistant' | 'programmatic'>
|
|
502
504
|
[key: string]: any
|
|
503
505
|
}
|
|
504
506
|
```
|
|
@@ -544,6 +546,11 @@ interface ResponsesRequest {
|
|
|
544
546
|
text?: Record<string, any>
|
|
545
547
|
metadata?: Record<string, string>
|
|
546
548
|
prompt_cache_key?: string
|
|
549
|
+
multi_agent?: {
|
|
550
|
+
enabled: boolean
|
|
551
|
+
max_concurrent_subagents?: number
|
|
552
|
+
}
|
|
553
|
+
service_tier?: 'auto' | 'standard' | 'flex' | 'priority'
|
|
547
554
|
}
|
|
548
555
|
```
|
|
549
556
|
|
package/dist/docs/ai.md
CHANGED
|
@@ -251,6 +251,100 @@ const response = await ai.chat.responses.create('my-collection', {
|
|
|
251
251
|
console.log(response.output);
|
|
252
252
|
```
|
|
253
253
|
|
|
254
|
+
### Recommended Models
|
|
255
|
+
|
|
256
|
+
For agentic workflows on `v1/responses`, GPT-5.6 ships in three tiers. Pass either the full model
|
|
257
|
+
id (`openai/gpt-5.6-sol`) or the shorthand tier alias (`'cheap'`, `'balanced'`, `'premium'`) as
|
|
258
|
+
`model` — both resolve through the same server-side model registry.
|
|
259
|
+
|
|
260
|
+
| Tier | Model | Alias | Use for |
|
|
261
|
+
|------|-------|-------|---------|
|
|
262
|
+
| Cheapest (default) | `openai/gpt-5.6-luna` | `'cheap'` / omit `model` | Everyday chat, high-volume/simple turns |
|
|
263
|
+
| Balanced | `openai/gpt-5.6-terra` | `'balanced'` | Admin agent / tool-heavy setup workflows (route default) |
|
|
264
|
+
| Flagship | `openai/gpt-5.6-sol` | `'premium'` | Most demanding reasoning, coding, and multi-step tool use |
|
|
265
|
+
|
|
266
|
+
Every tier supports function/tool calling, Programmatic Tool Calling, and Multi-agent (see below), and all
|
|
267
|
+
three accept `service_tier: 'flex'` (≈50% cheaper, Batch-API rates, slower) or `'priority'` (premium, guaranteed
|
|
268
|
+
throughput) alongside the default `'standard'` tier. Pass it straight through in the request body:
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
const response = await ai.chat.responses.create('my-collection', {
|
|
272
|
+
model: 'balanced',
|
|
273
|
+
input: 'Summarize this week\'s ingested documents.',
|
|
274
|
+
service_tier: 'flex' // non-interactive/background work: cheaper, but can take minutes
|
|
275
|
+
});
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Flex requests run noticeably slower — reserve `flex` for non-production/background work (batch enrichment,
|
|
279
|
+
evaluations, async jobs), not user-facing chat turns. The server already raises its own timeout to 15
|
|
280
|
+
minutes for any request with `service_tier: 'flex'`, matching OpenAI's guidance — nothing to configure on
|
|
281
|
+
the client. On a `429` ("resource unavailable") the request wasn't charged; retry with backoff or drop
|
|
282
|
+
`service_tier` (or set it to `'auto'`) to fall back to standard processing.
|
|
283
|
+
|
|
284
|
+
### Programmatic Tool Calling
|
|
285
|
+
|
|
286
|
+
Lets the model write a short in-memory program that orchestrates several tool calls (filtering,
|
|
287
|
+
looping, aggregating) before handing back one result, instead of a full message round-trip per
|
|
288
|
+
call. Add the hosted `programmatic_tool_calling` tool, and mark each function tool the program is
|
|
289
|
+
allowed to invoke with `allowed_callers: ['programmatic']`:
|
|
290
|
+
|
|
291
|
+
```typescript
|
|
292
|
+
const response = await ai.chat.responses.create('my-collection', {
|
|
293
|
+
model: 'balanced',
|
|
294
|
+
input: 'Compare inventory with demand for every SKU in this collection.',
|
|
295
|
+
tools: [
|
|
296
|
+
{
|
|
297
|
+
type: 'function',
|
|
298
|
+
name: 'get_inventory',
|
|
299
|
+
description: 'Return available_units for a sku',
|
|
300
|
+
parameters: { type: 'object', properties: { sku: { type: 'string' } }, required: ['sku'] },
|
|
301
|
+
output_schema: { type: 'object', properties: { sku: { type: 'string' }, available_units: { type: 'number' } } },
|
|
302
|
+
allowed_callers: ['programmatic']
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
type: 'function',
|
|
306
|
+
name: 'get_demand',
|
|
307
|
+
description: 'Return requested_units for a sku',
|
|
308
|
+
parameters: { type: 'object', properties: { sku: { type: 'string' } }, required: ['sku'] },
|
|
309
|
+
output_schema: { type: 'object', properties: { sku: { type: 'string' }, requested_units: { type: 'number' } } },
|
|
310
|
+
allowed_callers: ['programmatic']
|
|
311
|
+
},
|
|
312
|
+
{ type: 'programmatic_tool_calling' }
|
|
313
|
+
]
|
|
314
|
+
});
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
The response's `output` array can include a `program` item (the generated code), one
|
|
318
|
+
`function_call` item per program-issued call (tagged with `caller: { type: 'program', caller_id }`),
|
|
319
|
+
and a `program_output` item with the program's final `result`/`status`. Execute the `function_call`
|
|
320
|
+
items as normal and send results back keyed by their `call_id` on the next turn.
|
|
321
|
+
|
|
322
|
+
### Multi-agent (subagents)
|
|
323
|
+
|
|
324
|
+
Lets the root agent spawn a tree of subagents that run in parallel and get synthesized back into
|
|
325
|
+
one response — useful for tasks that split cleanly into independent workstreams (e.g. research +
|
|
326
|
+
draft + review). Enable it by setting `multi_agent.enabled: true` — that's the entire contract on
|
|
327
|
+
your end; nothing else to configure or pass.
|
|
328
|
+
|
|
329
|
+
This is upstream beta functionality (OpenAI may still be limiting it to certain accounts/rollout),
|
|
330
|
+
so treat behavior and availability as subject to change until it's GA.
|
|
331
|
+
|
|
332
|
+
```typescript
|
|
333
|
+
const response = await ai.chat.responses.create('my-collection', {
|
|
334
|
+
model: 'premium', // Sol recommended for the root agent when spawning subagents
|
|
335
|
+
input: 'Research three competitor loyalty programs, then draft a comparison summary.',
|
|
336
|
+
multi_agent: { enabled: true, max_concurrent_subagents: 3 }
|
|
337
|
+
});
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Subagent output arrives as additional items in `output`, each tagged `agent: { agent_name: '/root/<name>' }`
|
|
341
|
+
(root agent output uses `/root`). Notes/limits carried over from OpenAI's beta:
|
|
342
|
+
|
|
343
|
+
- `max_concurrent_subagents` defaults to `3`
|
|
344
|
+
- `reasoning.summary` and `max_tool_calls` are not supported while multi-agent is enabled
|
|
345
|
+
- Streaming is not supported while multi-agent is enabled — the SDK throws if you pass both
|
|
346
|
+
`stream: true` and `multi_agent.enabled: true`
|
|
347
|
+
|
|
254
348
|
---
|
|
255
349
|
|
|
256
350
|
## Chat Completions
|
package/dist/openapi.yaml
CHANGED
|
@@ -13964,6 +13964,16 @@ components:
|
|
|
13964
13964
|
parameters:
|
|
13965
13965
|
type: object
|
|
13966
13966
|
additionalProperties: true
|
|
13967
|
+
output_schema:
|
|
13968
|
+
type: object
|
|
13969
|
+
additionalProperties: true
|
|
13970
|
+
allowed_callers:
|
|
13971
|
+
type: array
|
|
13972
|
+
items:
|
|
13973
|
+
type: string
|
|
13974
|
+
enum:
|
|
13975
|
+
- assistant
|
|
13976
|
+
- programmatic
|
|
13967
13977
|
required:
|
|
13968
13978
|
- type
|
|
13969
13979
|
ResponseInputItem:
|
|
@@ -14052,6 +14062,22 @@ components:
|
|
|
14052
14062
|
type: string
|
|
14053
14063
|
prompt_cache_key:
|
|
14054
14064
|
type: string
|
|
14065
|
+
multi_agent:
|
|
14066
|
+
type: object
|
|
14067
|
+
additionalProperties: true
|
|
14068
|
+
enabled:
|
|
14069
|
+
type: boolean
|
|
14070
|
+
max_concurrent_subagents:
|
|
14071
|
+
type: number
|
|
14072
|
+
service_tier:
|
|
14073
|
+
type: string
|
|
14074
|
+
enum:
|
|
14075
|
+
- auto
|
|
14076
|
+
- standard
|
|
14077
|
+
- flex
|
|
14078
|
+
- priority
|
|
14079
|
+
required:
|
|
14080
|
+
- enabled
|
|
14055
14081
|
ResponsesResult:
|
|
14056
14082
|
type: object
|
|
14057
14083
|
properties:
|
package/dist/types/ai.d.ts
CHANGED
|
@@ -56,6 +56,10 @@ export interface ResponseTool {
|
|
|
56
56
|
name?: string;
|
|
57
57
|
description?: string;
|
|
58
58
|
parameters?: Record<string, any>;
|
|
59
|
+
/** Expected shape of this tool's output, used by Programmatic Tool Calling. */
|
|
60
|
+
output_schema?: Record<string, any>;
|
|
61
|
+
/** Restricts which callers may invoke this tool (e.g. `['programmatic']` for Programmatic Tool Calling). */
|
|
62
|
+
allowed_callers?: Array<'assistant' | 'programmatic'>;
|
|
59
63
|
[key: string]: any;
|
|
60
64
|
}
|
|
61
65
|
/** Structured input item accepted by the Responses API. */
|
|
@@ -98,6 +102,13 @@ export interface ResponsesRequest {
|
|
|
98
102
|
text?: Record<string, any>;
|
|
99
103
|
metadata?: Record<string, string>;
|
|
100
104
|
prompt_cache_key?: string;
|
|
105
|
+
/** Enables multi-agent (subagent) orchestration. Not supported together with `stream: true`. */
|
|
106
|
+
multi_agent?: {
|
|
107
|
+
enabled: boolean;
|
|
108
|
+
max_concurrent_subagents?: number;
|
|
109
|
+
};
|
|
110
|
+
/** `'flex'` is ~50% cheaper at Batch-API rates but slower; reserve for non-interactive/background work. */
|
|
111
|
+
service_tier?: 'auto' | 'standard' | 'flex' | 'priority';
|
|
101
112
|
}
|
|
102
113
|
/** Response from the Responses API. */
|
|
103
114
|
export interface ResponsesResult {
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.15.
|
|
3
|
+
Version: 1.15.3 | Generated: 2026-07-11T13:25:50.969Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -499,6 +499,8 @@ interface ResponseTool {
|
|
|
499
499
|
name?: string
|
|
500
500
|
description?: string
|
|
501
501
|
parameters?: Record<string, any>
|
|
502
|
+
output_schema?: Record<string, any>
|
|
503
|
+
allowed_callers?: Array<'assistant' | 'programmatic'>
|
|
502
504
|
[key: string]: any
|
|
503
505
|
}
|
|
504
506
|
```
|
|
@@ -544,6 +546,11 @@ interface ResponsesRequest {
|
|
|
544
546
|
text?: Record<string, any>
|
|
545
547
|
metadata?: Record<string, string>
|
|
546
548
|
prompt_cache_key?: string
|
|
549
|
+
multi_agent?: {
|
|
550
|
+
enabled: boolean
|
|
551
|
+
max_concurrent_subagents?: number
|
|
552
|
+
}
|
|
553
|
+
service_tier?: 'auto' | 'standard' | 'flex' | 'priority'
|
|
547
554
|
}
|
|
548
555
|
```
|
|
549
556
|
|
package/docs/ai.md
CHANGED
|
@@ -251,6 +251,100 @@ const response = await ai.chat.responses.create('my-collection', {
|
|
|
251
251
|
console.log(response.output);
|
|
252
252
|
```
|
|
253
253
|
|
|
254
|
+
### Recommended Models
|
|
255
|
+
|
|
256
|
+
For agentic workflows on `v1/responses`, GPT-5.6 ships in three tiers. Pass either the full model
|
|
257
|
+
id (`openai/gpt-5.6-sol`) or the shorthand tier alias (`'cheap'`, `'balanced'`, `'premium'`) as
|
|
258
|
+
`model` — both resolve through the same server-side model registry.
|
|
259
|
+
|
|
260
|
+
| Tier | Model | Alias | Use for |
|
|
261
|
+
|------|-------|-------|---------|
|
|
262
|
+
| Cheapest (default) | `openai/gpt-5.6-luna` | `'cheap'` / omit `model` | Everyday chat, high-volume/simple turns |
|
|
263
|
+
| Balanced | `openai/gpt-5.6-terra` | `'balanced'` | Admin agent / tool-heavy setup workflows (route default) |
|
|
264
|
+
| Flagship | `openai/gpt-5.6-sol` | `'premium'` | Most demanding reasoning, coding, and multi-step tool use |
|
|
265
|
+
|
|
266
|
+
Every tier supports function/tool calling, Programmatic Tool Calling, and Multi-agent (see below), and all
|
|
267
|
+
three accept `service_tier: 'flex'` (≈50% cheaper, Batch-API rates, slower) or `'priority'` (premium, guaranteed
|
|
268
|
+
throughput) alongside the default `'standard'` tier. Pass it straight through in the request body:
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
const response = await ai.chat.responses.create('my-collection', {
|
|
272
|
+
model: 'balanced',
|
|
273
|
+
input: 'Summarize this week\'s ingested documents.',
|
|
274
|
+
service_tier: 'flex' // non-interactive/background work: cheaper, but can take minutes
|
|
275
|
+
});
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Flex requests run noticeably slower — reserve `flex` for non-production/background work (batch enrichment,
|
|
279
|
+
evaluations, async jobs), not user-facing chat turns. The server already raises its own timeout to 15
|
|
280
|
+
minutes for any request with `service_tier: 'flex'`, matching OpenAI's guidance — nothing to configure on
|
|
281
|
+
the client. On a `429` ("resource unavailable") the request wasn't charged; retry with backoff or drop
|
|
282
|
+
`service_tier` (or set it to `'auto'`) to fall back to standard processing.
|
|
283
|
+
|
|
284
|
+
### Programmatic Tool Calling
|
|
285
|
+
|
|
286
|
+
Lets the model write a short in-memory program that orchestrates several tool calls (filtering,
|
|
287
|
+
looping, aggregating) before handing back one result, instead of a full message round-trip per
|
|
288
|
+
call. Add the hosted `programmatic_tool_calling` tool, and mark each function tool the program is
|
|
289
|
+
allowed to invoke with `allowed_callers: ['programmatic']`:
|
|
290
|
+
|
|
291
|
+
```typescript
|
|
292
|
+
const response = await ai.chat.responses.create('my-collection', {
|
|
293
|
+
model: 'balanced',
|
|
294
|
+
input: 'Compare inventory with demand for every SKU in this collection.',
|
|
295
|
+
tools: [
|
|
296
|
+
{
|
|
297
|
+
type: 'function',
|
|
298
|
+
name: 'get_inventory',
|
|
299
|
+
description: 'Return available_units for a sku',
|
|
300
|
+
parameters: { type: 'object', properties: { sku: { type: 'string' } }, required: ['sku'] },
|
|
301
|
+
output_schema: { type: 'object', properties: { sku: { type: 'string' }, available_units: { type: 'number' } } },
|
|
302
|
+
allowed_callers: ['programmatic']
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
type: 'function',
|
|
306
|
+
name: 'get_demand',
|
|
307
|
+
description: 'Return requested_units for a sku',
|
|
308
|
+
parameters: { type: 'object', properties: { sku: { type: 'string' } }, required: ['sku'] },
|
|
309
|
+
output_schema: { type: 'object', properties: { sku: { type: 'string' }, requested_units: { type: 'number' } } },
|
|
310
|
+
allowed_callers: ['programmatic']
|
|
311
|
+
},
|
|
312
|
+
{ type: 'programmatic_tool_calling' }
|
|
313
|
+
]
|
|
314
|
+
});
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
The response's `output` array can include a `program` item (the generated code), one
|
|
318
|
+
`function_call` item per program-issued call (tagged with `caller: { type: 'program', caller_id }`),
|
|
319
|
+
and a `program_output` item with the program's final `result`/`status`. Execute the `function_call`
|
|
320
|
+
items as normal and send results back keyed by their `call_id` on the next turn.
|
|
321
|
+
|
|
322
|
+
### Multi-agent (subagents)
|
|
323
|
+
|
|
324
|
+
Lets the root agent spawn a tree of subagents that run in parallel and get synthesized back into
|
|
325
|
+
one response — useful for tasks that split cleanly into independent workstreams (e.g. research +
|
|
326
|
+
draft + review). Enable it by setting `multi_agent.enabled: true` — that's the entire contract on
|
|
327
|
+
your end; nothing else to configure or pass.
|
|
328
|
+
|
|
329
|
+
This is upstream beta functionality (OpenAI may still be limiting it to certain accounts/rollout),
|
|
330
|
+
so treat behavior and availability as subject to change until it's GA.
|
|
331
|
+
|
|
332
|
+
```typescript
|
|
333
|
+
const response = await ai.chat.responses.create('my-collection', {
|
|
334
|
+
model: 'premium', // Sol recommended for the root agent when spawning subagents
|
|
335
|
+
input: 'Research three competitor loyalty programs, then draft a comparison summary.',
|
|
336
|
+
multi_agent: { enabled: true, max_concurrent_subagents: 3 }
|
|
337
|
+
});
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Subagent output arrives as additional items in `output`, each tagged `agent: { agent_name: '/root/<name>' }`
|
|
341
|
+
(root agent output uses `/root`). Notes/limits carried over from OpenAI's beta:
|
|
342
|
+
|
|
343
|
+
- `max_concurrent_subagents` defaults to `3`
|
|
344
|
+
- `reasoning.summary` and `max_tool_calls` are not supported while multi-agent is enabled
|
|
345
|
+
- Streaming is not supported while multi-agent is enabled — the SDK throws if you pass both
|
|
346
|
+
`stream: true` and `multi_agent.enabled: true`
|
|
347
|
+
|
|
254
348
|
---
|
|
255
349
|
|
|
256
350
|
## Chat Completions
|
package/openapi.yaml
CHANGED
|
@@ -13964,6 +13964,16 @@ components:
|
|
|
13964
13964
|
parameters:
|
|
13965
13965
|
type: object
|
|
13966
13966
|
additionalProperties: true
|
|
13967
|
+
output_schema:
|
|
13968
|
+
type: object
|
|
13969
|
+
additionalProperties: true
|
|
13970
|
+
allowed_callers:
|
|
13971
|
+
type: array
|
|
13972
|
+
items:
|
|
13973
|
+
type: string
|
|
13974
|
+
enum:
|
|
13975
|
+
- assistant
|
|
13976
|
+
- programmatic
|
|
13967
13977
|
required:
|
|
13968
13978
|
- type
|
|
13969
13979
|
ResponseInputItem:
|
|
@@ -14052,6 +14062,22 @@ components:
|
|
|
14052
14062
|
type: string
|
|
14053
14063
|
prompt_cache_key:
|
|
14054
14064
|
type: string
|
|
14065
|
+
multi_agent:
|
|
14066
|
+
type: object
|
|
14067
|
+
additionalProperties: true
|
|
14068
|
+
enabled:
|
|
14069
|
+
type: boolean
|
|
14070
|
+
max_concurrent_subagents:
|
|
14071
|
+
type: number
|
|
14072
|
+
service_tier:
|
|
14073
|
+
type: string
|
|
14074
|
+
enum:
|
|
14075
|
+
- auto
|
|
14076
|
+
- standard
|
|
14077
|
+
- flex
|
|
14078
|
+
- priority
|
|
14079
|
+
required:
|
|
14080
|
+
- enabled
|
|
14055
14081
|
ResponsesResult:
|
|
14056
14082
|
type: object
|
|
14057
14083
|
properties:
|