@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.
Files changed (170) hide show
  1. package/bin/mcp-server.js +213 -213
  2. package/bin/mcp-server.js.map +36 -36
  3. package/examples/package-lock.json +1 -1
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +2 -2
  6. package/lib/config.js +2 -2
  7. package/mcp-server/mcp-server.js +1 -1
  8. package/mcp-server/server.js +1 -1
  9. package/models/operations/createbudget.js +2 -2
  10. package/models/operations/createcontact.js +2 -2
  11. package/models/operations/createdataset.js +2 -2
  12. package/models/operations/createdatasetitem.js +8 -8
  13. package/models/operations/createdatasource.js +2 -2
  14. package/models/operations/createeval.js +28 -28
  15. package/models/operations/createtool.js +12 -12
  16. package/models/operations/fileget.js +2 -2
  17. package/models/operations/filelist.js +2 -2
  18. package/models/operations/fileupload.js +2 -2
  19. package/models/operations/getalltools.js +12 -12
  20. package/models/operations/getbudget.js +2 -2
  21. package/models/operations/getevals.js +28 -28
  22. package/models/operations/listbudgets.js +2 -2
  23. package/models/operations/listcontacts.js +2 -2
  24. package/models/operations/listdatasetdatapoints.js +8 -8
  25. package/models/operations/listdatasets.js +2 -2
  26. package/models/operations/listdatasources.js +2 -2
  27. package/models/operations/retrievecontact.js +2 -2
  28. package/models/operations/retrievedatapoint.js +8 -8
  29. package/models/operations/retrievedataset.js +2 -2
  30. package/models/operations/retrievedatasource.js +2 -2
  31. package/models/operations/retrievetool.js +12 -12
  32. package/models/operations/runagent.js +2 -2
  33. package/models/operations/streamrunagent.js +2 -2
  34. package/models/operations/updatebudget.js +2 -2
  35. package/models/operations/updatecontact.js +2 -2
  36. package/models/operations/updatedatapoint.js +8 -8
  37. package/models/operations/updatedataset.js +2 -2
  38. package/models/operations/updatedatasource.js +2 -2
  39. package/models/operations/updateeval.js +28 -28
  40. package/models/operations/updatetool.js +14 -14
  41. package/package.json +1 -1
  42. package/packages/orq-rc/README.md +38 -47
  43. package/packages/orq-rc/docs/sdks/agents/README.md +230 -529
  44. package/packages/orq-rc/docs/sdks/responses/README.md +60 -65
  45. package/packages/orq-rc/examples/package-lock.json +1 -1
  46. package/packages/orq-rc/jsr.json +1 -1
  47. package/packages/orq-rc/package-lock.json +2 -2
  48. package/packages/orq-rc/package.json +1 -1
  49. package/packages/orq-rc/src/funcs/agentsCreate.ts +16 -14
  50. package/packages/orq-rc/src/funcs/agentsDelete.ts +10 -6
  51. package/packages/orq-rc/src/funcs/agentsInvoke.ts +16 -6
  52. package/packages/orq-rc/src/funcs/agentsList.ts +18 -6
  53. package/packages/orq-rc/src/funcs/agentsResponsesCreate.ts +23 -12
  54. package/packages/orq-rc/src/funcs/agentsRetrieve.ts +21 -16
  55. package/packages/orq-rc/src/funcs/agentsRun.ts +4 -2
  56. package/packages/orq-rc/src/funcs/agentsStream.ts +16 -6
  57. package/packages/orq-rc/src/funcs/agentsStreamRun.ts +4 -2
  58. package/packages/orq-rc/src/funcs/agentsUpdate.ts +14 -6
  59. package/packages/orq-rc/src/lib/config.ts +2 -2
  60. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  61. package/packages/orq-rc/src/mcp-server/server.ts +1 -9
  62. package/packages/orq-rc/src/mcp-server/tools/agentsCreate.ts +3 -3
  63. package/packages/orq-rc/src/mcp-server/tools/agentsDelete.ts +5 -5
  64. package/packages/orq-rc/src/mcp-server/tools/agentsInvoke.ts +7 -4
  65. package/packages/orq-rc/src/mcp-server/tools/agentsList.ts +9 -5
  66. package/packages/orq-rc/src/mcp-server/tools/agentsResponsesCreate.ts +8 -4
  67. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieve.ts +5 -5
  68. package/packages/orq-rc/src/mcp-server/tools/agentsRun.ts +2 -2
  69. package/packages/orq-rc/src/mcp-server/tools/agentsStream.ts +7 -4
  70. package/packages/orq-rc/src/mcp-server/tools/agentsStreamRun.ts +2 -2
  71. package/packages/orq-rc/src/mcp-server/tools/agentsUpdate.ts +8 -4
  72. package/packages/orq-rc/src/models/errors/createagentrequest.ts +67 -0
  73. package/packages/orq-rc/src/models/errors/deleteagent.ts +2 -2
  74. package/packages/orq-rc/src/models/errors/index.ts +2 -3
  75. package/packages/orq-rc/src/models/errors/{listagenttasks.ts → retrieveagentrequest.ts} +15 -15
  76. package/packages/orq-rc/src/models/errors/updateagent.ts +2 -2
  77. package/packages/orq-rc/src/models/operations/{createagent.ts → createagentrequest.ts} +1643 -1485
  78. package/packages/orq-rc/src/models/operations/{createagentresponse.ts → createagentresponserequest.ts} +141 -127
  79. package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
  80. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  81. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  82. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +8 -8
  83. package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
  84. package/packages/orq-rc/src/models/operations/createeval.ts +28 -28
  85. package/packages/orq-rc/src/models/operations/createprompt.ts +4 -4
  86. package/packages/orq-rc/src/models/operations/createtool.ts +12 -12
  87. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  88. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  89. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  90. package/packages/orq-rc/src/models/operations/getalltools.ts +12 -12
  91. package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
  92. package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
  93. package/packages/orq-rc/src/models/operations/index.ts +3 -7
  94. package/packages/orq-rc/src/models/operations/invokeagent.ts +153 -190
  95. package/packages/orq-rc/src/models/operations/listagents.ts +9 -21
  96. package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
  97. package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
  98. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +8 -8
  99. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  100. package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
  101. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +3741 -0
  102. package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
  103. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +8 -8
  104. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  105. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
  106. package/packages/orq-rc/src/models/operations/retrievetool.ts +12 -12
  107. package/packages/orq-rc/src/models/operations/runagent.ts +53 -57
  108. package/packages/orq-rc/src/models/operations/streamagent.ts +1 -1
  109. package/packages/orq-rc/src/models/operations/streamrunagent.ts +68 -82
  110. package/packages/orq-rc/src/models/operations/updateagent.ts +17 -17
  111. package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
  112. package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
  113. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +8 -8
  114. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  115. package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
  116. package/packages/orq-rc/src/models/operations/updateeval.ts +28 -28
  117. package/packages/orq-rc/src/models/operations/updateprompt.ts +4 -4
  118. package/packages/orq-rc/src/models/operations/updatetool.ts +14 -14
  119. package/packages/orq-rc/src/sdk/agents.ts +51 -99
  120. package/packages/orq-rc/src/sdk/responses.ts +7 -5
  121. package/src/lib/config.ts +2 -2
  122. package/src/mcp-server/mcp-server.ts +1 -1
  123. package/src/mcp-server/server.ts +1 -1
  124. package/src/models/operations/createbudget.ts +2 -2
  125. package/src/models/operations/createcontact.ts +2 -2
  126. package/src/models/operations/createdataset.ts +2 -2
  127. package/src/models/operations/createdatasetitem.ts +8 -8
  128. package/src/models/operations/createdatasource.ts +2 -2
  129. package/src/models/operations/createeval.ts +28 -28
  130. package/src/models/operations/createtool.ts +12 -12
  131. package/src/models/operations/fileget.ts +2 -2
  132. package/src/models/operations/filelist.ts +2 -2
  133. package/src/models/operations/fileupload.ts +2 -2
  134. package/src/models/operations/getalltools.ts +12 -12
  135. package/src/models/operations/getbudget.ts +2 -2
  136. package/src/models/operations/getevals.ts +28 -28
  137. package/src/models/operations/listbudgets.ts +2 -2
  138. package/src/models/operations/listcontacts.ts +2 -2
  139. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  140. package/src/models/operations/listdatasets.ts +2 -2
  141. package/src/models/operations/listdatasources.ts +2 -2
  142. package/src/models/operations/retrievecontact.ts +2 -2
  143. package/src/models/operations/retrievedatapoint.ts +8 -8
  144. package/src/models/operations/retrievedataset.ts +2 -2
  145. package/src/models/operations/retrievedatasource.ts +2 -2
  146. package/src/models/operations/retrievetool.ts +12 -12
  147. package/src/models/operations/runagent.ts +2 -2
  148. package/src/models/operations/streamrunagent.ts +2 -2
  149. package/src/models/operations/updatebudget.ts +2 -2
  150. package/src/models/operations/updatecontact.ts +2 -2
  151. package/src/models/operations/updatedatapoint.ts +8 -8
  152. package/src/models/operations/updatedataset.ts +2 -2
  153. package/src/models/operations/updatedatasource.ts +2 -2
  154. package/src/models/operations/updateeval.ts +28 -28
  155. package/src/models/operations/updatetool.ts +14 -14
  156. package/packages/orq-rc/src/funcs/agentsListActions.ts +0 -169
  157. package/packages/orq-rc/src/funcs/agentsListTasks.ts +0 -183
  158. package/packages/orq-rc/src/funcs/agentsRetrieveAction.ts +0 -173
  159. package/packages/orq-rc/src/funcs/agentsRetrieveTask.ts +0 -179
  160. package/packages/orq-rc/src/mcp-server/tools/agentsListActions.ts +0 -35
  161. package/packages/orq-rc/src/mcp-server/tools/agentsListTasks.ts +0 -37
  162. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveAction.ts +0 -35
  163. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveTask.ts +0 -37
  164. package/packages/orq-rc/src/models/errors/createagent.ts +0 -67
  165. package/packages/orq-rc/src/models/errors/getagent.ts +0 -67
  166. package/packages/orq-rc/src/models/operations/getagent.ts +0 -3480
  167. package/packages/orq-rc/src/models/operations/getagenttask.ts +0 -2389
  168. package/packages/orq-rc/src/models/operations/listactions.ts +0 -427
  169. package/packages/orq-rc/src/models/operations/listagenttasks.ts +0 -2614
  170. 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 a new agent
