@reminix/sdk 0.9.0 → 0.11.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/CHANGELOG.md +45 -0
- package/README.md +53 -6
- package/client.d.mts +20 -11
- package/client.d.mts.map +1 -1
- package/client.d.ts +20 -11
- package/client.d.ts.map +1 -1
- package/client.js +18 -6
- package/client.js.map +1 -1
- package/client.mjs +18 -6
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +57 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +57 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +108 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +102 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/package.json +11 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/agents.d.mts +273 -148
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +273 -148
- package/resources/agents.d.ts.map +1 -1
- package/resources/agents.js +29 -3
- package/resources/agents.js.map +1 -1
- package/resources/agents.mjs +29 -3
- package/resources/agents.mjs.map +1 -1
- package/resources/conversations.d.mts +107 -0
- package/resources/conversations.d.mts.map +1 -0
- package/resources/conversations.d.ts +107 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +41 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +37 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/execution-logs.d.mts +93 -0
- package/resources/execution-logs.d.mts.map +1 -0
- package/resources/execution-logs.d.ts +93 -0
- package/resources/execution-logs.d.ts.map +1 -0
- package/resources/execution-logs.js +33 -0
- package/resources/execution-logs.js.map +1 -0
- package/resources/execution-logs.mjs +29 -0
- package/resources/execution-logs.mjs.map +1 -0
- package/resources/index.d.mts +5 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -2
- package/resources/index.mjs.map +1 -1
- package/resources/projects.d.mts +5 -5
- package/resources/projects.d.mts.map +1 -1
- package/resources/projects.d.ts +5 -5
- package/resources/projects.d.ts.map +1 -1
- package/resources/tools.d.mts +152 -0
- package/resources/tools.d.mts.map +1 -0
- package/resources/tools.d.ts +152 -0
- package/resources/tools.d.ts.map +1 -0
- package/resources/tools.js +59 -0
- package/resources/tools.js.map +1 -0
- package/resources/tools.mjs +55 -0
- package/resources/tools.mjs.map +1 -0
- package/src/client.ts +96 -22
- package/src/core/pagination.ts +165 -0
- package/src/index.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/agents.ts +336 -165
- package/src/resources/conversations.ts +146 -0
- package/src/resources/execution-logs.ts +125 -0
- package/src/resources/index.ts +31 -8
- package/src/resources/projects.ts +5 -5
- package/src/resources/tools.ts +192 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/deployments.d.mts +0 -4
- package/resources/deployments.d.mts.map +0 -1
- package/resources/deployments.d.ts +0 -4
- package/resources/deployments.d.ts.map +0 -1
- package/resources/deployments.js +0 -9
- package/resources/deployments.js.map +0 -1
- package/resources/deployments.mjs +0 -5
- package/resources/deployments.mjs.map +0 -1
- package/resources/secrets.d.mts +0 -4
- package/resources/secrets.d.mts.map +0 -1
- package/resources/secrets.d.ts +0 -4
- package/resources/secrets.d.ts.map +0 -1
- package/resources/secrets.js +0 -9
- package/resources/secrets.js.map +0 -1
- package/resources/secrets.mjs +0 -5
- package/resources/secrets.mjs.map +0 -1
- package/src/resources/deployments.ts +0 -5
- package/src/resources/secrets.ts +0 -5
package/src/resources/agents.ts
CHANGED
|
@@ -3,48 +3,64 @@
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as AgentsAPI from './agents';
|
|
5
5
|
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
|
|
6
7
|
import { Stream } from '../core/streaming';
|
|
7
8
|
import { RequestOptions } from '../internal/request-options';
|
|
8
9
|
import { path } from '../internal/utils/path';
|
|
9
10
|
|
|
10
11
|
export class Agents extends APIResource {
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
* conversation context through the messages array, allowing for multi-turn
|
|
14
|
-
* conversations.
|
|
13
|
+
* Get details of a specific agent by name.
|
|
15
14
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const agent = await client.agents.retrieve('x');
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieve(name: string, options?: RequestOptions): APIPromise<Agent> {
|
|
21
|
+
return this._client.get(path`/agents/${name}`, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List all agents in the project with optional filtering by type and status.
|
|
20
26
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* // Automatically fetches more pages as needed.
|
|
30
|
+
* for await (const agent of client.agents.list()) {
|
|
31
|
+
* // ...
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
list(
|
|
36
|
+
query: AgentListParams | null | undefined = {},
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): PagePromise<AgentsCursor, Agent> {
|
|
39
|
+
return this._client.getAPIList('/agents', Cursor<Agent>, { query, ...options });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Send a chat message to an agent and receive a response.
|
|
24
44
|
*
|
|
25
|
-
* **
|
|
45
|
+
* **Supported Agents:**
|
|
26
46
|
*
|
|
27
|
-
* -
|
|
28
|
-
* -
|
|
29
|
-
*
|
|
30
|
-
* - Conversational agents that need context
|
|
47
|
+
* - Managed agents: Always supported
|
|
48
|
+
* - Custom agents: Only supported if agent has `messages` in both requestKeys and
|
|
49
|
+
* responseKeys
|
|
31
50
|
*
|
|
32
|
-
* **
|
|
51
|
+
* **Tool Calls:** Messages support the OpenAI tool calling format:
|
|
33
52
|
*
|
|
34
|
-
* -
|
|
35
|
-
* -
|
|
36
|
-
* -
|
|
53
|
+
* - Assistant messages can include `tool_calls` array with function calls
|
|
54
|
+
* - Tool result messages use `role: "tool"` with `tool_call_id` and `name`
|
|
55
|
+
* - Content can be `null` when `tool_calls` is present
|
|
37
56
|
*
|
|
38
|
-
* **Streaming:** Set `stream: true`
|
|
39
|
-
*
|
|
40
|
-
* chat interfaces.
|
|
57
|
+
* **Streaming:** Set `stream: true` to receive Server-Sent Events (SSE) for
|
|
58
|
+
* real-time responses.
|
|
41
59
|
*
|
|
42
60
|
* @example
|
|
43
61
|
* ```ts
|
|
44
62
|
* const response = await client.agents.chat('name', {
|
|
45
|
-
* messages: [
|
|
46
|
-
* { role: 'user', content: 'What is the weather today?' },
|
|
47
|
-
* ],
|
|
63
|
+
* messages: [{ content: 'string', role: 'system' }],
|
|
48
64
|
* });
|
|
49
65
|
* ```
|
|
50
66
|
*/
|
|
@@ -76,10 +92,14 @@ export class Agents extends APIResource {
|
|
|
76
92
|
}
|
|
77
93
|
|
|
78
94
|
/**
|
|
79
|
-
* Execute
|
|
80
|
-
*
|
|
95
|
+
* Execute an agent with the provided input.
|
|
96
|
+
*
|
|
97
|
+
* **Agent Types:**
|
|
81
98
|
*
|
|
82
|
-
*
|
|
99
|
+
* - Task-oriented agents: Pass structured input data
|
|
100
|
+
* - Chat agents: Pass `{ messages: [...] }` in the input
|
|
101
|
+
*
|
|
102
|
+
* **Timeout:** Agent executions have a 60-second timeout. If the agent takes
|
|
83
103
|
* longer to respond, you will receive a 504 Gateway Timeout error. For
|
|
84
104
|
* long-running tasks, consider using streaming mode which does not have the same
|
|
85
105
|
* timeout constraints.
|
|
@@ -88,197 +108,331 @@ export class Agents extends APIResource {
|
|
|
88
108
|
* with a unique value (e.g., UUID) to ensure duplicate requests return the same
|
|
89
109
|
* response. Keys are valid for 24 hours. Streaming responses are not cached.
|
|
90
110
|
*
|
|
91
|
-
* **Use cases:**
|
|
92
|
-
*
|
|
93
|
-
* - Data analysis and processing
|
|
94
|
-
* - Content generation (with streaming for long outputs)
|
|
95
|
-
* - One-time operations that don't require conversation history
|
|
96
|
-
* - API-like operations
|
|
97
|
-
*
|
|
98
111
|
* **Streaming:** Set `stream: true` in the request body to receive Server-Sent
|
|
99
112
|
* Events (SSE) stream with incremental chunks. Useful for long-running tasks or
|
|
100
|
-
* real-time
|
|
113
|
+
* real-time chat interfaces.
|
|
101
114
|
*
|
|
102
115
|
* @example
|
|
103
116
|
* ```ts
|
|
104
|
-
* const response = await client.agents.
|
|
105
|
-
* input: {
|
|
106
|
-
* task: 'analyze this data',
|
|
107
|
-
* data: { value: 123, items: ['a', 'b', 'c'] },
|
|
108
|
-
* },
|
|
109
|
-
* });
|
|
117
|
+
* const response = await client.agents.execute('name');
|
|
110
118
|
* ```
|
|
111
119
|
*/
|
|
112
|
-
|
|
120
|
+
execute(
|
|
113
121
|
name: string,
|
|
114
|
-
body
|
|
122
|
+
body?: AgentExecuteParamsNonStreaming,
|
|
115
123
|
options?: RequestOptions,
|
|
116
|
-
): APIPromise<
|
|
117
|
-
|
|
124
|
+
): APIPromise<AgentExecuteResponse>;
|
|
125
|
+
execute(
|
|
118
126
|
name: string,
|
|
119
|
-
body:
|
|
127
|
+
body: AgentExecuteParamsStreaming,
|
|
120
128
|
options?: RequestOptions,
|
|
121
129
|
): APIPromise<Stream<StreamChunk>>;
|
|
122
|
-
|
|
130
|
+
execute(
|
|
123
131
|
name: string,
|
|
124
|
-
body
|
|
132
|
+
body?: AgentExecuteParamsBase | undefined,
|
|
125
133
|
options?: RequestOptions,
|
|
126
|
-
): APIPromise<Stream<StreamChunk> |
|
|
127
|
-
|
|
134
|
+
): APIPromise<Stream<StreamChunk> | AgentExecuteResponse>;
|
|
135
|
+
execute(
|
|
128
136
|
name: string,
|
|
129
|
-
body:
|
|
137
|
+
body: AgentExecuteParams | undefined = {},
|
|
130
138
|
options?: RequestOptions,
|
|
131
|
-
): APIPromise<
|
|
132
|
-
return this._client.post(path`/agents/${name}/
|
|
139
|
+
): APIPromise<AgentExecuteResponse> | APIPromise<Stream<StreamChunk>> {
|
|
140
|
+
return this._client.post(path`/agents/${name}/execute`, {
|
|
133
141
|
body,
|
|
134
142
|
...options,
|
|
135
|
-
stream: body
|
|
136
|
-
}) as APIPromise<
|
|
143
|
+
stream: body?.stream ?? false,
|
|
144
|
+
}) as APIPromise<AgentExecuteResponse> | APIPromise<Stream<StreamChunk>>;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export type AgentsCursor = Cursor<Agent>;
|
|
149
|
+
|
|
150
|
+
export interface Agent {
|
|
151
|
+
/**
|
|
152
|
+
* Unique agent ID
|
|
153
|
+
*/
|
|
154
|
+
id: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Whether agent supports chat interface
|
|
158
|
+
*/
|
|
159
|
+
canChat: boolean | null;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Whether agent supports streaming
|
|
163
|
+
*/
|
|
164
|
+
canStream: boolean | null;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Agent configuration (for managed agents)
|
|
168
|
+
*/
|
|
169
|
+
config: AgentConfig | null;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Creation timestamp
|
|
173
|
+
*/
|
|
174
|
+
createdAt: string;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* User who created the agent
|
|
178
|
+
*/
|
|
179
|
+
createdBy: string | null;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Agent description
|
|
183
|
+
*/
|
|
184
|
+
description: string | null;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* When the agent was discovered (for custom agents)
|
|
188
|
+
*/
|
|
189
|
+
discoveredAt: string | null;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Agent name
|
|
193
|
+
*/
|
|
194
|
+
name: string;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* JSON Schema for agent input parameters
|
|
198
|
+
*/
|
|
199
|
+
output: Agent.Output | null;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* JSON Schema for agent input parameters
|
|
203
|
+
*/
|
|
204
|
+
parameters: Agent.Parameters | null;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Project ID
|
|
208
|
+
*/
|
|
209
|
+
projectId: string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Top-level keys expected in request body
|
|
213
|
+
*/
|
|
214
|
+
requestKeys: Array<string> | null;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Top-level keys returned in response body
|
|
218
|
+
*/
|
|
219
|
+
responseKeys: Array<string> | null;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Agent status
|
|
223
|
+
*/
|
|
224
|
+
status: 'active' | 'inactive';
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Agent type: "managed" for UI-created, "{language}" for custom agents (e.g.,
|
|
228
|
+
* "python"), or "{language}-{adapter}" for adapter-based (e.g.,
|
|
229
|
+
* "python-langchain")
|
|
230
|
+
*/
|
|
231
|
+
type: string;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Last update timestamp
|
|
235
|
+
*/
|
|
236
|
+
updatedAt: string;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export namespace Agent {
|
|
240
|
+
/**
|
|
241
|
+
* JSON Schema for agent input parameters
|
|
242
|
+
*/
|
|
243
|
+
export interface Output {
|
|
244
|
+
type: string;
|
|
245
|
+
|
|
246
|
+
properties?: { [key: string]: unknown };
|
|
247
|
+
|
|
248
|
+
required?: Array<string>;
|
|
249
|
+
|
|
250
|
+
[k: string]: unknown;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* JSON Schema for agent input parameters
|
|
255
|
+
*/
|
|
256
|
+
export interface Parameters {
|
|
257
|
+
type: string;
|
|
258
|
+
|
|
259
|
+
properties?: { [key: string]: unknown };
|
|
260
|
+
|
|
261
|
+
required?: Array<string>;
|
|
262
|
+
|
|
263
|
+
[k: string]: unknown;
|
|
137
264
|
}
|
|
138
265
|
}
|
|
139
266
|
|
|
140
267
|
/**
|
|
141
|
-
*
|
|
268
|
+
* Agent configuration (for managed agents)
|
|
142
269
|
*/
|
|
143
|
-
export interface
|
|
270
|
+
export interface AgentConfig {
|
|
144
271
|
/**
|
|
145
|
-
*
|
|
272
|
+
* Model identifier (e.g., "gpt-4o", "claude-sonnet-4-20250514")
|
|
146
273
|
*/
|
|
147
|
-
|
|
274
|
+
model: string;
|
|
148
275
|
|
|
149
276
|
/**
|
|
150
|
-
*
|
|
277
|
+
* LLM provider
|
|
151
278
|
*/
|
|
152
|
-
|
|
279
|
+
provider: 'openai' | 'anthropic';
|
|
153
280
|
|
|
154
281
|
/**
|
|
155
|
-
*
|
|
282
|
+
* System prompt for the agent
|
|
156
283
|
*/
|
|
157
|
-
|
|
158
|
-
}
|
|
284
|
+
systemPrompt: string;
|
|
159
285
|
|
|
160
|
-
export interface StreamChunk {
|
|
161
286
|
/**
|
|
162
|
-
*
|
|
287
|
+
* List of tools available to the agent
|
|
163
288
|
*/
|
|
164
|
-
|
|
289
|
+
tools: Array<string>;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Maximum tool call iterations
|
|
293
|
+
*/
|
|
294
|
+
maxIterations?: number;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Whether to require approval for tool calls
|
|
298
|
+
*/
|
|
299
|
+
requireApproval?: boolean;
|
|
165
300
|
}
|
|
166
301
|
|
|
167
|
-
export interface
|
|
302
|
+
export interface ChatMessage {
|
|
303
|
+
/**
|
|
304
|
+
* Message content. Can be string, array (multimodal), object (tool), or null (when
|
|
305
|
+
* tool_calls present).
|
|
306
|
+
*/
|
|
307
|
+
content: string | Array<ChatMessage.MultimodalContent> | { [key: string]: unknown } | null;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Message role
|
|
311
|
+
*/
|
|
312
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Tool name (required when role is "tool")
|
|
316
|
+
*/
|
|
317
|
+
name?: string;
|
|
318
|
+
|
|
168
319
|
/**
|
|
169
|
-
*
|
|
320
|
+
* Tool call ID (for tool role messages)
|
|
170
321
|
*/
|
|
171
|
-
|
|
322
|
+
tool_call_id?: string;
|
|
172
323
|
|
|
173
324
|
/**
|
|
174
|
-
*
|
|
325
|
+
* Tool calls requested by assistant (for assistant role messages)
|
|
175
326
|
*/
|
|
176
|
-
|
|
327
|
+
tool_calls?: Array<ChatMessage.ToolCall>;
|
|
177
328
|
}
|
|
178
329
|
|
|
179
|
-
export namespace
|
|
180
|
-
export interface
|
|
181
|
-
|
|
182
|
-
* Message content. Can be string, array (multimodal), or object (tool).
|
|
183
|
-
*/
|
|
184
|
-
content: string | Array<Message.UnionMember1> | { [key: string]: unknown };
|
|
330
|
+
export namespace ChatMessage {
|
|
331
|
+
export interface MultimodalContent {
|
|
332
|
+
type: 'text' | 'image_url';
|
|
185
333
|
|
|
186
|
-
|
|
187
|
-
* Message role
|
|
188
|
-
*/
|
|
189
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
334
|
+
image_url?: MultimodalContent.ImageURL;
|
|
190
335
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
*/
|
|
194
|
-
name?: string;
|
|
336
|
+
text?: string;
|
|
337
|
+
}
|
|
195
338
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
339
|
+
export namespace MultimodalContent {
|
|
340
|
+
export interface ImageURL {
|
|
341
|
+
url: string;
|
|
342
|
+
}
|
|
200
343
|
}
|
|
201
344
|
|
|
202
|
-
export
|
|
203
|
-
|
|
204
|
-
type: 'text' | 'image_url';
|
|
345
|
+
export interface ToolCall {
|
|
346
|
+
id: string;
|
|
205
347
|
|
|
206
|
-
|
|
348
|
+
function: ToolCall.Function;
|
|
207
349
|
|
|
208
|
-
|
|
209
|
-
|
|
350
|
+
type: 'function';
|
|
351
|
+
}
|
|
210
352
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
353
|
+
export namespace ToolCall {
|
|
354
|
+
export interface Function {
|
|
355
|
+
arguments: string;
|
|
356
|
+
|
|
357
|
+
name: string;
|
|
215
358
|
}
|
|
216
359
|
}
|
|
217
360
|
}
|
|
218
361
|
|
|
219
|
-
export interface
|
|
362
|
+
export interface StreamChunk {
|
|
220
363
|
/**
|
|
221
|
-
*
|
|
364
|
+
* Text chunk from the stream
|
|
222
365
|
*/
|
|
223
|
-
|
|
366
|
+
chunk: string;
|
|
367
|
+
|
|
368
|
+
[k: string]: unknown;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export interface AgentChatResponse {
|
|
372
|
+
/**
|
|
373
|
+
* Array of assistant response messages
|
|
374
|
+
*/
|
|
375
|
+
messages: Array<ChatMessage>;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Conversation ID (present when conversation persistence is enabled)
|
|
379
|
+
*/
|
|
380
|
+
conversation_id?: string;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Response with dynamic keys based on agent configuration. Regular agents return {
|
|
385
|
+
* output: ... }, chat agents return { messages: [...] }.
|
|
386
|
+
*/
|
|
387
|
+
export type AgentExecuteResponse = { [key: string]: unknown };
|
|
388
|
+
|
|
389
|
+
export interface AgentListParams extends CursorParams {
|
|
390
|
+
/**
|
|
391
|
+
* Filter by agent status
|
|
392
|
+
*/
|
|
393
|
+
status?: 'active' | 'inactive';
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Filter by agent type (managed, python, typescript, python-langchain, etc.)
|
|
397
|
+
*/
|
|
398
|
+
type?: string;
|
|
224
399
|
}
|
|
225
400
|
|
|
226
401
|
export type AgentChatParams = AgentChatParamsNonStreaming | AgentChatParamsStreaming;
|
|
227
402
|
|
|
228
403
|
export interface AgentChatParamsBase {
|
|
229
404
|
/**
|
|
230
|
-
*
|
|
405
|
+
* Array of chat messages
|
|
406
|
+
*/
|
|
407
|
+
messages: Array<ChatMessage>;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Optional context for the agent execution
|
|
231
411
|
*/
|
|
232
|
-
|
|
412
|
+
context?: AgentChatParams.Context;
|
|
233
413
|
|
|
234
414
|
/**
|
|
235
|
-
*
|
|
415
|
+
* Conversation ID to continue an existing conversation
|
|
236
416
|
*/
|
|
237
|
-
|
|
417
|
+
conversation_id?: string;
|
|
238
418
|
|
|
239
419
|
/**
|
|
240
|
-
*
|
|
420
|
+
* Enable streaming response
|
|
241
421
|
*/
|
|
242
422
|
stream?: boolean;
|
|
243
423
|
}
|
|
244
424
|
|
|
245
425
|
export namespace AgentChatParams {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
content: string | Array<Message.UnionMember1> | { [key: string]: unknown };
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Message role
|
|
254
|
-
*/
|
|
255
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Tool name (required when role is "tool")
|
|
259
|
-
*/
|
|
260
|
-
name?: string;
|
|
261
|
-
|
|
426
|
+
/**
|
|
427
|
+
* Optional context for the agent execution
|
|
428
|
+
*/
|
|
429
|
+
export interface Context {
|
|
262
430
|
/**
|
|
263
|
-
*
|
|
431
|
+
* Identity fields for conversation scoping (e.g., user_id, tenant_id)
|
|
264
432
|
*/
|
|
265
|
-
|
|
266
|
-
}
|
|
433
|
+
identity?: { [key: string]: unknown };
|
|
267
434
|
|
|
268
|
-
|
|
269
|
-
export interface UnionMember1 {
|
|
270
|
-
type: 'text' | 'image_url';
|
|
271
|
-
|
|
272
|
-
image_url?: UnionMember1.ImageURL;
|
|
273
|
-
|
|
274
|
-
text?: string;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export namespace UnionMember1 {
|
|
278
|
-
export interface ImageURL {
|
|
279
|
-
url: string;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
435
|
+
[k: string]: unknown;
|
|
282
436
|
}
|
|
283
437
|
|
|
284
438
|
export type AgentChatParamsNonStreaming = AgentsAPI.AgentChatParamsNonStreaming;
|
|
@@ -287,67 +441,84 @@ export namespace AgentChatParams {
|
|
|
287
441
|
|
|
288
442
|
export interface AgentChatParamsNonStreaming extends AgentChatParamsBase {
|
|
289
443
|
/**
|
|
290
|
-
*
|
|
444
|
+
* Enable streaming response
|
|
291
445
|
*/
|
|
292
446
|
stream?: false;
|
|
293
447
|
}
|
|
294
448
|
|
|
295
449
|
export interface AgentChatParamsStreaming extends AgentChatParamsBase {
|
|
296
450
|
/**
|
|
297
|
-
*
|
|
451
|
+
* Enable streaming response
|
|
298
452
|
*/
|
|
299
453
|
stream: true;
|
|
300
454
|
}
|
|
301
455
|
|
|
302
|
-
export type
|
|
456
|
+
export type AgentExecuteParams = AgentExecuteParamsNonStreaming | AgentExecuteParamsStreaming;
|
|
303
457
|
|
|
304
|
-
export interface
|
|
458
|
+
export interface AgentExecuteParamsBase {
|
|
305
459
|
/**
|
|
306
|
-
*
|
|
460
|
+
* Optional context for the agent execution
|
|
307
461
|
*/
|
|
308
|
-
|
|
462
|
+
context?: AgentExecuteParams.Context;
|
|
309
463
|
|
|
310
464
|
/**
|
|
311
|
-
*
|
|
465
|
+
* Enable streaming response (SSE)
|
|
312
466
|
*/
|
|
313
|
-
|
|
467
|
+
stream?: boolean;
|
|
468
|
+
|
|
469
|
+
[k: string]: unknown;
|
|
470
|
+
}
|
|
314
471
|
|
|
472
|
+
export namespace AgentExecuteParams {
|
|
315
473
|
/**
|
|
316
|
-
*
|
|
474
|
+
* Optional context for the agent execution
|
|
317
475
|
*/
|
|
318
|
-
|
|
319
|
-
|
|
476
|
+
export interface Context {
|
|
477
|
+
/**
|
|
478
|
+
* Identity fields for conversation scoping (e.g., user_id, tenant_id)
|
|
479
|
+
*/
|
|
480
|
+
identity?: { [key: string]: unknown };
|
|
481
|
+
|
|
482
|
+
[k: string]: unknown;
|
|
483
|
+
}
|
|
320
484
|
|
|
321
|
-
export
|
|
322
|
-
export type
|
|
323
|
-
export type AgentInvokeParamsStreaming = AgentsAPI.AgentInvokeParamsStreaming;
|
|
485
|
+
export type AgentExecuteParamsNonStreaming = AgentsAPI.AgentExecuteParamsNonStreaming;
|
|
486
|
+
export type AgentExecuteParamsStreaming = AgentsAPI.AgentExecuteParamsStreaming;
|
|
324
487
|
}
|
|
325
488
|
|
|
326
|
-
export interface
|
|
489
|
+
export interface AgentExecuteParamsNonStreaming extends AgentExecuteParamsBase {
|
|
327
490
|
/**
|
|
328
|
-
*
|
|
491
|
+
* Enable streaming response (SSE)
|
|
329
492
|
*/
|
|
330
493
|
stream?: false;
|
|
494
|
+
|
|
495
|
+
[k: string]: unknown;
|
|
331
496
|
}
|
|
332
497
|
|
|
333
|
-
export interface
|
|
498
|
+
export interface AgentExecuteParamsStreaming extends AgentExecuteParamsBase {
|
|
334
499
|
/**
|
|
335
|
-
*
|
|
500
|
+
* Enable streaming response (SSE)
|
|
336
501
|
*/
|
|
337
502
|
stream: true;
|
|
503
|
+
|
|
504
|
+
[k: string]: unknown;
|
|
338
505
|
}
|
|
339
506
|
|
|
340
507
|
export declare namespace Agents {
|
|
341
508
|
export {
|
|
342
|
-
type
|
|
509
|
+
type Agent as Agent,
|
|
510
|
+
type AgentConfig as AgentConfig,
|
|
511
|
+
type ChatMessage as ChatMessage,
|
|
343
512
|
type StreamChunk as StreamChunk,
|
|
344
513
|
type AgentChatResponse as AgentChatResponse,
|
|
345
|
-
type
|
|
514
|
+
type AgentExecuteResponse as AgentExecuteResponse,
|
|
515
|
+
type AgentsCursor as AgentsCursor,
|
|
516
|
+
type AgentListParams as AgentListParams,
|
|
346
517
|
type AgentChatParams as AgentChatParams,
|
|
347
518
|
type AgentChatParamsNonStreaming as AgentChatParamsNonStreaming,
|
|
348
519
|
type AgentChatParamsStreaming as AgentChatParamsStreaming,
|
|
349
|
-
type
|
|
350
|
-
type
|
|
351
|
-
type
|
|
520
|
+
type AgentExecuteParams as AgentExecuteParams,
|
|
521
|
+
type AgentExecuteParamsNonStreaming as AgentExecuteParamsNonStreaming,
|
|
522
|
+
type AgentExecuteParamsStreaming as AgentExecuteParamsStreaming,
|
|
352
523
|
};
|
|
353
524
|
}
|