@orq-ai/node 3.14.44 → 3.14.45
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/bin/mcp-server.js +209 -209
- package/bin/mcp-server.js.map +35 -35
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/operations/createbudget.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +8 -8
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +28 -28
- package/models/operations/createtool.js +10 -10
- package/models/operations/duplicatetool.js +10 -10
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getalltools.js +10 -10
- package/models/operations/getbudget.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/listbudgets.js +2 -2
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +8 -8
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +8 -8
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrievetool.js +10 -10
- package/models/operations/updatebudget.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updatedatapoint.js +8 -8
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +28 -28
- package/models/operations/updatetool.js +10 -10
- package/package.json +1 -1
- package/packages/orq-rc/README.md +3 -4
- package/packages/orq-rc/docs/sdks/agents/README.md +195 -157
- package/packages/orq-rc/docs/sdks/chunking/README.md +2 -0
- package/packages/orq-rc/docs/sdks/memorystores/README.md +3 -4
- package/packages/orq-rc/examples/package-lock.json +1 -1
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/agentsCreate.ts +1 -1
- package/packages/orq-rc/src/funcs/agentsInvoke.ts +4 -4
- package/packages/orq-rc/src/funcs/agentsListTasks.ts +4 -4
- package/packages/orq-rc/src/funcs/agentsRetrieveTask.ts +8 -8
- package/packages/orq-rc/src/funcs/agentsRun.ts +4 -4
- package/packages/orq-rc/src/funcs/agentsStream.ts +1 -0
- package/packages/orq-rc/src/funcs/agentsStreamRun.ts +1 -0
- package/packages/orq-rc/src/funcs/memoryStoresCreate.ts +2 -11
- package/packages/orq-rc/src/lib/config.ts +2 -2
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +3 -3
- package/packages/orq-rc/src/models/errors/index.ts +0 -1
- package/packages/orq-rc/src/models/operations/createagent.ts +31 -13
- package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +8 -8
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +368 -294
- package/packages/orq-rc/src/models/operations/createknowledge.ts +33 -47
- package/packages/orq-rc/src/models/operations/createtool.ts +198 -161
- package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +17 -24
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/getagent.ts +9 -0
- package/packages/orq-rc/src/models/operations/getagenttask.ts +1873 -428
- package/packages/orq-rc/src/models/operations/getalltools.ts +284 -231
- package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/invokeagent.ts +319 -299
- package/packages/orq-rc/src/models/operations/listagents.ts +9 -0
- package/packages/orq-rc/src/models/operations/listagenttasks.ts +2029 -540
- package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listchunks.ts +14 -14
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +15 -22
- package/packages/orq-rc/src/models/operations/parse.ts +16 -0
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +8 -8
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievetool.ts +168 -132
- package/packages/orq-rc/src/models/operations/runagent.ts +264 -220
- package/packages/orq-rc/src/models/operations/streamagent.ts +7635 -414
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +10745 -3582
- package/packages/orq-rc/src/models/operations/updateagent.ts +56 -31
- package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +8 -8
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateeval.ts +28 -28
- package/packages/orq-rc/src/models/operations/updatetool.ts +138 -104
- package/packages/orq-rc/src/sdk/agents.ts +37 -37
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/operations/createbudget.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +8 -8
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +28 -28
- package/src/models/operations/createtool.ts +10 -10
- package/src/models/operations/duplicatetool.ts +10 -10
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/getalltools.ts +10 -10
- package/src/models/operations/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/listbudgets.ts +2 -2
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +8 -8
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrievetool.ts +10 -10
- package/src/models/operations/updatebudget.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +8 -8
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +28 -28
- package/src/models/operations/updatetool.ts +10 -10
- package/packages/orq-rc/src/models/errors/getagenttask.ts +0 -67
|
@@ -5,103 +5,27 @@
|
|
|
5
5
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
|
-
* [retrieveTask](#retrievetask) - Retrieve a specific agent task
|
|
9
8
|
* [create](#create) - Create a new agent
|
|
10
|
-
* [list](#list) - List all agents
|
|
11
9
|
* [delete](#delete) - Delete an agent
|
|
12
10
|
* [retrieve](#retrieve) - Get an agent
|
|
13
11
|
* [update](#update) - Update an agent
|
|
14
12
|
* [invoke](#invoke) - Invoke an agent
|
|
15
13
|
* [listTasks](#listtasks) - List all tasks for an agent
|
|
14
|
+
* [retrieveTask](#retrievetask) - Retrieve a specific agent task
|
|
15
|
+
* [list](#list) - List all agents
|
|
16
16
|
* [run](#run) - Run an agent
|
|
17
17
|
* [streamRun](#streamrun) - Run and stream agent execution
|
|
18
18
|
* [stream](#stream) - Stream agent execution events
|
|
19
19
|
* [listActions](#listactions) - List all actions
|
|
20
20
|
* [retrieveAction](#retrieveaction) - Retrieve an action executed by an agent task.
|
|
21
21
|
|
|
22
|
-
## retrieveTask
|
|
23
|
-
|
|
24
|
-
Retrieves detailed information about a specific task for a given agent, including execution status and results.
|
|
25
|
-
|
|
26
|
-
### Example Usage
|
|
27
|
-
|
|
28
|
-
<!-- UsageSnippet language="typescript" operationID="GetAgentTask" method="get" path="/v2/agents/{agent_key}/tasks/{task_id}" -->
|
|
29
|
-
```typescript
|
|
30
|
-
import { Orq } from "@orq-ai/node";
|
|
31
|
-
|
|
32
|
-
const orq = new Orq({
|
|
33
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
async function run() {
|
|
37
|
-
const result = await orq.agents.retrieveTask({
|
|
38
|
-
agentKey: "<value>",
|
|
39
|
-
taskId: "<id>",
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
console.log(result);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
run();
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Standalone function
|
|
49
|
-
|
|
50
|
-
The standalone function version of this method:
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
import { OrqCore } from "@orq-ai/node/core.js";
|
|
54
|
-
import { agentsRetrieveTask } from "@orq-ai/node/funcs/agentsRetrieveTask.js";
|
|
55
|
-
|
|
56
|
-
// Use `OrqCore` for best tree-shaking performance.
|
|
57
|
-
// You can create one instance of it to use across an application.
|
|
58
|
-
const orq = new OrqCore({
|
|
59
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
async function run() {
|
|
63
|
-
const res = await agentsRetrieveTask(orq, {
|
|
64
|
-
agentKey: "<value>",
|
|
65
|
-
taskId: "<id>",
|
|
66
|
-
});
|
|
67
|
-
if (res.ok) {
|
|
68
|
-
const { value: result } = res;
|
|
69
|
-
console.log(result);
|
|
70
|
-
} else {
|
|
71
|
-
console.log("agentsRetrieveTask failed:", res.error);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
run();
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Parameters
|
|
79
|
-
|
|
80
|
-
| Parameter | Type | Required | Description |
|
|
81
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
82
|
-
| `request` | [operations.GetAgentTaskRequest](../../models/operations/getagenttaskrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
83
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
84
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
85
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
86
|
-
|
|
87
|
-
### Response
|
|
88
|
-
|
|
89
|
-
**Promise\<[operations.GetAgentTaskResponseBody](../../models/operations/getagenttaskresponsebody.md)\>**
|
|
90
|
-
|
|
91
|
-
### Errors
|
|
92
|
-
|
|
93
|
-
| Error Type | Status Code | Content Type |
|
|
94
|
-
| ------------------------------- | ------------------------------- | ------------------------------- |
|
|
95
|
-
| errors.GetAgentTaskResponseBody | 404 | application/json |
|
|
96
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
97
|
-
|
|
98
22
|
## create
|
|
99
23
|
|
|
100
24
|
Creates a new AI agent with specified configuration. Agents can be configured with a primary model and an optional fallback model that will be used automatically if the primary model fails.
|
|
101
25
|
|
|
102
26
|
### Example Usage
|
|
103
27
|
|
|
104
|
-
<!-- UsageSnippet language="typescript" operationID="CreateAgent" method="post" path="/v2/agents
|
|
28
|
+
<!-- UsageSnippet language="typescript" operationID="CreateAgent" method="post" path="/v2/agents" -->
|
|
105
29
|
```typescript
|
|
106
30
|
import { Orq } from "@orq-ai/node";
|
|
107
31
|
|
|
@@ -117,7 +41,16 @@ async function run() {
|
|
|
117
41
|
instructions: "<value>",
|
|
118
42
|
path: "Default",
|
|
119
43
|
model: "Camaro",
|
|
120
|
-
settings: {
|
|
44
|
+
settings: {
|
|
45
|
+
tools: [
|
|
46
|
+
{
|
|
47
|
+
type: "mcp",
|
|
48
|
+
id: "01KA84ND5J0SWQMA2Q8HY5WZZZ",
|
|
49
|
+
toolId: "01KXYZ123456789",
|
|
50
|
+
requiresApproval: false,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
121
54
|
knowledgeBases: [
|
|
122
55
|
{
|
|
123
56
|
knowledgeId: "customer-knowledge-base",
|
|
@@ -153,7 +86,16 @@ async function run() {
|
|
|
153
86
|
instructions: "<value>",
|
|
154
87
|
path: "Default",
|
|
155
88
|
model: "Camaro",
|
|
156
|
-
settings: {
|
|
89
|
+
settings: {
|
|
90
|
+
tools: [
|
|
91
|
+
{
|
|
92
|
+
type: "mcp",
|
|
93
|
+
id: "01KA84ND5J0SWQMA2Q8HY5WZZZ",
|
|
94
|
+
toolId: "01KXYZ123456789",
|
|
95
|
+
requiresApproval: false,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
157
99
|
knowledgeBases: [
|
|
158
100
|
{
|
|
159
101
|
knowledgeId: "customer-knowledge-base",
|
|
@@ -191,79 +133,6 @@ run();
|
|
|
191
133
|
| errors.CreateAgentResponseBody | 409 | application/json |
|
|
192
134
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
193
135
|
|
|
194
|
-
## list
|
|
195
|
-
|
|
196
|
-
Retrieves a list of all agents in your workspace. When no limit is provided, returns all agents without pagination. When a limit is specified, returns a paginated list. Each agent includes its configuration, primary model, and optional fallback model settings.
|
|
197
|
-
|
|
198
|
-
### Example Usage
|
|
199
|
-
|
|
200
|
-
<!-- UsageSnippet language="typescript" operationID="ListAgents" method="get" path="/v2/agents/" -->
|
|
201
|
-
```typescript
|
|
202
|
-
import { Orq } from "@orq-ai/node";
|
|
203
|
-
|
|
204
|
-
const orq = new Orq({
|
|
205
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
async function run() {
|
|
209
|
-
const result = await orq.agents.list({
|
|
210
|
-
limit: 10,
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
console.log(result);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
run();
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Standalone function
|
|
220
|
-
|
|
221
|
-
The standalone function version of this method:
|
|
222
|
-
|
|
223
|
-
```typescript
|
|
224
|
-
import { OrqCore } from "@orq-ai/node/core.js";
|
|
225
|
-
import { agentsList } from "@orq-ai/node/funcs/agentsList.js";
|
|
226
|
-
|
|
227
|
-
// Use `OrqCore` for best tree-shaking performance.
|
|
228
|
-
// You can create one instance of it to use across an application.
|
|
229
|
-
const orq = new OrqCore({
|
|
230
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
async function run() {
|
|
234
|
-
const res = await agentsList(orq, {
|
|
235
|
-
limit: 10,
|
|
236
|
-
});
|
|
237
|
-
if (res.ok) {
|
|
238
|
-
const { value: result } = res;
|
|
239
|
-
console.log(result);
|
|
240
|
-
} else {
|
|
241
|
-
console.log("agentsList failed:", res.error);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
run();
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
### Parameters
|
|
249
|
-
|
|
250
|
-
| Parameter | Type | Required | Description |
|
|
251
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
252
|
-
| `request` | [operations.ListAgentsRequest](../../models/operations/listagentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
253
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
254
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
255
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
256
|
-
|
|
257
|
-
### Response
|
|
258
|
-
|
|
259
|
-
**Promise\<[operations.ListAgentsResponseBody](../../models/operations/listagentsresponsebody.md)\>**
|
|
260
|
-
|
|
261
|
-
### Errors
|
|
262
|
-
|
|
263
|
-
| Error Type | Status Code | Content Type |
|
|
264
|
-
| --------------- | --------------- | --------------- |
|
|
265
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
266
|
-
|
|
267
136
|
## delete
|
|
268
137
|
|
|
269
138
|
Permanently deletes an agent and all its configuration, including primary and fallback model settings.
|
|
@@ -431,6 +300,16 @@ async function run() {
|
|
|
431
300
|
agentKey: "<value>",
|
|
432
301
|
requestBody: {
|
|
433
302
|
model: "El Camino",
|
|
303
|
+
settings: {
|
|
304
|
+
tools: [
|
|
305
|
+
{
|
|
306
|
+
type: "mcp",
|
|
307
|
+
id: "01KA84ND5J0SWQMA2Q8HY5WZZZ",
|
|
308
|
+
toolId: "01KXYZ123456789",
|
|
309
|
+
requiresApproval: false,
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
},
|
|
434
313
|
path: "Default",
|
|
435
314
|
knowledgeBases: [
|
|
436
315
|
{
|
|
@@ -465,6 +344,16 @@ async function run() {
|
|
|
465
344
|
agentKey: "<value>",
|
|
466
345
|
requestBody: {
|
|
467
346
|
model: "El Camino",
|
|
347
|
+
settings: {
|
|
348
|
+
tools: [
|
|
349
|
+
{
|
|
350
|
+
type: "mcp",
|
|
351
|
+
id: "01KA84ND5J0SWQMA2Q8HY5WZZZ",
|
|
352
|
+
toolId: "01KXYZ123456789",
|
|
353
|
+
requiresApproval: false,
|
|
354
|
+
},
|
|
355
|
+
],
|
|
356
|
+
},
|
|
468
357
|
path: "Default",
|
|
469
358
|
knowledgeBases: [
|
|
470
359
|
{
|
|
@@ -627,7 +516,7 @@ run();
|
|
|
627
516
|
|
|
628
517
|
### Response
|
|
629
518
|
|
|
630
|
-
**Promise\<[operations.
|
|
519
|
+
**Promise\<[operations.InvokeAgentA2ATaskResponse](../../models/operations/invokeagenta2ataskresponse.md)\>**
|
|
631
520
|
|
|
632
521
|
### Errors
|
|
633
522
|
|
|
@@ -700,7 +589,7 @@ run();
|
|
|
700
589
|
|
|
701
590
|
### Response
|
|
702
591
|
|
|
703
|
-
**Promise\<[operations.
|
|
592
|
+
**Promise\<[operations.ListAgentTasksAgentTasksListResponse](../../models/operations/listagenttasksagenttaskslistresponse.md)\>**
|
|
704
593
|
|
|
705
594
|
### Errors
|
|
706
595
|
|
|
@@ -709,6 +598,155 @@ run();
|
|
|
709
598
|
| errors.ListAgentTasksResponseBody | 404 | application/json |
|
|
710
599
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
711
600
|
|
|
601
|
+
## retrieveTask
|
|
602
|
+
|
|
603
|
+
Retrieves detailed information about a specific task for a given agent, including execution status and results.
|
|
604
|
+
|
|
605
|
+
### Example Usage
|
|
606
|
+
|
|
607
|
+
<!-- UsageSnippet language="typescript" operationID="GetAgentTask" method="get" path="/v2/agents/{agent_key}/tasks/{task_id}" -->
|
|
608
|
+
```typescript
|
|
609
|
+
import { Orq } from "@orq-ai/node";
|
|
610
|
+
|
|
611
|
+
const orq = new Orq({
|
|
612
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
async function run() {
|
|
616
|
+
const result = await orq.agents.retrieveTask({
|
|
617
|
+
agentKey: "<value>",
|
|
618
|
+
taskId: "<id>",
|
|
619
|
+
});
|
|
620
|
+
|
|
621
|
+
console.log(result);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
run();
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
### Standalone function
|
|
628
|
+
|
|
629
|
+
The standalone function version of this method:
|
|
630
|
+
|
|
631
|
+
```typescript
|
|
632
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
633
|
+
import { agentsRetrieveTask } from "@orq-ai/node/funcs/agentsRetrieveTask.js";
|
|
634
|
+
|
|
635
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
636
|
+
// You can create one instance of it to use across an application.
|
|
637
|
+
const orq = new OrqCore({
|
|
638
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
639
|
+
});
|
|
640
|
+
|
|
641
|
+
async function run() {
|
|
642
|
+
const res = await agentsRetrieveTask(orq, {
|
|
643
|
+
agentKey: "<value>",
|
|
644
|
+
taskId: "<id>",
|
|
645
|
+
});
|
|
646
|
+
if (res.ok) {
|
|
647
|
+
const { value: result } = res;
|
|
648
|
+
console.log(result);
|
|
649
|
+
} else {
|
|
650
|
+
console.log("agentsRetrieveTask failed:", res.error);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
run();
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
### Parameters
|
|
658
|
+
|
|
659
|
+
| Parameter | Type | Required | Description |
|
|
660
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
661
|
+
| `request` | [operations.GetAgentTaskRequest](../../models/operations/getagenttaskrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
662
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
663
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
664
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
665
|
+
|
|
666
|
+
### Response
|
|
667
|
+
|
|
668
|
+
**Promise\<[operations.GetAgentTaskExtendedTaskResponse](../../models/operations/getagenttaskextendedtaskresponse.md)\>**
|
|
669
|
+
|
|
670
|
+
### Errors
|
|
671
|
+
|
|
672
|
+
| Error Type | Status Code | Content Type |
|
|
673
|
+
| ------------------- | ------------------- | ------------------- |
|
|
674
|
+
| errors.HonoApiError | 404 | application/json |
|
|
675
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
676
|
+
|
|
677
|
+
## list
|
|
678
|
+
|
|
679
|
+
Retrieves a list of all agents in your workspace. When no limit is provided, returns all agents without pagination. When a limit is specified, returns a paginated list. Each agent includes its configuration, primary model, and optional fallback model settings.
|
|
680
|
+
|
|
681
|
+
### Example Usage
|
|
682
|
+
|
|
683
|
+
<!-- UsageSnippet language="typescript" operationID="ListAgents" method="get" path="/v2/agents/" -->
|
|
684
|
+
```typescript
|
|
685
|
+
import { Orq } from "@orq-ai/node";
|
|
686
|
+
|
|
687
|
+
const orq = new Orq({
|
|
688
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
689
|
+
});
|
|
690
|
+
|
|
691
|
+
async function run() {
|
|
692
|
+
const result = await orq.agents.list({
|
|
693
|
+
limit: 10,
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
console.log(result);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
run();
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
### Standalone function
|
|
703
|
+
|
|
704
|
+
The standalone function version of this method:
|
|
705
|
+
|
|
706
|
+
```typescript
|
|
707
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
708
|
+
import { agentsList } from "@orq-ai/node/funcs/agentsList.js";
|
|
709
|
+
|
|
710
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
711
|
+
// You can create one instance of it to use across an application.
|
|
712
|
+
const orq = new OrqCore({
|
|
713
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
async function run() {
|
|
717
|
+
const res = await agentsList(orq, {
|
|
718
|
+
limit: 10,
|
|
719
|
+
});
|
|
720
|
+
if (res.ok) {
|
|
721
|
+
const { value: result } = res;
|
|
722
|
+
console.log(result);
|
|
723
|
+
} else {
|
|
724
|
+
console.log("agentsList failed:", res.error);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
run();
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
### Parameters
|
|
732
|
+
|
|
733
|
+
| Parameter | Type | Required | Description |
|
|
734
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
735
|
+
| `request` | [operations.ListAgentsRequest](../../models/operations/listagentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
736
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
737
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
738
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
739
|
+
|
|
740
|
+
### Response
|
|
741
|
+
|
|
742
|
+
**Promise\<[operations.ListAgentsResponseBody](../../models/operations/listagentsresponsebody.md)\>**
|
|
743
|
+
|
|
744
|
+
### Errors
|
|
745
|
+
|
|
746
|
+
| Error Type | Status Code | Content Type |
|
|
747
|
+
| --------------- | --------------- | --------------- |
|
|
748
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
749
|
+
|
|
712
750
|
## run
|
|
713
751
|
|
|
714
752
|
Executes an agent with the provided configuration using A2A message format. If the agent already exists with the same configuration, it will be reused. If the configuration differs, a new version is created. The fallback model is configured at the agent level and will be used automatically if the primary model fails during execution.
|
|
@@ -862,7 +900,7 @@ run();
|
|
|
862
900
|
|
|
863
901
|
### Response
|
|
864
902
|
|
|
865
|
-
**Promise\<[operations.
|
|
903
|
+
**Promise\<[operations.RunAgentA2ATaskResponse](../../models/operations/runagenta2ataskresponse.md)\>**
|
|
866
904
|
|
|
867
905
|
### Errors
|
|
868
906
|
|
|
@@ -29,6 +29,7 @@ async function run() {
|
|
|
29
29
|
chunkSize: 256,
|
|
30
30
|
threshold: 0.8,
|
|
31
31
|
embeddingModel: "openai/text-embedding-3-small",
|
|
32
|
+
dimensions: 512,
|
|
32
33
|
mode: "window",
|
|
33
34
|
similarityWindow: 1,
|
|
34
35
|
});
|
|
@@ -61,6 +62,7 @@ async function run() {
|
|
|
61
62
|
chunkSize: 256,
|
|
62
63
|
threshold: 0.8,
|
|
63
64
|
embeddingModel: "openai/text-embedding-3-small",
|
|
65
|
+
dimensions: 512,
|
|
64
66
|
mode: "window",
|
|
65
67
|
similarityWindow: 1,
|
|
66
68
|
});
|
|
@@ -170,10 +170,9 @@ run();
|
|
|
170
170
|
|
|
171
171
|
### Errors
|
|
172
172
|
|
|
173
|
-
| Error Type
|
|
174
|
-
|
|
|
175
|
-
| errors.
|
|
176
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
173
|
+
| Error Type | Status Code | Content Type |
|
|
174
|
+
| --------------- | --------------- | --------------- |
|
|
175
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
177
176
|
|
|
178
177
|
## retrieve
|
|
179
178
|
|
package/packages/orq-rc/jsr.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orq-ai/node",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.63",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@orq-ai/node",
|
|
9
|
-
"version": "4.0.0-rc.
|
|
9
|
+
"version": "4.0.0-rc.63",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0",
|
|
12
12
|
"zod": "^3.25.0 || ^4.0.0"
|
|
@@ -91,7 +91,7 @@ async function $do(
|
|
|
91
91
|
? null
|
|
92
92
|
: encodeJSON("body", payload, { explode: true });
|
|
93
93
|
|
|
94
|
-
const path = pathToFunc("/v2/agents
|
|
94
|
+
const path = pathToFunc("/v2/agents")();
|
|
95
95
|
|
|
96
96
|
const headers = new Headers(compactMap({
|
|
97
97
|
"Content-Type": "application/json",
|
|
@@ -36,7 +36,7 @@ export function agentsInvoke(
|
|
|
36
36
|
options?: RequestOptions,
|
|
37
37
|
): APIPromise<
|
|
38
38
|
Result<
|
|
39
|
-
operations.
|
|
39
|
+
operations.InvokeAgentA2ATaskResponse,
|
|
40
40
|
| OrqError
|
|
41
41
|
| ResponseValidationError
|
|
42
42
|
| ConnectionError
|
|
@@ -61,7 +61,7 @@ async function $do(
|
|
|
61
61
|
): Promise<
|
|
62
62
|
[
|
|
63
63
|
Result<
|
|
64
|
-
operations.
|
|
64
|
+
operations.InvokeAgentA2ATaskResponse,
|
|
65
65
|
| OrqError
|
|
66
66
|
| ResponseValidationError
|
|
67
67
|
| ConnectionError
|
|
@@ -145,7 +145,7 @@ async function $do(
|
|
|
145
145
|
const response = doResult.value;
|
|
146
146
|
|
|
147
147
|
const [result] = await M.match<
|
|
148
|
-
operations.
|
|
148
|
+
operations.InvokeAgentA2ATaskResponse,
|
|
149
149
|
| OrqError
|
|
150
150
|
| ResponseValidationError
|
|
151
151
|
| ConnectionError
|
|
@@ -155,7 +155,7 @@ async function $do(
|
|
|
155
155
|
| UnexpectedClientError
|
|
156
156
|
| SDKValidationError
|
|
157
157
|
>(
|
|
158
|
-
M.json(200, operations.
|
|
158
|
+
M.json(200, operations.InvokeAgentA2ATaskResponse$inboundSchema),
|
|
159
159
|
M.fail("4XX"),
|
|
160
160
|
M.fail("5XX"),
|
|
161
161
|
)(response, req);
|
|
@@ -37,7 +37,7 @@ export function agentsListTasks(
|
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<
|
|
39
39
|
Result<
|
|
40
|
-
operations.
|
|
40
|
+
operations.ListAgentTasksAgentTasksListResponse,
|
|
41
41
|
| errors.ListAgentTasksResponseBody
|
|
42
42
|
| OrqError
|
|
43
43
|
| ResponseValidationError
|
|
@@ -63,7 +63,7 @@ async function $do(
|
|
|
63
63
|
): Promise<
|
|
64
64
|
[
|
|
65
65
|
Result<
|
|
66
|
-
operations.
|
|
66
|
+
operations.ListAgentTasksAgentTasksListResponse,
|
|
67
67
|
| errors.ListAgentTasksResponseBody
|
|
68
68
|
| OrqError
|
|
69
69
|
| ResponseValidationError
|
|
@@ -159,7 +159,7 @@ async function $do(
|
|
|
159
159
|
};
|
|
160
160
|
|
|
161
161
|
const [result] = await M.match<
|
|
162
|
-
operations.
|
|
162
|
+
operations.ListAgentTasksAgentTasksListResponse,
|
|
163
163
|
| errors.ListAgentTasksResponseBody
|
|
164
164
|
| OrqError
|
|
165
165
|
| ResponseValidationError
|
|
@@ -170,7 +170,7 @@ async function $do(
|
|
|
170
170
|
| UnexpectedClientError
|
|
171
171
|
| SDKValidationError
|
|
172
172
|
>(
|
|
173
|
-
M.json(200, operations.
|
|
173
|
+
M.json(200, operations.ListAgentTasksAgentTasksListResponse$inboundSchema),
|
|
174
174
|
M.jsonErr(404, errors.ListAgentTasksResponseBody$inboundSchema),
|
|
175
175
|
M.fail("4XX"),
|
|
176
176
|
M.fail("5XX"),
|
|
@@ -37,8 +37,8 @@ export function agentsRetrieveTask(
|
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<
|
|
39
39
|
Result<
|
|
40
|
-
operations.
|
|
41
|
-
| errors.
|
|
40
|
+
operations.GetAgentTaskExtendedTaskResponse,
|
|
41
|
+
| errors.HonoApiError
|
|
42
42
|
| OrqError
|
|
43
43
|
| ResponseValidationError
|
|
44
44
|
| ConnectionError
|
|
@@ -63,8 +63,8 @@ async function $do(
|
|
|
63
63
|
): Promise<
|
|
64
64
|
[
|
|
65
65
|
Result<
|
|
66
|
-
operations.
|
|
67
|
-
| errors.
|
|
66
|
+
operations.GetAgentTaskExtendedTaskResponse,
|
|
67
|
+
| errors.HonoApiError
|
|
68
68
|
| OrqError
|
|
69
69
|
| ResponseValidationError
|
|
70
70
|
| ConnectionError
|
|
@@ -155,8 +155,8 @@ async function $do(
|
|
|
155
155
|
};
|
|
156
156
|
|
|
157
157
|
const [result] = await M.match<
|
|
158
|
-
operations.
|
|
159
|
-
| errors.
|
|
158
|
+
operations.GetAgentTaskExtendedTaskResponse,
|
|
159
|
+
| errors.HonoApiError
|
|
160
160
|
| OrqError
|
|
161
161
|
| ResponseValidationError
|
|
162
162
|
| ConnectionError
|
|
@@ -166,8 +166,8 @@ async function $do(
|
|
|
166
166
|
| UnexpectedClientError
|
|
167
167
|
| SDKValidationError
|
|
168
168
|
>(
|
|
169
|
-
M.json(200, operations.
|
|
170
|
-
M.jsonErr(404, errors.
|
|
169
|
+
M.json(200, operations.GetAgentTaskExtendedTaskResponse$inboundSchema),
|
|
170
|
+
M.jsonErr(404, errors.HonoApiError$inboundSchema),
|
|
171
171
|
M.fail("4XX"),
|
|
172
172
|
M.fail("5XX"),
|
|
173
173
|
)(response, req, { extraFields: responseFields });
|