@orq-ai/node 4.0.4 → 4.0.5
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 +213 -213
- package/bin/mcp-server.js.map +36 -36
- 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 +12 -12
- 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 +12 -12
- 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 +12 -12
- package/models/operations/runagent.js +2 -2
- package/models/operations/streamrunagent.js +2 -2
- 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 +14 -14
- package/package.json +1 -1
- package/packages/orq-rc/README.md +38 -47
- package/packages/orq-rc/docs/sdks/agents/README.md +230 -529
- package/packages/orq-rc/docs/sdks/responses/README.md +60 -65
- 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 +16 -14
- package/packages/orq-rc/src/funcs/agentsDelete.ts +10 -6
- package/packages/orq-rc/src/funcs/agentsInvoke.ts +16 -6
- package/packages/orq-rc/src/funcs/agentsList.ts +18 -6
- package/packages/orq-rc/src/funcs/agentsResponsesCreate.ts +23 -12
- package/packages/orq-rc/src/funcs/agentsRetrieve.ts +21 -16
- package/packages/orq-rc/src/funcs/agentsRun.ts +4 -2
- package/packages/orq-rc/src/funcs/agentsStream.ts +16 -6
- package/packages/orq-rc/src/funcs/agentsStreamRun.ts +4 -2
- package/packages/orq-rc/src/funcs/agentsUpdate.ts +14 -6
- 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 +1 -9
- package/packages/orq-rc/src/mcp-server/tools/agentsCreate.ts +3 -3
- package/packages/orq-rc/src/mcp-server/tools/agentsDelete.ts +5 -5
- package/packages/orq-rc/src/mcp-server/tools/agentsInvoke.ts +7 -4
- package/packages/orq-rc/src/mcp-server/tools/agentsList.ts +9 -5
- package/packages/orq-rc/src/mcp-server/tools/agentsResponsesCreate.ts +8 -4
- package/packages/orq-rc/src/mcp-server/tools/agentsRetrieve.ts +5 -5
- package/packages/orq-rc/src/mcp-server/tools/agentsRun.ts +2 -2
- package/packages/orq-rc/src/mcp-server/tools/agentsStream.ts +7 -4
- package/packages/orq-rc/src/mcp-server/tools/agentsStreamRun.ts +2 -2
- package/packages/orq-rc/src/mcp-server/tools/agentsUpdate.ts +8 -4
- package/packages/orq-rc/src/models/errors/createagentrequest.ts +67 -0
- package/packages/orq-rc/src/models/errors/deleteagent.ts +2 -2
- package/packages/orq-rc/src/models/errors/index.ts +2 -3
- package/packages/orq-rc/src/models/errors/{listagenttasks.ts → retrieveagentrequest.ts} +15 -15
- package/packages/orq-rc/src/models/errors/updateagent.ts +2 -2
- package/packages/orq-rc/src/models/operations/{createagent.ts → createagentrequest.ts} +1643 -1485
- package/packages/orq-rc/src/models/operations/{createagentresponse.ts → createagentresponserequest.ts} +141 -127
- 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 +28 -28
- package/packages/orq-rc/src/models/operations/createprompt.ts +4 -4
- package/packages/orq-rc/src/models/operations/createtool.ts +12 -12
- 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/getalltools.ts +12 -12
- 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/index.ts +3 -7
- package/packages/orq-rc/src/models/operations/invokeagent.ts +153 -190
- package/packages/orq-rc/src/models/operations/listagents.ts +9 -21
- package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
- 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 +2 -2
- package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +3741 -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 +12 -12
- package/packages/orq-rc/src/models/operations/runagent.ts +53 -57
- package/packages/orq-rc/src/models/operations/streamagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +68 -82
- package/packages/orq-rc/src/models/operations/updateagent.ts +17 -17
- 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/updateprompt.ts +4 -4
- package/packages/orq-rc/src/models/operations/updatetool.ts +14 -14
- package/packages/orq-rc/src/sdk/agents.ts +51 -99
- package/packages/orq-rc/src/sdk/responses.ts +7 -5
- 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 +12 -12
- 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 +12 -12
- 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 +12 -12
- package/src/models/operations/runagent.ts +2 -2
- package/src/models/operations/streamrunagent.ts +2 -2
- 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 +14 -14
- package/packages/orq-rc/src/funcs/agentsListActions.ts +0 -169
- package/packages/orq-rc/src/funcs/agentsListTasks.ts +0 -183
- package/packages/orq-rc/src/funcs/agentsRetrieveAction.ts +0 -173
- package/packages/orq-rc/src/funcs/agentsRetrieveTask.ts +0 -179
- package/packages/orq-rc/src/mcp-server/tools/agentsListActions.ts +0 -35
- package/packages/orq-rc/src/mcp-server/tools/agentsListTasks.ts +0 -37
- package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveAction.ts +0 -35
- package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveTask.ts +0 -37
- package/packages/orq-rc/src/models/errors/createagent.ts +0 -67
- package/packages/orq-rc/src/models/errors/getagent.ts +0 -67
- package/packages/orq-rc/src/models/operations/getagent.ts +0 -3480
- package/packages/orq-rc/src/models/operations/getagenttask.ts +0 -2389
- package/packages/orq-rc/src/models/operations/listactions.ts +0 -427
- package/packages/orq-rc/src/models/operations/listagenttasks.ts +0 -2614
- package/packages/orq-rc/src/models/operations/retrieveaction.ts +0 -354
|
@@ -5,27 +5,23 @@
|
|
|
5
5
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
|
-
* [create](#create) - Create
|
|
9
|
-
* [delete](#delete) - Delete
|
|
10
|
-
* [retrieve](#retrieve) -
|
|
11
|
-
* [update](#update) - Update
|
|
12
|
-
* [invoke](#invoke) -
|
|
13
|
-
* [
|
|
14
|
-
* [
|
|
15
|
-
* [
|
|
16
|
-
* [
|
|
17
|
-
* [streamRun](#streamrun) - Run and stream agent execution
|
|
18
|
-
* [stream](#stream) - Stream agent execution events
|
|
19
|
-
* [listActions](#listactions) - List all actions
|
|
20
|
-
* [retrieveAction](#retrieveaction) - Retrieve an action executed by an agent task.
|
|
8
|
+
* [create](#create) - Create agent
|
|
9
|
+
* [delete](#delete) - Delete agent
|
|
10
|
+
* [retrieve](#retrieve) - Retrieve agent
|
|
11
|
+
* [update](#update) - Update agent
|
|
12
|
+
* [~~invoke~~](#invoke) - Execute an agent task :warning: **Deprecated**
|
|
13
|
+
* [list](#list) - List agents
|
|
14
|
+
* [~~run~~](#run) - Run an agent with configuration :warning: **Deprecated**
|
|
15
|
+
* [~~streamRun~~](#streamrun) - Run agent with streaming response :warning: **Deprecated**
|
|
16
|
+
* [~~stream~~](#stream) - Stream agent execution in real-time :warning: **Deprecated**
|
|
21
17
|
|
|
22
18
|
## create
|
|
23
19
|
|
|
24
|
-
Creates a new
|
|
20
|
+
Creates a new agent with the specified configuration, including model selection, instructions, tools, and knowledge bases. Agents are intelligent assistants that can execute tasks, interact with tools, and maintain context through memory stores. The agent can be configured with a primary model and optional fallback models for automatic failover, custom instructions for behavior control, and various settings to control execution limits and tool usage.
|
|
25
21
|
|
|
26
22
|
### Example Usage
|
|
27
23
|
|
|
28
|
-
<!-- UsageSnippet language="typescript" operationID="
|
|
24
|
+
<!-- UsageSnippet language="typescript" operationID="CreateAgentRequest" method="post" path="/v2/agents" -->
|
|
29
25
|
```typescript
|
|
30
26
|
import { Orq } from "@orq-ai/node";
|
|
31
27
|
|
|
@@ -37,10 +33,22 @@ async function run() {
|
|
|
37
33
|
const result = await orq.agents.create({
|
|
38
34
|
key: "<key>",
|
|
39
35
|
role: "<value>",
|
|
40
|
-
description: "
|
|
36
|
+
description: "alongside beneath doubtfully behest validity bah after furthermore",
|
|
41
37
|
instructions: "<value>",
|
|
42
38
|
path: "Default",
|
|
43
|
-
model:
|
|
39
|
+
model: {
|
|
40
|
+
id: "<id>",
|
|
41
|
+
retry: {
|
|
42
|
+
count: 3,
|
|
43
|
+
onCodes: [
|
|
44
|
+
429,
|
|
45
|
+
500,
|
|
46
|
+
502,
|
|
47
|
+
503,
|
|
48
|
+
504,
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
44
52
|
settings: {
|
|
45
53
|
tools: [
|
|
46
54
|
{
|
|
@@ -82,10 +90,22 @@ async function run() {
|
|
|
82
90
|
const res = await agentsCreate(orq, {
|
|
83
91
|
key: "<key>",
|
|
84
92
|
role: "<value>",
|
|
85
|
-
description: "
|
|
93
|
+
description: "alongside beneath doubtfully behest validity bah after furthermore",
|
|
86
94
|
instructions: "<value>",
|
|
87
95
|
path: "Default",
|
|
88
|
-
model:
|
|
96
|
+
model: {
|
|
97
|
+
id: "<id>",
|
|
98
|
+
retry: {
|
|
99
|
+
count: 3,
|
|
100
|
+
onCodes: [
|
|
101
|
+
429,
|
|
102
|
+
500,
|
|
103
|
+
502,
|
|
104
|
+
503,
|
|
105
|
+
504,
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
89
109
|
settings: {
|
|
90
110
|
tools: [
|
|
91
111
|
{
|
|
@@ -117,25 +137,25 @@ run();
|
|
|
117
137
|
|
|
118
138
|
| Parameter | Type | Required | Description |
|
|
119
139
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
120
|
-
| `request` | [operations.
|
|
140
|
+
| `request` | [operations.CreateAgentRequestRequestBody](../../models/operations/createagentrequestrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
121
141
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
122
142
|
| `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. |
|
|
123
143
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
124
144
|
|
|
125
145
|
### Response
|
|
126
146
|
|
|
127
|
-
**Promise\<[operations.
|
|
147
|
+
**Promise\<[operations.CreateAgentRequestResponseBody](../../models/operations/createagentrequestresponsebody.md)\>**
|
|
128
148
|
|
|
129
149
|
### Errors
|
|
130
150
|
|
|
131
|
-
| Error Type
|
|
132
|
-
|
|
|
133
|
-
| errors.
|
|
134
|
-
| errors.APIError
|
|
151
|
+
| Error Type | Status Code | Content Type |
|
|
152
|
+
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
|
153
|
+
| errors.CreateAgentRequestResponseBody | 409 | application/json |
|
|
154
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
135
155
|
|
|
136
156
|
## delete
|
|
137
157
|
|
|
138
|
-
Permanently
|
|
158
|
+
Permanently removes an agent from the workspace. This operation is irreversible and will delete all associated configuration including model assignments, tools, knowledge bases, memory stores, and cached data. Active agent sessions will be terminated, and the agent key will become available for reuse.
|
|
139
159
|
|
|
140
160
|
### Example Usage
|
|
141
161
|
|
|
@@ -148,9 +168,7 @@ const orq = new Orq({
|
|
|
148
168
|
});
|
|
149
169
|
|
|
150
170
|
async function run() {
|
|
151
|
-
await orq.agents.delete(
|
|
152
|
-
agentKey: "<value>",
|
|
153
|
-
});
|
|
171
|
+
await orq.agents.delete("<value>");
|
|
154
172
|
|
|
155
173
|
|
|
156
174
|
}
|
|
@@ -173,9 +191,7 @@ const orq = new OrqCore({
|
|
|
173
191
|
});
|
|
174
192
|
|
|
175
193
|
async function run() {
|
|
176
|
-
const res = await agentsDelete(orq,
|
|
177
|
-
agentKey: "<value>",
|
|
178
|
-
});
|
|
194
|
+
const res = await agentsDelete(orq, "<value>");
|
|
179
195
|
if (res.ok) {
|
|
180
196
|
const { value: result } = res;
|
|
181
197
|
|
|
@@ -191,7 +207,7 @@ run();
|
|
|
191
207
|
|
|
192
208
|
| Parameter | Type | Required | Description |
|
|
193
209
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
194
|
-
| `
|
|
210
|
+
| `agentKey` | *string* | :heavy_check_mark: | The unique key of the agent to delete |
|
|
195
211
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
196
212
|
| `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. |
|
|
197
213
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
@@ -209,11 +225,11 @@ run();
|
|
|
209
225
|
|
|
210
226
|
## retrieve
|
|
211
227
|
|
|
212
|
-
Retrieves a
|
|
228
|
+
Retrieves detailed information about a specific agent identified by its unique key or identifier. Returns the complete agent manifest including configuration settings, model assignments (primary and fallback), tools, knowledge bases, memory stores, instructions, and execution parameters. Use this endpoint to fetch the current state and configuration of an individual agent.
|
|
213
229
|
|
|
214
230
|
### Example Usage
|
|
215
231
|
|
|
216
|
-
<!-- UsageSnippet language="typescript" operationID="
|
|
232
|
+
<!-- UsageSnippet language="typescript" operationID="RetrieveAgentRequest" method="get" path="/v2/agents/{agent_key}" -->
|
|
217
233
|
```typescript
|
|
218
234
|
import { Orq } from "@orq-ai/node";
|
|
219
235
|
|
|
@@ -222,9 +238,7 @@ const orq = new Orq({
|
|
|
222
238
|
});
|
|
223
239
|
|
|
224
240
|
async function run() {
|
|
225
|
-
const result = await orq.agents.retrieve(
|
|
226
|
-
agentKey: "<value>",
|
|
227
|
-
});
|
|
241
|
+
const result = await orq.agents.retrieve("<value>");
|
|
228
242
|
|
|
229
243
|
console.log(result);
|
|
230
244
|
}
|
|
@@ -247,9 +261,7 @@ const orq = new OrqCore({
|
|
|
247
261
|
});
|
|
248
262
|
|
|
249
263
|
async function run() {
|
|
250
|
-
const res = await agentsRetrieve(orq,
|
|
251
|
-
agentKey: "<value>",
|
|
252
|
-
});
|
|
264
|
+
const res = await agentsRetrieve(orq, "<value>");
|
|
253
265
|
if (res.ok) {
|
|
254
266
|
const { value: result } = res;
|
|
255
267
|
console.log(result);
|
|
@@ -265,25 +277,25 @@ run();
|
|
|
265
277
|
|
|
266
278
|
| Parameter | Type | Required | Description |
|
|
267
279
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
268
|
-
| `
|
|
280
|
+
| `agentKey` | *string* | :heavy_check_mark: | The unique key of the agent to retrieve |
|
|
269
281
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
270
282
|
| `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. |
|
|
271
283
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
272
284
|
|
|
273
285
|
### Response
|
|
274
286
|
|
|
275
|
-
**Promise\<[operations.
|
|
287
|
+
**Promise\<[operations.RetrieveAgentRequestResponseBody](../../models/operations/retrieveagentrequestresponsebody.md)\>**
|
|
276
288
|
|
|
277
289
|
### Errors
|
|
278
290
|
|
|
279
|
-
| Error Type
|
|
280
|
-
|
|
|
281
|
-
| errors.
|
|
282
|
-
| errors.APIError
|
|
291
|
+
| Error Type | Status Code | Content Type |
|
|
292
|
+
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
|
|
293
|
+
| errors.RetrieveAgentRequestResponseBody | 404 | application/json |
|
|
294
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
283
295
|
|
|
284
296
|
## update
|
|
285
297
|
|
|
286
|
-
|
|
298
|
+
Modifies an existing agent's configuration with partial updates. Supports updating any aspect of the agent including model assignments (primary and fallback), instructions, tools, knowledge bases, memory stores, and execution parameters. Only the fields provided in the request body will be updated; all other fields remain unchanged. Changes take effect immediately for new agent invocations.
|
|
287
299
|
|
|
288
300
|
### Example Usage
|
|
289
301
|
|
|
@@ -296,27 +308,24 @@ const orq = new Orq({
|
|
|
296
308
|
});
|
|
297
309
|
|
|
298
310
|
async function run() {
|
|
299
|
-
const result = await orq.agents.update({
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
settings: {
|
|
304
|
-
tools: [
|
|
305
|
-
{
|
|
306
|
-
type: "mcp",
|
|
307
|
-
id: "01KA84ND5J0SWQMA2Q8HY5WZZZ",
|
|
308
|
-
toolId: "01KXYZ123456789",
|
|
309
|
-
requiresApproval: false,
|
|
310
|
-
},
|
|
311
|
-
],
|
|
312
|
-
},
|
|
313
|
-
path: "Default",
|
|
314
|
-
knowledgeBases: [
|
|
311
|
+
const result = await orq.agents.update("<value>", {
|
|
312
|
+
model: "El Camino",
|
|
313
|
+
settings: {
|
|
314
|
+
tools: [
|
|
315
315
|
{
|
|
316
|
-
|
|
316
|
+
type: "mcp",
|
|
317
|
+
id: "01KA84ND5J0SWQMA2Q8HY5WZZZ",
|
|
318
|
+
toolId: "01KXYZ123456789",
|
|
319
|
+
requiresApproval: false,
|
|
317
320
|
},
|
|
318
321
|
],
|
|
319
322
|
},
|
|
323
|
+
path: "Default",
|
|
324
|
+
knowledgeBases: [
|
|
325
|
+
{
|
|
326
|
+
knowledgeId: "customer-knowledge-base",
|
|
327
|
+
},
|
|
328
|
+
],
|
|
320
329
|
});
|
|
321
330
|
|
|
322
331
|
console.log(result);
|
|
@@ -340,27 +349,24 @@ const orq = new OrqCore({
|
|
|
340
349
|
});
|
|
341
350
|
|
|
342
351
|
async function run() {
|
|
343
|
-
const res = await agentsUpdate(orq, {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
settings: {
|
|
348
|
-
tools: [
|
|
349
|
-
{
|
|
350
|
-
type: "mcp",
|
|
351
|
-
id: "01KA84ND5J0SWQMA2Q8HY5WZZZ",
|
|
352
|
-
toolId: "01KXYZ123456789",
|
|
353
|
-
requiresApproval: false,
|
|
354
|
-
},
|
|
355
|
-
],
|
|
356
|
-
},
|
|
357
|
-
path: "Default",
|
|
358
|
-
knowledgeBases: [
|
|
352
|
+
const res = await agentsUpdate(orq, "<value>", {
|
|
353
|
+
model: "El Camino",
|
|
354
|
+
settings: {
|
|
355
|
+
tools: [
|
|
359
356
|
{
|
|
360
|
-
|
|
357
|
+
type: "mcp",
|
|
358
|
+
id: "01KA84ND5J0SWQMA2Q8HY5WZZZ",
|
|
359
|
+
toolId: "01KXYZ123456789",
|
|
360
|
+
requiresApproval: false,
|
|
361
361
|
},
|
|
362
362
|
],
|
|
363
363
|
},
|
|
364
|
+
path: "Default",
|
|
365
|
+
knowledgeBases: [
|
|
366
|
+
{
|
|
367
|
+
knowledgeId: "customer-knowledge-base",
|
|
368
|
+
},
|
|
369
|
+
],
|
|
364
370
|
});
|
|
365
371
|
if (res.ok) {
|
|
366
372
|
const { value: result } = res;
|
|
@@ -377,7 +383,8 @@ run();
|
|
|
377
383
|
|
|
378
384
|
| Parameter | Type | Required | Description |
|
|
379
385
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
380
|
-
| `
|
|
386
|
+
| `agentKey` | *string* | :heavy_check_mark: | The unique key of the agent to update |
|
|
387
|
+
| `requestBody` | [operations.UpdateAgentUpdateAgentRequest](../../models/operations/updateagentupdateagentrequest.md) | :heavy_minus_sign: | N/A |
|
|
381
388
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
382
389
|
| `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. |
|
|
383
390
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
@@ -393,9 +400,11 @@ run();
|
|
|
393
400
|
| errors.UpdateAgentResponseBody | 404 | application/json |
|
|
394
401
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
395
402
|
|
|
396
|
-
## invoke
|
|
403
|
+
## ~~invoke~~
|
|
397
404
|
|
|
398
|
-
|
|
405
|
+
Invokes an agent to perform a task with the provided input message. The agent will process the request using its configured model and tools, maintaining context through memory stores if configured. Supports automatic model fallback on primary model failure, tool execution, knowledge base retrieval, and continuation of previous conversations. Returns a task response that can be used to track execution status and retrieve results.
|
|
406
|
+
|
|
407
|
+
> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
399
408
|
|
|
400
409
|
### Example Usage
|
|
401
410
|
|
|
@@ -408,36 +417,33 @@ const orq = new Orq({
|
|
|
408
417
|
});
|
|
409
418
|
|
|
410
419
|
async function run() {
|
|
411
|
-
const result = await orq.agents.invoke({
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
"priority-high",
|
|
439
|
-
],
|
|
440
|
-
},
|
|
420
|
+
const result = await orq.agents.invoke("<key>", {
|
|
421
|
+
message: {
|
|
422
|
+
role: "user",
|
|
423
|
+
parts: [],
|
|
424
|
+
},
|
|
425
|
+
contact: {
|
|
426
|
+
id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
|
|
427
|
+
displayName: "Jane Doe",
|
|
428
|
+
email: "jane.doe@example.com",
|
|
429
|
+
metadata: [
|
|
430
|
+
{
|
|
431
|
+
"department": "Engineering",
|
|
432
|
+
"role": "Senior Developer",
|
|
433
|
+
},
|
|
434
|
+
],
|
|
435
|
+
logoUrl: "https://example.com/avatars/jane-doe.jpg",
|
|
436
|
+
tags: [
|
|
437
|
+
"hr",
|
|
438
|
+
"engineering",
|
|
439
|
+
],
|
|
440
|
+
},
|
|
441
|
+
thread: {
|
|
442
|
+
id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
|
|
443
|
+
tags: [
|
|
444
|
+
"customer-support",
|
|
445
|
+
"priority-high",
|
|
446
|
+
],
|
|
441
447
|
},
|
|
442
448
|
});
|
|
443
449
|
|
|
@@ -462,36 +468,33 @@ const orq = new OrqCore({
|
|
|
462
468
|
});
|
|
463
469
|
|
|
464
470
|
async function run() {
|
|
465
|
-
const res = await agentsInvoke(orq, {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
"priority-high",
|
|
493
|
-
],
|
|
494
|
-
},
|
|
471
|
+
const res = await agentsInvoke(orq, "<key>", {
|
|
472
|
+
message: {
|
|
473
|
+
role: "user",
|
|
474
|
+
parts: [],
|
|
475
|
+
},
|
|
476
|
+
contact: {
|
|
477
|
+
id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
|
|
478
|
+
displayName: "Jane Doe",
|
|
479
|
+
email: "jane.doe@example.com",
|
|
480
|
+
metadata: [
|
|
481
|
+
{
|
|
482
|
+
"department": "Engineering",
|
|
483
|
+
"role": "Senior Developer",
|
|
484
|
+
},
|
|
485
|
+
],
|
|
486
|
+
logoUrl: "https://example.com/avatars/jane-doe.jpg",
|
|
487
|
+
tags: [
|
|
488
|
+
"hr",
|
|
489
|
+
"engineering",
|
|
490
|
+
],
|
|
491
|
+
},
|
|
492
|
+
thread: {
|
|
493
|
+
id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
|
|
494
|
+
tags: [
|
|
495
|
+
"customer-support",
|
|
496
|
+
"priority-high",
|
|
497
|
+
],
|
|
495
498
|
},
|
|
496
499
|
});
|
|
497
500
|
if (res.ok) {
|
|
@@ -509,7 +512,8 @@ run();
|
|
|
509
512
|
|
|
510
513
|
| Parameter | Type | Required | Description |
|
|
511
514
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
512
|
-
| `
|
|
515
|
+
| `key` | *string* | :heavy_check_mark: | The key or ID of the agent to invoke |
|
|
516
|
+
| `requestBody` | [operations.InvokeAgentRequestBody](../../models/operations/invokeagentrequestbody.md) | :heavy_minus_sign: | N/A |
|
|
513
517
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
514
518
|
| `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. |
|
|
515
519
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
@@ -524,159 +528,9 @@ run();
|
|
|
524
528
|
| --------------- | --------------- | --------------- |
|
|
525
529
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
526
530
|
|
|
527
|
-
## listTasks
|
|
528
|
-
|
|
529
|
-
Retrieves a paginated list of all tasks associated with a specific agent, optionally filtered by status.
|
|
530
|
-
|
|
531
|
-
### Example Usage
|
|
532
|
-
|
|
533
|
-
<!-- UsageSnippet language="typescript" operationID="ListAgentTasks" method="get" path="/v2/agents/{agent_key}/tasks" -->
|
|
534
|
-
```typescript
|
|
535
|
-
import { Orq } from "@orq-ai/node";
|
|
536
|
-
|
|
537
|
-
const orq = new Orq({
|
|
538
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
539
|
-
});
|
|
540
|
-
|
|
541
|
-
async function run() {
|
|
542
|
-
const result = await orq.agents.listTasks({
|
|
543
|
-
agentKey: "<value>",
|
|
544
|
-
});
|
|
545
|
-
|
|
546
|
-
console.log(result);
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
run();
|
|
550
|
-
```
|
|
551
|
-
|
|
552
|
-
### Standalone function
|
|
553
|
-
|
|
554
|
-
The standalone function version of this method:
|
|
555
|
-
|
|
556
|
-
```typescript
|
|
557
|
-
import { OrqCore } from "@orq-ai/node/core.js";
|
|
558
|
-
import { agentsListTasks } from "@orq-ai/node/funcs/agentsListTasks.js";
|
|
559
|
-
|
|
560
|
-
// Use `OrqCore` for best tree-shaking performance.
|
|
561
|
-
// You can create one instance of it to use across an application.
|
|
562
|
-
const orq = new OrqCore({
|
|
563
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
564
|
-
});
|
|
565
|
-
|
|
566
|
-
async function run() {
|
|
567
|
-
const res = await agentsListTasks(orq, {
|
|
568
|
-
agentKey: "<value>",
|
|
569
|
-
});
|
|
570
|
-
if (res.ok) {
|
|
571
|
-
const { value: result } = res;
|
|
572
|
-
console.log(result);
|
|
573
|
-
} else {
|
|
574
|
-
console.log("agentsListTasks failed:", res.error);
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
run();
|
|
579
|
-
```
|
|
580
|
-
|
|
581
|
-
### Parameters
|
|
582
|
-
|
|
583
|
-
| Parameter | Type | Required | Description |
|
|
584
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
585
|
-
| `request` | [operations.ListAgentTasksRequest](../../models/operations/listagenttasksrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
586
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
587
|
-
| `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. |
|
|
588
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
589
|
-
|
|
590
|
-
### Response
|
|
591
|
-
|
|
592
|
-
**Promise\<[operations.ListAgentTasksAgentTasksListResponse](../../models/operations/listagenttasksagenttaskslistresponse.md)\>**
|
|
593
|
-
|
|
594
|
-
### Errors
|
|
595
|
-
|
|
596
|
-
| Error Type | Status Code | Content Type |
|
|
597
|
-
| --------------------------------- | --------------------------------- | --------------------------------- |
|
|
598
|
-
| errors.ListAgentTasksResponseBody | 404 | application/json |
|
|
599
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
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
531
|
## list
|
|
678
532
|
|
|
679
|
-
Retrieves a list of
|
|
533
|
+
Retrieves a comprehensive list of agents configured in your workspace. Supports pagination for large datasets and returns agents sorted by creation date (newest first). Each agent in the response includes its complete configuration: model settings with fallback options, instructions, tools, knowledge bases, memory stores, and execution parameters. Use pagination parameters to efficiently navigate through large collections of agents.
|
|
680
534
|
|
|
681
535
|
### Example Usage
|
|
682
536
|
|
|
@@ -689,9 +543,7 @@ const orq = new Orq({
|
|
|
689
543
|
});
|
|
690
544
|
|
|
691
545
|
async function run() {
|
|
692
|
-
const result = await orq.agents.list(
|
|
693
|
-
limit: 10,
|
|
694
|
-
});
|
|
546
|
+
const result = await orq.agents.list(10);
|
|
695
547
|
|
|
696
548
|
console.log(result);
|
|
697
549
|
}
|
|
@@ -714,9 +566,7 @@ const orq = new OrqCore({
|
|
|
714
566
|
});
|
|
715
567
|
|
|
716
568
|
async function run() {
|
|
717
|
-
const res = await agentsList(orq,
|
|
718
|
-
limit: 10,
|
|
719
|
-
});
|
|
569
|
+
const res = await agentsList(orq, 10);
|
|
720
570
|
if (res.ok) {
|
|
721
571
|
const { value: result } = res;
|
|
722
572
|
console.log(result);
|
|
@@ -730,12 +580,14 @@ run();
|
|
|
730
580
|
|
|
731
581
|
### Parameters
|
|
732
582
|
|
|
733
|
-
| Parameter
|
|
734
|
-
|
|
|
735
|
-
| `
|
|
736
|
-
| `
|
|
737
|
-
| `
|
|
738
|
-
| `options
|
|
583
|
+
| Parameter | Type | Required | Description |
|
|
584
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
585
|
+
| `limit` | *number* | :heavy_minus_sign: | A limit on the number of objects to be returned. Limit can range between 1 and 200. When not provided, returns all agents without pagination. |
|
|
586
|
+
| `startingAfter` | *string* | :heavy_minus_sign: | A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `after=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the next page of the list. |
|
|
587
|
+
| `endingBefore` | *string* | :heavy_minus_sign: | A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `before=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the previous page of the list. |
|
|
588
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
589
|
+
| `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. |
|
|
590
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
739
591
|
|
|
740
592
|
### Response
|
|
741
593
|
|
|
@@ -747,9 +599,11 @@ run();
|
|
|
747
599
|
| --------------- | --------------- | --------------- |
|
|
748
600
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
749
601
|
|
|
750
|
-
## run
|
|
602
|
+
## ~~run~~
|
|
603
|
+
|
|
604
|
+
Executes an agent using inline configuration or references an existing agent. Supports dynamic agent creation where the system automatically manages agent versioning - reusing existing agents with matching configurations or creating new versions when configurations differ. Ideal for programmatic agent execution with flexible configuration management. The agent processes messages in A2A format with support for memory context, tool execution, and automatic model fallback on failure.
|
|
751
605
|
|
|
752
|
-
|
|
606
|
+
> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
753
607
|
|
|
754
608
|
### Example Usage
|
|
755
609
|
|
|
@@ -908,9 +762,11 @@ run();
|
|
|
908
762
|
| --------------- | --------------- | --------------- |
|
|
909
763
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
910
764
|
|
|
911
|
-
## streamRun
|
|
765
|
+
## ~~streamRun~~
|
|
766
|
+
|
|
767
|
+
Dynamically configures and executes an agent while streaming the interaction in real-time via Server-Sent Events (SSE). Intelligently manages agent versioning by reusing existing agents with matching configurations or creating new versions when configurations differ. Combines the flexibility of inline configuration with real-time streaming, making it ideal for dynamic agent interactions with live feedback. The stream provides continuous updates including message chunks, tool executions, and status changes until completion or timeout.
|
|
912
768
|
|
|
913
|
-
|
|
769
|
+
> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
914
770
|
|
|
915
771
|
### Example Usage
|
|
916
772
|
|
|
@@ -1074,9 +930,11 @@ run();
|
|
|
1074
930
|
| errors.StreamRunAgentResponseBody | 404 | application/json |
|
|
1075
931
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
1076
932
|
|
|
1077
|
-
## stream
|
|
933
|
+
## ~~stream~~
|
|
1078
934
|
|
|
1079
|
-
Executes an agent and streams
|
|
935
|
+
Executes an agent and streams the interaction in real-time using Server-Sent Events (SSE). Provides live updates as the agent processes the request, including message chunks, tool calls, and execution status. Perfect for building responsive chat interfaces and monitoring agent progress. The stream continues until the agent completes its task, encounters an error, or reaches the configured timeout (default 30 minutes, configurable 1-3600 seconds).
|
|
936
|
+
|
|
937
|
+
> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
1080
938
|
|
|
1081
939
|
### Example Usage
|
|
1082
940
|
|
|
@@ -1089,36 +947,33 @@ const orq = new Orq({
|
|
|
1089
947
|
});
|
|
1090
948
|
|
|
1091
949
|
async function run() {
|
|
1092
|
-
const result = await orq.agents.stream({
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
"priority-high",
|
|
1120
|
-
],
|
|
1121
|
-
},
|
|
950
|
+
const result = await orq.agents.stream("<key>", {
|
|
951
|
+
message: {
|
|
952
|
+
role: "user",
|
|
953
|
+
parts: [],
|
|
954
|
+
},
|
|
955
|
+
contact: {
|
|
956
|
+
id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
|
|
957
|
+
displayName: "Jane Doe",
|
|
958
|
+
email: "jane.doe@example.com",
|
|
959
|
+
metadata: [
|
|
960
|
+
{
|
|
961
|
+
"department": "Engineering",
|
|
962
|
+
"role": "Senior Developer",
|
|
963
|
+
},
|
|
964
|
+
],
|
|
965
|
+
logoUrl: "https://example.com/avatars/jane-doe.jpg",
|
|
966
|
+
tags: [
|
|
967
|
+
"hr",
|
|
968
|
+
"engineering",
|
|
969
|
+
],
|
|
970
|
+
},
|
|
971
|
+
thread: {
|
|
972
|
+
id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
|
|
973
|
+
tags: [
|
|
974
|
+
"customer-support",
|
|
975
|
+
"priority-high",
|
|
976
|
+
],
|
|
1122
977
|
},
|
|
1123
978
|
});
|
|
1124
979
|
|
|
@@ -1145,36 +1000,33 @@ const orq = new OrqCore({
|
|
|
1145
1000
|
});
|
|
1146
1001
|
|
|
1147
1002
|
async function run() {
|
|
1148
|
-
const res = await agentsStream(orq, {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
"priority-high",
|
|
1176
|
-
],
|
|
1177
|
-
},
|
|
1003
|
+
const res = await agentsStream(orq, "<key>", {
|
|
1004
|
+
message: {
|
|
1005
|
+
role: "user",
|
|
1006
|
+
parts: [],
|
|
1007
|
+
},
|
|
1008
|
+
contact: {
|
|
1009
|
+
id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
|
|
1010
|
+
displayName: "Jane Doe",
|
|
1011
|
+
email: "jane.doe@example.com",
|
|
1012
|
+
metadata: [
|
|
1013
|
+
{
|
|
1014
|
+
"department": "Engineering",
|
|
1015
|
+
"role": "Senior Developer",
|
|
1016
|
+
},
|
|
1017
|
+
],
|
|
1018
|
+
logoUrl: "https://example.com/avatars/jane-doe.jpg",
|
|
1019
|
+
tags: [
|
|
1020
|
+
"hr",
|
|
1021
|
+
"engineering",
|
|
1022
|
+
],
|
|
1023
|
+
},
|
|
1024
|
+
thread: {
|
|
1025
|
+
id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
|
|
1026
|
+
tags: [
|
|
1027
|
+
"customer-support",
|
|
1028
|
+
"priority-high",
|
|
1029
|
+
],
|
|
1178
1030
|
},
|
|
1179
1031
|
});
|
|
1180
1032
|
if (res.ok) {
|
|
@@ -1194,7 +1046,8 @@ run();
|
|
|
1194
1046
|
|
|
1195
1047
|
| Parameter | Type | Required | Description |
|
|
1196
1048
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1197
|
-
| `
|
|
1049
|
+
| `key` | *string* | :heavy_check_mark: | The key or ID of the agent to invoke |
|
|
1050
|
+
| `requestBody` | [operations.StreamAgentRequestBody](../../models/operations/streamagentrequestbody.md) | :heavy_minus_sign: | N/A |
|
|
1198
1051
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
1199
1052
|
| `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. |
|
|
1200
1053
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
@@ -1208,156 +1061,4 @@ run();
|
|
|
1208
1061
|
| Error Type | Status Code | Content Type |
|
|
1209
1062
|
| ------------------------------ | ------------------------------ | ------------------------------ |
|
|
1210
1063
|
| errors.StreamAgentResponseBody | 404 | application/json |
|
|
1211
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
1212
|
-
|
|
1213
|
-
## listActions
|
|
1214
|
-
|
|
1215
|
-
List all actions
|
|
1216
|
-
|
|
1217
|
-
### Example Usage
|
|
1218
|
-
|
|
1219
|
-
<!-- UsageSnippet language="typescript" operationID="ListActions" method="get" path="/v2/agents/{agent_key}/tasks/{task_id}/actions" -->
|
|
1220
|
-
```typescript
|
|
1221
|
-
import { Orq } from "@orq-ai/node";
|
|
1222
|
-
|
|
1223
|
-
const orq = new Orq({
|
|
1224
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
1225
|
-
});
|
|
1226
|
-
|
|
1227
|
-
async function run() {
|
|
1228
|
-
const result = await orq.agents.listActions({
|
|
1229
|
-
agentKey: "<value>",
|
|
1230
|
-
taskId: "<id>",
|
|
1231
|
-
});
|
|
1232
|
-
|
|
1233
|
-
console.log(result);
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
run();
|
|
1237
|
-
```
|
|
1238
|
-
|
|
1239
|
-
### Standalone function
|
|
1240
|
-
|
|
1241
|
-
The standalone function version of this method:
|
|
1242
|
-
|
|
1243
|
-
```typescript
|
|
1244
|
-
import { OrqCore } from "@orq-ai/node/core.js";
|
|
1245
|
-
import { agentsListActions } from "@orq-ai/node/funcs/agentsListActions.js";
|
|
1246
|
-
|
|
1247
|
-
// Use `OrqCore` for best tree-shaking performance.
|
|
1248
|
-
// You can create one instance of it to use across an application.
|
|
1249
|
-
const orq = new OrqCore({
|
|
1250
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
1251
|
-
});
|
|
1252
|
-
|
|
1253
|
-
async function run() {
|
|
1254
|
-
const res = await agentsListActions(orq, {
|
|
1255
|
-
agentKey: "<value>",
|
|
1256
|
-
taskId: "<id>",
|
|
1257
|
-
});
|
|
1258
|
-
if (res.ok) {
|
|
1259
|
-
const { value: result } = res;
|
|
1260
|
-
console.log(result);
|
|
1261
|
-
} else {
|
|
1262
|
-
console.log("agentsListActions failed:", res.error);
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
run();
|
|
1267
|
-
```
|
|
1268
|
-
|
|
1269
|
-
### Parameters
|
|
1270
|
-
|
|
1271
|
-
| Parameter | Type | Required | Description |
|
|
1272
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1273
|
-
| `request` | [operations.ListActionsRequest](../../models/operations/listactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
1274
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
1275
|
-
| `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. |
|
|
1276
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
1277
|
-
|
|
1278
|
-
### Response
|
|
1279
|
-
|
|
1280
|
-
**Promise\<[operations.ListActionsResponseBody](../../models/operations/listactionsresponsebody.md)\>**
|
|
1281
|
-
|
|
1282
|
-
### Errors
|
|
1283
|
-
|
|
1284
|
-
| Error Type | Status Code | Content Type |
|
|
1285
|
-
| --------------- | --------------- | --------------- |
|
|
1286
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
1287
|
-
|
|
1288
|
-
## retrieveAction
|
|
1289
|
-
|
|
1290
|
-
Retrieve an action executed by an agent task.
|
|
1291
|
-
|
|
1292
|
-
### Example Usage
|
|
1293
|
-
|
|
1294
|
-
<!-- UsageSnippet language="typescript" operationID="RetrieveAction" method="get" path="/v2/agents/{agent_key}/tasks/{task_id}/actions/{action_id}" -->
|
|
1295
|
-
```typescript
|
|
1296
|
-
import { Orq } from "@orq-ai/node";
|
|
1297
|
-
|
|
1298
|
-
const orq = new Orq({
|
|
1299
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
1300
|
-
});
|
|
1301
|
-
|
|
1302
|
-
async function run() {
|
|
1303
|
-
const result = await orq.agents.retrieveAction({
|
|
1304
|
-
agentKey: "<value>",
|
|
1305
|
-
taskId: "<id>",
|
|
1306
|
-
actionId: "<id>",
|
|
1307
|
-
});
|
|
1308
|
-
|
|
1309
|
-
console.log(result);
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
run();
|
|
1313
|
-
```
|
|
1314
|
-
|
|
1315
|
-
### Standalone function
|
|
1316
|
-
|
|
1317
|
-
The standalone function version of this method:
|
|
1318
|
-
|
|
1319
|
-
```typescript
|
|
1320
|
-
import { OrqCore } from "@orq-ai/node/core.js";
|
|
1321
|
-
import { agentsRetrieveAction } from "@orq-ai/node/funcs/agentsRetrieveAction.js";
|
|
1322
|
-
|
|
1323
|
-
// Use `OrqCore` for best tree-shaking performance.
|
|
1324
|
-
// You can create one instance of it to use across an application.
|
|
1325
|
-
const orq = new OrqCore({
|
|
1326
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
1327
|
-
});
|
|
1328
|
-
|
|
1329
|
-
async function run() {
|
|
1330
|
-
const res = await agentsRetrieveAction(orq, {
|
|
1331
|
-
agentKey: "<value>",
|
|
1332
|
-
taskId: "<id>",
|
|
1333
|
-
actionId: "<id>",
|
|
1334
|
-
});
|
|
1335
|
-
if (res.ok) {
|
|
1336
|
-
const { value: result } = res;
|
|
1337
|
-
console.log(result);
|
|
1338
|
-
} else {
|
|
1339
|
-
console.log("agentsRetrieveAction failed:", res.error);
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
run();
|
|
1344
|
-
```
|
|
1345
|
-
|
|
1346
|
-
### Parameters
|
|
1347
|
-
|
|
1348
|
-
| Parameter | Type | Required | Description |
|
|
1349
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1350
|
-
| `request` | [operations.RetrieveActionRequest](../../models/operations/retrieveactionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
1351
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
1352
|
-
| `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. |
|
|
1353
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
1354
|
-
|
|
1355
|
-
### Response
|
|
1356
|
-
|
|
1357
|
-
**Promise\<[operations.RetrieveActionResponseBody](../../models/operations/retrieveactionresponsebody.md)\>**
|
|
1358
|
-
|
|
1359
|
-
### Errors
|
|
1360
|
-
|
|
1361
|
-
| Error Type | Status Code | Content Type |
|
|
1362
|
-
| --------------- | --------------- | --------------- |
|
|
1363
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
1064
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|