9
- * [delete](#delete) - Delete an agent
10
- * [retrieve](#retrieve) - Get an agent
11
- * [update](#update) - Update an agent
12
- * [invoke](#invoke) - Invoke an agent
13
- * [listTasks](#listtasks) - List all tasks for an agent
14
- * [retrieveTask](#retrievetask) - Retrieve a specific agent task
15
- * [list](#list) - List all agents
16
- * [run](#run) - Run an agent
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 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.
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="CreateAgent" method="post" path="/v2/agents" -->
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: "neatly unless refine aside platter alarmed shampoo shakily yippee",
36
+ description: "alongside beneath doubtfully behest validity bah after furthermore",
41
37
  instructions: "<value>",
42
38
  path: "Default",
43
- model: "Camaro",
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: "neatly unless refine aside platter alarmed shampoo shakily yippee",
93
+ description: "alongside beneath doubtfully behest validity bah after furthermore",
86
94
  instructions: "<value>",
87
95
  path: "Default",
88
- model: "Camaro",
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.CreateAgentRequestBody](../../models/operations/createagentrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
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.CreateAgentResponseBody](../../models/operations/createagentresponsebody.md)\>**
147
+ **Promise\<[operations.CreateAgentRequestResponseBody](../../models/operations/createagentrequestresponsebody.md)\>**
128
148
 
129
149
  ### Errors
130
150
 
131
- | Error Type | Status Code | Content Type |
132
- | ------------------------------ | ------------------------------ | ------------------------------ |
133
- | errors.CreateAgentResponseBody | 409 | application/json |
134
- | errors.APIError | 4XX, 5XX | \*/\* |
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 deletes an agent and all its configuration, including primary and fallback model settings.
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
- | `request` | [operations.DeleteAgentRequest](../../models/operations/deleteagentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
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 single agent by its unique key, including its full configuration with primary and fallback model settings.
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="GetAgent" method="get" path="/v2/agents/{agent_key}" -->
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
- | `request` | [operations.GetAgentRequest](../../models/operations/getagentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
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.GetAgentResponseBody](../../models/operations/getagentresponsebody.md)\>**
287
+ **Promise\<[operations.RetrieveAgentRequestResponseBody](../../models/operations/retrieveagentrequestresponsebody.md)\>**
276
288
 
277
289
  ### Errors
278
290
 
279
- | Error Type | Status Code | Content Type |
280
- | --------------------------- | --------------------------- | --------------------------- |
281
- | errors.GetAgentResponseBody | 404 | application/json |
282
- | errors.APIError | 4XX, 5XX | \*/\* |
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
- Updates an existing agent's configuration. You can update various fields including the model configuration and fallback model settings.
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
- agentKey: "<value>",
301
- requestBody: {
302
- model: "El Camino",
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
- knowledgeId: "customer-knowledge-base",
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
- agentKey: "<value>",
345
- requestBody: {
346
- model: "El Camino",
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
- knowledgeId: "customer-knowledge-base",
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
- | `request` | [operations.UpdateAgentRequest](../../models/operations/updateagentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
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
- Executes an existing agent with the provided input. The agent uses its pre-configured primary model and will automatically fall back to its configured fallback model if the primary model fails. Fallback models are configured at the agent level, not during execution.
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
- key: "<key>",
413
- requestBody: {
414
- message: {
415
- role: "user",
416
- parts: [],
417
- },
418
- contact: {
419
- id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
420
- displayName: "Jane Doe",
421
- email: "jane.doe@example.com",
422
- metadata: [
423
- {
424
- "department": "Engineering",
425
- "role": "Senior Developer",
426
- },
427
- ],
428
- logoUrl: "https://example.com/avatars/jane-doe.jpg",
429
- tags: [
430
- "hr",
431
- "engineering",
432
- ],
433
- },
434
- thread: {
435
- id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
436
- tags: [
437
- "customer-support",
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
- key: "<key>",
467
- requestBody: {
468
- message: {
469
- role: "user",
470
- parts: [],
471
- },
472
- contact: {
473
- id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
474
- displayName: "Jane Doe",
475
- email: "jane.doe@example.com",
476
- metadata: [
477
- {
478
- "department": "Engineering",
479
- "role": "Senior Developer",
480
- },
481
- ],
482
- logoUrl: "https://example.com/avatars/jane-doe.jpg",
483
- tags: [
484
- "hr",
485
- "engineering",
486
- ],
487
- },
488
- thread: {
489
- id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
490
- tags: [
491
- "customer-support",
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
- | `request` | [operations.InvokeAgentRequest](../../models/operations/invokeagentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
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 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.
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 | 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. |
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
- 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.
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
- Creates or updates an agent with the provided configuration, then streams execution events via Server-Sent Events (SSE). If the agent already exists with the same configuration, it will be reused. If the configuration differs, a new version is created. The stream will continue until the agent completes, errors, or reaches the configured timeout.
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 events via Server-Sent Events (SSE). The stream will continue until the agent completes, errors, or reaches the configured timeout.
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
- key: "<key>",
1094
- requestBody: {
1095
- message: {
1096
- role: "user",
1097
- parts: [],
1098
- },
1099
- contact: {
1100
- id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
1101
- displayName: "Jane Doe",
1102
- email: "jane.doe@example.com",
1103
- metadata: [
1104
- {
1105
- "department": "Engineering",
1106
- "role": "Senior Developer",
1107
- },
1108
- ],
1109
- logoUrl: "https://example.com/avatars/jane-doe.jpg",
1110
- tags: [
1111
- "hr",
1112
- "engineering",
1113
- ],
1114
- },
1115
- thread: {
1116
- id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
1117
- tags: [
1118
- "customer-support",
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
- key: "<key>",
1150
- requestBody: {
1151
- message: {
1152
- role: "user",
1153
- parts: [],
1154
- },
1155
- contact: {
1156
- id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
1157
- displayName: "Jane Doe",
1158
- email: "jane.doe@example.com",
1159
- metadata: [
1160
- {
1161
- "department": "Engineering",
1162
- "role": "Senior Developer",
1163
- },
1164
- ],
1165
- logoUrl: "https://example.com/avatars/jane-doe.jpg",
1166
- tags: [
1167
- "hr",
1168
- "engineering",
1169
- ],
1170
- },
1171
- thread: {
1172
- id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
1173
- tags: [
1174
- "customer-support",
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
- | `request` | [operations.StreamAgentRequest](../../models/operations/streamagentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
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 | \*/\* |