@reminix/sdk 0.10.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 +34 -0
- package/README.md +47 -0
- package/client.d.mts +19 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +19 -4
- package/client.d.ts.map +1 -1
- package/client.js +18 -0
- package/client.js.map +1 -1
- package/client.mjs +18 -0
- 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 +257 -98
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +257 -98
- 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 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/projects.d.mts +1 -11
- package/resources/projects.d.mts.map +1 -1
- package/resources/projects.d.ts +1 -11
- 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 +94 -12
- package/src/core/pagination.ts +165 -0
- package/src/index.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/agents.ts +319 -109
- package/src/resources/conversations.ts +146 -0
- package/src/resources/execution-logs.ts +125 -0
- package/src/resources/index.ts +30 -6
- package/src/resources/projects.ts +1 -13
- package/src/resources/tools.ts +192 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
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
|
-
* task-oriented operations where you provide input and receive a complete output.
|
|
95
|
+
* Execute an agent with the provided input.
|
|
81
96
|
*
|
|
82
|
-
* **
|
|
97
|
+
* **Agent Types:**
|
|
98
|
+
*
|
|
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,60 +108,203 @@ 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>>;
|
|
137
145
|
}
|
|
138
146
|
}
|
|
139
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;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Agent configuration (for managed agents)
|
|
269
|
+
*/
|
|
270
|
+
export interface AgentConfig {
|
|
271
|
+
/**
|
|
272
|
+
* Model identifier (e.g., "gpt-4o", "claude-sonnet-4-20250514")
|
|
273
|
+
*/
|
|
274
|
+
model: string;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* LLM provider
|
|
278
|
+
*/
|
|
279
|
+
provider: 'openai' | 'anthropic';
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* System prompt for the agent
|
|
283
|
+
*/
|
|
284
|
+
systemPrompt: string;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* List of tools available to the agent
|
|
288
|
+
*/
|
|
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;
|
|
300
|
+
}
|
|
301
|
+
|
|
140
302
|
export interface ChatMessage {
|
|
141
303
|
/**
|
|
142
|
-
* Message content. Can be string, array (multimodal),
|
|
304
|
+
* Message content. Can be string, array (multimodal), object (tool), or null (when
|
|
305
|
+
* tool_calls present).
|
|
143
306
|
*/
|
|
144
|
-
content: string | Array<ChatMessage.MultimodalContent> | { [key: string]: unknown };
|
|
307
|
+
content: string | Array<ChatMessage.MultimodalContent> | { [key: string]: unknown } | null;
|
|
145
308
|
|
|
146
309
|
/**
|
|
147
310
|
* Message role
|
|
@@ -154,9 +317,14 @@ export interface ChatMessage {
|
|
|
154
317
|
name?: string;
|
|
155
318
|
|
|
156
319
|
/**
|
|
157
|
-
* Tool call ID (for tool role)
|
|
320
|
+
* Tool call ID (for tool role messages)
|
|
158
321
|
*/
|
|
159
322
|
tool_call_id?: string;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Tool calls requested by assistant (for assistant role messages)
|
|
326
|
+
*/
|
|
327
|
+
tool_calls?: Array<ChatMessage.ToolCall>;
|
|
160
328
|
}
|
|
161
329
|
|
|
162
330
|
export namespace ChatMessage {
|
|
@@ -173,26 +341,22 @@ export namespace ChatMessage {
|
|
|
173
341
|
url: string;
|
|
174
342
|
}
|
|
175
343
|
}
|
|
176
|
-
}
|
|
177
344
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
*/
|
|
181
|
-
export interface Context {
|
|
182
|
-
/**
|
|
183
|
-
* ID to track multi-turn conversations
|
|
184
|
-
*/
|
|
185
|
-
conversation_id?: string;
|
|
345
|
+
export interface ToolCall {
|
|
346
|
+
id: string;
|
|
186
347
|
|
|
187
|
-
|
|
188
|
-
* Additional custom context fields
|
|
189
|
-
*/
|
|
190
|
-
custom?: { [key: string]: unknown };
|
|
348
|
+
function: ToolCall.Function;
|
|
191
349
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
350
|
+
type: 'function';
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export namespace ToolCall {
|
|
354
|
+
export interface Function {
|
|
355
|
+
arguments: string;
|
|
356
|
+
|
|
357
|
+
name: string;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
196
360
|
}
|
|
197
361
|
|
|
198
362
|
export interface StreamChunk {
|
|
@@ -200,115 +364,161 @@ export interface StreamChunk {
|
|
|
200
364
|
* Text chunk from the stream
|
|
201
365
|
*/
|
|
202
366
|
chunk: string;
|
|
367
|
+
|
|
368
|
+
[k: string]: unknown;
|
|
203
369
|
}
|
|
204
370
|
|
|
205
371
|
export interface AgentChatResponse {
|
|
206
372
|
/**
|
|
207
|
-
*
|
|
373
|
+
* Array of assistant response messages
|
|
208
374
|
*/
|
|
209
375
|
messages: Array<ChatMessage>;
|
|
210
376
|
|
|
211
377
|
/**
|
|
212
|
-
*
|
|
378
|
+
* Conversation ID (present when conversation persistence is enabled)
|
|
213
379
|
*/
|
|
214
|
-
|
|
380
|
+
conversation_id?: string;
|
|
215
381
|
}
|
|
216
382
|
|
|
217
|
-
|
|
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 {
|
|
218
390
|
/**
|
|
219
|
-
*
|
|
391
|
+
* Filter by agent status
|
|
220
392
|
*/
|
|
221
|
-
|
|
393
|
+
status?: 'active' | 'inactive';
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Filter by agent type (managed, python, typescript, python-langchain, etc.)
|
|
397
|
+
*/
|
|
398
|
+
type?: string;
|
|
222
399
|
}
|
|
223
400
|
|
|
224
401
|
export type AgentChatParams = AgentChatParamsNonStreaming | AgentChatParamsStreaming;
|
|
225
402
|
|
|
226
403
|
export interface AgentChatParamsBase {
|
|
227
404
|
/**
|
|
228
|
-
*
|
|
405
|
+
* Array of chat messages
|
|
229
406
|
*/
|
|
230
407
|
messages: Array<ChatMessage>;
|
|
231
408
|
|
|
232
409
|
/**
|
|
233
|
-
* Optional
|
|
410
|
+
* Optional context for the agent execution
|
|
234
411
|
*/
|
|
235
|
-
context?: Context;
|
|
412
|
+
context?: AgentChatParams.Context;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Conversation ID to continue an existing conversation
|
|
416
|
+
*/
|
|
417
|
+
conversation_id?: string;
|
|
236
418
|
|
|
237
419
|
/**
|
|
238
|
-
*
|
|
420
|
+
* Enable streaming response
|
|
239
421
|
*/
|
|
240
422
|
stream?: boolean;
|
|
241
423
|
}
|
|
242
424
|
|
|
243
425
|
export namespace AgentChatParams {
|
|
426
|
+
/**
|
|
427
|
+
* Optional context for the agent execution
|
|
428
|
+
*/
|
|
429
|
+
export interface Context {
|
|
430
|
+
/**
|
|
431
|
+
* Identity fields for conversation scoping (e.g., user_id, tenant_id)
|
|
432
|
+
*/
|
|
433
|
+
identity?: { [key: string]: unknown };
|
|
434
|
+
|
|
435
|
+
[k: string]: unknown;
|
|
436
|
+
}
|
|
437
|
+
|
|
244
438
|
export type AgentChatParamsNonStreaming = AgentsAPI.AgentChatParamsNonStreaming;
|
|
245
439
|
export type AgentChatParamsStreaming = AgentsAPI.AgentChatParamsStreaming;
|
|
246
440
|
}
|
|
247
441
|
|
|
248
442
|
export interface AgentChatParamsNonStreaming extends AgentChatParamsBase {
|
|
249
443
|
/**
|
|
250
|
-
*
|
|
444
|
+
* Enable streaming response
|
|
251
445
|
*/
|
|
252
446
|
stream?: false;
|
|
253
447
|
}
|
|
254
448
|
|
|
255
449
|
export interface AgentChatParamsStreaming extends AgentChatParamsBase {
|
|
256
450
|
/**
|
|
257
|
-
*
|
|
451
|
+
* Enable streaming response
|
|
258
452
|
*/
|
|
259
453
|
stream: true;
|
|
260
454
|
}
|
|
261
455
|
|
|
262
|
-
export type
|
|
456
|
+
export type AgentExecuteParams = AgentExecuteParamsNonStreaming | AgentExecuteParamsStreaming;
|
|
263
457
|
|
|
264
|
-
export interface
|
|
458
|
+
export interface AgentExecuteParamsBase {
|
|
265
459
|
/**
|
|
266
|
-
*
|
|
460
|
+
* Optional context for the agent execution
|
|
267
461
|
*/
|
|
268
|
-
|
|
462
|
+
context?: AgentExecuteParams.Context;
|
|
269
463
|
|
|
270
464
|
/**
|
|
271
|
-
*
|
|
465
|
+
* Enable streaming response (SSE)
|
|
272
466
|
*/
|
|
273
|
-
|
|
467
|
+
stream?: boolean;
|
|
468
|
+
|
|
469
|
+
[k: string]: unknown;
|
|
470
|
+
}
|
|
274
471
|
|
|
472
|
+
export namespace AgentExecuteParams {
|
|
275
473
|
/**
|
|
276
|
-
*
|
|
474
|
+
* Optional context for the agent execution
|
|
277
475
|
*/
|
|
278
|
-
|
|
279
|
-
|
|
476
|
+
export interface Context {
|
|
477
|
+
/**
|
|
478
|
+
* Identity fields for conversation scoping (e.g., user_id, tenant_id)
|
|
479
|
+
*/
|
|
480
|
+
identity?: { [key: string]: unknown };
|
|
280
481
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
482
|
+
[k: string]: unknown;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export type AgentExecuteParamsNonStreaming = AgentsAPI.AgentExecuteParamsNonStreaming;
|
|
486
|
+
export type AgentExecuteParamsStreaming = AgentsAPI.AgentExecuteParamsStreaming;
|
|
284
487
|
}
|
|
285
488
|
|
|
286
|
-
export interface
|
|
489
|
+
export interface AgentExecuteParamsNonStreaming extends AgentExecuteParamsBase {
|
|
287
490
|
/**
|
|
288
|
-
*
|
|
491
|
+
* Enable streaming response (SSE)
|
|
289
492
|
*/
|
|
290
493
|
stream?: false;
|
|
494
|
+
|
|
495
|
+
[k: string]: unknown;
|
|
291
496
|
}
|
|
292
497
|
|
|
293
|
-
export interface
|
|
498
|
+
export interface AgentExecuteParamsStreaming extends AgentExecuteParamsBase {
|
|
294
499
|
/**
|
|
295
|
-
*
|
|
500
|
+
* Enable streaming response (SSE)
|
|
296
501
|
*/
|
|
297
502
|
stream: true;
|
|
503
|
+
|
|
504
|
+
[k: string]: unknown;
|
|
298
505
|
}
|
|
299
506
|
|
|
300
507
|
export declare namespace Agents {
|
|
301
508
|
export {
|
|
509
|
+
type Agent as Agent,
|
|
510
|
+
type AgentConfig as AgentConfig,
|
|
302
511
|
type ChatMessage as ChatMessage,
|
|
303
|
-
type Context as Context,
|
|
304
512
|
type StreamChunk as StreamChunk,
|
|
305
513
|
type AgentChatResponse as AgentChatResponse,
|
|
306
|
-
type
|
|
514
|
+
type AgentExecuteResponse as AgentExecuteResponse,
|
|
515
|
+
type AgentsCursor as AgentsCursor,
|
|
516
|
+
type AgentListParams as AgentListParams,
|
|
307
517
|
type AgentChatParams as AgentChatParams,
|
|
308
518
|
type AgentChatParamsNonStreaming as AgentChatParamsNonStreaming,
|
|
309
519
|
type AgentChatParamsStreaming as AgentChatParamsStreaming,
|
|
310
|
-
type
|
|
311
|
-
type
|
|
312
|
-
type
|
|
520
|
+
type AgentExecuteParams as AgentExecuteParams,
|
|
521
|
+
type AgentExecuteParamsNonStreaming as AgentExecuteParamsNonStreaming,
|
|
522
|
+
type AgentExecuteParamsStreaming as AgentExecuteParamsStreaming,
|
|
313
523
|
};
|
|
314
524
|
}
|