@amigo-ai/platform-sdk 0.62.1 → 0.64.0
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/api.md +1 -0
- package/dist/index.cjs +29 -3
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +29 -3
- package/dist/index.mjs.map +2 -2
- package/dist/resources/conversations.js +33 -3
- package/dist/resources/conversations.js.map +1 -1
- package/dist/types/generated/api.d.ts +1268 -428
- package/dist/types/generated/api.d.ts.map +1 -1
- package/dist/types/resources/context-graphs.d.ts +80 -0
- package/dist/types/resources/context-graphs.d.ts.map +1 -1
- package/dist/types/resources/conversations.d.ts +23 -0
- package/dist/types/resources/conversations.d.ts.map +1 -1
- package/dist/types/resources/data-sources.d.ts +5 -15
- package/dist/types/resources/data-sources.d.ts.map +1 -1
- package/dist/types/resources/intake.d.ts.map +1 -1
- package/dist/types/resources/integrations.d.ts +5 -0
- package/dist/types/resources/integrations.d.ts.map +1 -1
- package/dist/types/resources/metrics.d.ts.map +1 -1
- package/dist/types/resources/operators.d.ts.map +1 -1
- package/dist/types/resources/pipeline.d.ts +3 -3
- package/dist/types/resources/services.d.ts.map +1 -1
- package/dist/types/resources/settings.d.ts.map +1 -1
- package/dist/types/resources/surfaces.d.ts.map +1 -1
- package/dist/types/resources/world.d.ts.map +1 -1
- package/package.json +1 -1
package/api.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2206,21 +2206,47 @@ var ConversationsResource = class extends WorkspaceScopedResource {
|
|
|
2206
2206
|
* alongside the response turns. Server-side default is `false` — without
|
|
2207
2207
|
* this opt-in the `tool_calls` array on the `TurnResponse` will be empty
|
|
2208
2208
|
* even when the agent invoked tools during the turn.
|
|
2209
|
+
*
|
|
2210
|
+
* Pass `options.poll: true` for a no-message drain-and-report poll (see
|
|
2211
|
+
* {@link pollTurn} for the ergonomic wrapper): the agent surfaces any
|
|
2212
|
+
* background tool results that completed since the last turn. A poll must
|
|
2213
|
+
* NOT carry a `request.message` (the server rejects it 422); prefer
|
|
2214
|
+
* {@link pollTurn}.
|
|
2209
2215
|
*/
|
|
2210
2216
|
async createTurn(conversationId, request, options) {
|
|
2217
|
+
if (options?.poll && request.message) {
|
|
2218
|
+
throw new ConfigurationError("poll cannot be combined with a message; use pollTurn() instead");
|
|
2219
|
+
}
|
|
2220
|
+
const query = {};
|
|
2221
|
+
if (options?.includeToolCalls !== void 0) query.include_tool_calls = options.includeToolCalls;
|
|
2222
|
+
if (options?.poll !== void 0) query.poll = options.poll;
|
|
2211
2223
|
return extractData(
|
|
2212
2224
|
await this.client.POST("/v1/{workspace_id}/conversations/{conversation_id}/turns", {
|
|
2213
2225
|
params: {
|
|
2214
2226
|
path: { workspace_id: this.workspaceId, conversation_id: conversationId },
|
|
2215
|
-
...
|
|
2216
|
-
query: { include_tool_calls: options.includeToolCalls }
|
|
2217
|
-
}
|
|
2227
|
+
...Object.keys(query).length > 0 && { query }
|
|
2218
2228
|
},
|
|
2219
2229
|
body: request,
|
|
2220
2230
|
headers: { Accept: "application/json" }
|
|
2221
2231
|
})
|
|
2222
2232
|
);
|
|
2223
2233
|
}
|
|
2234
|
+
/**
|
|
2235
|
+
* Poll a conversation for background tool results without sending a user
|
|
2236
|
+
* message. Drains any background tool calls that completed since the last
|
|
2237
|
+
* turn and returns the agent's report; when nothing is pending the response
|
|
2238
|
+
* has empty `output` and `tool_calls` (the idle case) — treat that as "keep
|
|
2239
|
+
* polling". Poll no more than once every ~5s per conversation.
|
|
2240
|
+
*
|
|
2241
|
+
* @example
|
|
2242
|
+
* ```ts
|
|
2243
|
+
* const res = await client.conversations.pollTurn(convId, { includeToolCalls: true });
|
|
2244
|
+
* if (res.output.length || res.tool_calls?.length) render(res); // else poll again later
|
|
2245
|
+
* ```
|
|
2246
|
+
*/
|
|
2247
|
+
async pollTurn(conversationId, options) {
|
|
2248
|
+
return this.createTurn(conversationId, {}, { ...options, poll: true });
|
|
2249
|
+
}
|
|
2224
2250
|
/**
|
|
2225
2251
|
* Send a message and receive the agent's response as an SSE byte stream.
|
|
2226
2252
|
*
|