@orq-ai/node 3.1.6 → 3.2.0-rc.3

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 (165) hide show
  1. package/README.md +0 -38
  2. package/docs/sdks/deployments/README.md +0 -81
  3. package/jsr.json +1 -2
  4. package/lib/config.d.ts +2 -2
  5. package/lib/config.js +2 -2
  6. package/lib/config.js.map +1 -1
  7. package/lib/matchers.d.ts.map +1 -1
  8. package/lib/matchers.js +1 -4
  9. package/lib/matchers.js.map +1 -1
  10. package/models/operations/createcontact.js +2 -2
  11. package/models/operations/fileget.js +2 -2
  12. package/models/operations/filelist.js +2 -2
  13. package/models/operations/fileupload.js +2 -2
  14. package/models/operations/index.d.ts +0 -1
  15. package/models/operations/index.d.ts.map +1 -1
  16. package/models/operations/index.js +0 -1
  17. package/models/operations/index.js.map +1 -1
  18. package/package.json +3 -2
  19. package/sdk/deployments.d.ts +0 -8
  20. package/sdk/deployments.d.ts.map +1 -1
  21. package/sdk/deployments.js +0 -10
  22. package/sdk/deployments.js.map +1 -1
  23. package/src/lib/config.ts +2 -2
  24. package/src/lib/matchers.ts +1 -4
  25. package/src/models/operations/createcontact.ts +2 -2
  26. package/src/models/operations/fileget.ts +2 -2
  27. package/src/models/operations/filelist.ts +2 -2
  28. package/src/models/operations/fileupload.ts +2 -2
  29. package/src/models/operations/index.ts +0 -1
  30. package/src/sdk/deployments.ts +0 -19
  31. package/funcs/deploymentsStream.d.ts +0 -16
  32. package/funcs/deploymentsStream.d.ts.map +0 -1
  33. package/funcs/deploymentsStream.js +0 -126
  34. package/funcs/deploymentsStream.js.map +0 -1
  35. package/lib/event-streams.d.ts +0 -17
  36. package/lib/event-streams.d.ts.map +0 -1
  37. package/lib/event-streams.js +0 -220
  38. package/lib/event-streams.js.map +0 -1
  39. package/models/operations/deploymentstream.d.ts +0 -1622
  40. package/models/operations/deploymentstream.d.ts.map +0 -1
  41. package/models/operations/deploymentstream.js +0 -1571
  42. package/models/operations/deploymentstream.js.map +0 -1
  43. package/packages/orq-rc/FUNCTIONS.md +0 -106
  44. package/packages/orq-rc/README.md +0 -559
  45. package/packages/orq-rc/RUNTIMES.md +0 -48
  46. package/packages/orq-rc/docs/sdks/contacts/README.md +0 -84
  47. package/packages/orq-rc/docs/sdks/deployments/README.md +0 -316
  48. package/packages/orq-rc/docs/sdks/feedback/README.md +0 -92
  49. package/packages/orq-rc/docs/sdks/files/README.md +0 -305
  50. package/packages/orq-rc/docs/sdks/metrics/README.md +0 -86
  51. package/packages/orq-rc/docs/sdks/orq/README.md +0 -10
  52. package/packages/orq-rc/docs/sdks/prompts/README.md +0 -608
  53. package/packages/orq-rc/docs/sdks/promptsnippets/README.md +0 -534
  54. package/packages/orq-rc/docs/sdks/remoteconfig/README.md +0 -80
  55. package/packages/orq-rc/jsr.json +0 -28
  56. package/packages/orq-rc/package-lock.json +0 -1861
  57. package/packages/orq-rc/package.json +0 -31
  58. package/packages/orq-rc/src/core.ts +0 -13
  59. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -126
  60. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -134
  61. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -142
  62. package/packages/orq-rc/src/funcs/deploymentsList.ts +0 -141
  63. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +0 -134
  64. package/packages/orq-rc/src/funcs/deploymentsStream.ts +0 -150
  65. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -126
  66. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -130
  67. package/packages/orq-rc/src/funcs/filesGet.ts +0 -129
  68. package/packages/orq-rc/src/funcs/filesList.ts +0 -131
  69. package/packages/orq-rc/src/funcs/filesUpload.ts +0 -149
  70. package/packages/orq-rc/src/funcs/promptSnippetsCreate.ts +0 -128
  71. package/packages/orq-rc/src/funcs/promptSnippetsDelete.ts +0 -131
  72. package/packages/orq-rc/src/funcs/promptSnippetsGet.ts +0 -130
  73. package/packages/orq-rc/src/funcs/promptSnippetsGetByKey.ts +0 -132
  74. package/packages/orq-rc/src/funcs/promptSnippetsList.ts +0 -132
  75. package/packages/orq-rc/src/funcs/promptSnippetsUpdate.ts +0 -139
  76. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -126
  77. package/packages/orq-rc/src/funcs/promptsDelete.ts +0 -130
  78. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +0 -146
  79. package/packages/orq-rc/src/funcs/promptsList.ts +0 -133
  80. package/packages/orq-rc/src/funcs/promptsListVersions.ts +0 -139
  81. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +0 -132
  82. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -138
  83. package/packages/orq-rc/src/funcs/remoteconfigGetConfig.ts +0 -127
  84. package/packages/orq-rc/src/hooks/global.ts +0 -44
  85. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  86. package/packages/orq-rc/src/hooks/index.ts +0 -6
  87. package/packages/orq-rc/src/hooks/registration.ts +0 -15
  88. package/packages/orq-rc/src/hooks/types.ts +0 -109
  89. package/packages/orq-rc/src/index.ts +0 -7
  90. package/packages/orq-rc/src/lib/base64.ts +0 -37
  91. package/packages/orq-rc/src/lib/config.ts +0 -70
  92. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  93. package/packages/orq-rc/src/lib/encodings.ts +0 -483
  94. package/packages/orq-rc/src/lib/env.ts +0 -73
  95. package/packages/orq-rc/src/lib/event-streams.ts +0 -264
  96. package/packages/orq-rc/src/lib/files.ts +0 -40
  97. package/packages/orq-rc/src/lib/http.ts +0 -323
  98. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  99. package/packages/orq-rc/src/lib/logger.ts +0 -9
  100. package/packages/orq-rc/src/lib/matchers.ts +0 -325
  101. package/packages/orq-rc/src/lib/primitives.ts +0 -136
  102. package/packages/orq-rc/src/lib/retries.ts +0 -218
  103. package/packages/orq-rc/src/lib/schemas.ts +0 -91
  104. package/packages/orq-rc/src/lib/sdks.ts +0 -400
  105. package/packages/orq-rc/src/lib/security.ts +0 -254
  106. package/packages/orq-rc/src/lib/url.ts +0 -33
  107. package/packages/orq-rc/src/models/components/deployments.ts +0 -1666
  108. package/packages/orq-rc/src/models/components/index.ts +0 -6
  109. package/packages/orq-rc/src/models/components/security.ts +0 -71
  110. package/packages/orq-rc/src/models/errors/apierror.ts +0 -27
  111. package/packages/orq-rc/src/models/errors/getpromptversion.ts +0 -71
  112. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -82
  113. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  114. package/packages/orq-rc/src/models/errors/index.ts +0 -11
  115. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -97
  116. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -71
  117. package/packages/orq-rc/src/models/errors/updatepromptsnippet.ts +0 -71
  118. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -256
  119. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -286
  120. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -3819
  121. package/packages/orq-rc/src/models/operations/createpromptsnippet.ts +0 -6239
  122. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -69
  123. package/packages/orq-rc/src/models/operations/deletepromptsnippet.ts +0 -69
  124. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -1790
  125. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -3527
  126. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -1144
  127. package/packages/orq-rc/src/models/operations/deployments.ts +0 -2148
  128. package/packages/orq-rc/src/models/operations/deploymentstream.ts +0 -3062
  129. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -78
  130. package/packages/orq-rc/src/models/operations/fileget.ts +0 -222
  131. package/packages/orq-rc/src/models/operations/filelist.ts +0 -321
  132. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -322
  133. package/packages/orq-rc/src/models/operations/findonebykeypromptsnippet.ts +0 -4483
  134. package/packages/orq-rc/src/models/operations/findonepromptsnippet.ts +0 -4343
  135. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -2116
  136. package/packages/orq-rc/src/models/operations/getallpromptsnippets.ts +0 -4472
  137. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -1982
  138. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -2012
  139. package/packages/orq-rc/src/models/operations/index.ts +0 -29
  140. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -2146
  141. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -190
  142. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -3917
  143. package/packages/orq-rc/src/models/operations/updatepromptsnippet.ts +0 -6544
  144. package/packages/orq-rc/src/sdk/contacts.ts +0 -27
  145. package/packages/orq-rc/src/sdk/deployments.ts +0 -89
  146. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  147. package/packages/orq-rc/src/sdk/files.ts +0 -72
  148. package/packages/orq-rc/src/sdk/index.ts +0 -5
  149. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  150. package/packages/orq-rc/src/sdk/prompts.ts +0 -126
  151. package/packages/orq-rc/src/sdk/promptsnippets.ts +0 -99
  152. package/packages/orq-rc/src/sdk/remoteconfig.ts +0 -24
  153. package/packages/orq-rc/src/sdk/sdk.ts +0 -49
  154. package/packages/orq-rc/src/types/blobs.ts +0 -31
  155. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  156. package/packages/orq-rc/src/types/enums.ts +0 -16
  157. package/packages/orq-rc/src/types/fp.ts +0 -50
  158. package/packages/orq-rc/src/types/index.ts +0 -11
  159. package/packages/orq-rc/src/types/operations.ts +0 -105
  160. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  161. package/packages/orq-rc/src/types/streams.ts +0 -21
  162. package/packages/orq-rc/tsconfig.json +0 -41
  163. package/src/funcs/deploymentsStream.ts +0 -151
  164. package/src/lib/event-streams.ts +0 -264
  165. package/src/models/operations/deploymentstream.ts +0 -3062
@@ -1,608 +0,0 @@
1
- # Prompts
2
- (*prompts*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [list](#list) - List all prompts
9
- * [create](#create) - Create a prompt
10
- * [retrieve](#retrieve) - Retrieve a prompt
11
- * [update](#update) - Update a prompt
12
- * [delete](#delete) - Delete a prompt
13
- * [listVersions](#listversions) - List all prompt versions
14
- * [getVersion](#getversion) - Retrieve a prompt version
15
-
16
- ## list
17
-
18
- Returns a list of your prompts. The prompts are returned sorted by creation date, with the most recent prompts appearing first
19
-
20
- ### Example Usage
21
-
22
- ```typescript
23
- import { Orq } from "@orq-ai/node";
24
-
25
- const orq = new Orq({
26
- apiKey: process.env["ORQ_API_KEY"] ?? "",
27
- });
28
-
29
- async function run() {
30
- const result = await orq.prompts.list({});
31
-
32
- // Handle the result
33
- console.log(result);
34
- }
35
-
36
- run();
37
- ```
38
-
39
- ### Standalone function
40
-
41
- The standalone function version of this method:
42
-
43
- ```typescript
44
- import { OrqCore } from "@orq-ai/node/core.js";
45
- import { promptsList } from "@orq-ai/node/funcs/promptsList.js";
46
-
47
- // Use `OrqCore` for best tree-shaking performance.
48
- // You can create one instance of it to use across an application.
49
- const orq = new OrqCore({
50
- apiKey: process.env["ORQ_API_KEY"] ?? "",
51
- });
52
-
53
- async function run() {
54
- const res = await promptsList(orq, {});
55
-
56
- if (!res.ok) {
57
- throw res.error;
58
- }
59
-
60
- const { value: result } = res;
61
-
62
- // Handle the result
63
- console.log(result);
64
- }
65
-
66
- run();
67
- ```
68
-
69
- ### Parameters
70
-
71
- | Parameter | Type | Required | Description |
72
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
73
- | `request` | [operations.GetAllPromptsRequest](../../models/operations/getallpromptsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
74
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
75
- | `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. |
76
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
77
-
78
- ### Response
79
-
80
- **Promise\<[operations.GetAllPromptsResponseBody](../../models/operations/getallpromptsresponsebody.md)\>**
81
-
82
- ### Errors
83
-
84
- | Error Type | Status Code | Content Type |
85
- | --------------- | --------------- | --------------- |
86
- | errors.APIError | 4XX, 5XX | \*/\* |
87
-
88
- ## create
89
-
90
- Create a prompt
91
-
92
- ### Example Usage
93
-
94
- ```typescript
95
- import { Orq } from "@orq-ai/node";
96
-
97
- const orq = new Orq({
98
- apiKey: process.env["ORQ_API_KEY"] ?? "",
99
- });
100
-
101
- async function run() {
102
- const result = await orq.prompts.create({
103
- displayName: "Jed6",
104
- promptConfig: {
105
- messages: [
106
- {
107
- role: "system",
108
- content: "<value>",
109
- },
110
- {
111
- role: "system",
112
- content: [
113
- {
114
- type: "image_url",
115
- imageUrl: {
116
- url: "https://well-worn-formation.biz",
117
- },
118
- },
119
- {
120
- type: "text",
121
- text: "<value>",
122
- },
123
- {
124
- type: "text",
125
- text: "<value>",
126
- },
127
- ],
128
- },
129
- {
130
- role: "assistant",
131
- content: "<value>",
132
- },
133
- ],
134
- },
135
- path: "Customer Service/Billing/Refund",
136
- });
137
-
138
- // Handle the result
139
- console.log(result);
140
- }
141
-
142
- run();
143
- ```
144
-
145
- ### Standalone function
146
-
147
- The standalone function version of this method:
148
-
149
- ```typescript
150
- import { OrqCore } from "@orq-ai/node/core.js";
151
- import { promptsCreate } from "@orq-ai/node/funcs/promptsCreate.js";
152
-
153
- // Use `OrqCore` for best tree-shaking performance.
154
- // You can create one instance of it to use across an application.
155
- const orq = new OrqCore({
156
- apiKey: process.env["ORQ_API_KEY"] ?? "",
157
- });
158
-
159
- async function run() {
160
- const res = await promptsCreate(orq, {
161
- displayName: "Jed6",
162
- promptConfig: {
163
- messages: [
164
- {
165
- role: "system",
166
- content: "<value>",
167
- },
168
- {
169
- role: "system",
170
- content: [
171
- {
172
- type: "image_url",
173
- imageUrl: {
174
- url: "https://well-worn-formation.biz",
175
- },
176
- },
177
- {
178
- type: "text",
179
- text: "<value>",
180
- },
181
- {
182
- type: "text",
183
- text: "<value>",
184
- },
185
- ],
186
- },
187
- {
188
- role: "assistant",
189
- content: "<value>",
190
- },
191
- ],
192
- },
193
- path: "Customer Service/Billing/Refund",
194
- });
195
-
196
- if (!res.ok) {
197
- throw res.error;
198
- }
199
-
200
- const { value: result } = res;
201
-
202
- // Handle the result
203
- console.log(result);
204
- }
205
-
206
- run();
207
- ```
208
-
209
- ### Parameters
210
-
211
- | Parameter | Type | Required | Description |
212
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
213
- | `request` | [operations.CreatePromptRequestBody](../../models/operations/createpromptrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
214
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
215
- | `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. |
216
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
217
-
218
- ### Response
219
-
220
- **Promise\<[operations.CreatePromptResponseBody](../../models/operations/createpromptresponsebody.md)\>**
221
-
222
- ### Errors
223
-
224
- | Error Type | Status Code | Content Type |
225
- | --------------- | --------------- | --------------- |
226
- | errors.APIError | 4XX, 5XX | \*/\* |
227
-
228
- ## retrieve
229
-
230
- Retrieves a prompt object
231
-
232
- ### Example Usage
233
-
234
- ```typescript
235
- import { Orq } from "@orq-ai/node";
236
-
237
- const orq = new Orq({
238
- apiKey: process.env["ORQ_API_KEY"] ?? "",
239
- });
240
-
241
- async function run() {
242
- const result = await orq.prompts.retrieve({
243
- id: "<id>",
244
- });
245
-
246
- // Handle the result
247
- console.log(result);
248
- }
249
-
250
- run();
251
- ```
252
-
253
- ### Standalone function
254
-
255
- The standalone function version of this method:
256
-
257
- ```typescript
258
- import { OrqCore } from "@orq-ai/node/core.js";
259
- import { promptsRetrieve } from "@orq-ai/node/funcs/promptsRetrieve.js";
260
-
261
- // Use `OrqCore` for best tree-shaking performance.
262
- // You can create one instance of it to use across an application.
263
- const orq = new OrqCore({
264
- apiKey: process.env["ORQ_API_KEY"] ?? "",
265
- });
266
-
267
- async function run() {
268
- const res = await promptsRetrieve(orq, {
269
- id: "<id>",
270
- });
271
-
272
- if (!res.ok) {
273
- throw res.error;
274
- }
275
-
276
- const { value: result } = res;
277
-
278
- // Handle the result
279
- console.log(result);
280
- }
281
-
282
- run();
283
- ```
284
-
285
- ### Parameters
286
-
287
- | Parameter | Type | Required | Description |
288
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
289
- | `request` | [operations.GetOnePromptRequest](../../models/operations/getonepromptrequest.md) | :heavy_check_mark: | The request object to use for the request. |
290
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
291
- | `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. |
292
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
293
-
294
- ### Response
295
-
296
- **Promise\<[operations.GetOnePromptResponseBody](../../models/operations/getonepromptresponsebody.md)\>**
297
-
298
- ### Errors
299
-
300
- | Error Type | Status Code | Content Type |
301
- | --------------- | --------------- | --------------- |
302
- | errors.APIError | 4XX, 5XX | \*/\* |
303
-
304
- ## update
305
-
306
- Update a prompt
307
-
308
- ### Example Usage
309
-
310
- ```typescript
311
- import { Orq } from "@orq-ai/node";
312
-
313
- const orq = new Orq({
314
- apiKey: process.env["ORQ_API_KEY"] ?? "",
315
- });
316
-
317
- async function run() {
318
- const result = await orq.prompts.update({
319
- id: "<id>",
320
- });
321
-
322
- // Handle the result
323
- console.log(result);
324
- }
325
-
326
- run();
327
- ```
328
-
329
- ### Standalone function
330
-
331
- The standalone function version of this method:
332
-
333
- ```typescript
334
- import { OrqCore } from "@orq-ai/node/core.js";
335
- import { promptsUpdate } from "@orq-ai/node/funcs/promptsUpdate.js";
336
-
337
- // Use `OrqCore` for best tree-shaking performance.
338
- // You can create one instance of it to use across an application.
339
- const orq = new OrqCore({
340
- apiKey: process.env["ORQ_API_KEY"] ?? "",
341
- });
342
-
343
- async function run() {
344
- const res = await promptsUpdate(orq, {
345
- id: "<id>",
346
- });
347
-
348
- if (!res.ok) {
349
- throw res.error;
350
- }
351
-
352
- const { value: result } = res;
353
-
354
- // Handle the result
355
- console.log(result);
356
- }
357
-
358
- run();
359
- ```
360
-
361
- ### Parameters
362
-
363
- | Parameter | Type | Required | Description |
364
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
365
- | `request` | [operations.UpdatePromptRequest](../../models/operations/updatepromptrequest.md) | :heavy_check_mark: | The request object to use for the request. |
366
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
367
- | `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. |
368
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
369
-
370
- ### Response
371
-
372
- **Promise\<[operations.UpdatePromptResponseBody](../../models/operations/updatepromptresponsebody.md)\>**
373
-
374
- ### Errors
375
-
376
- | Error Type | Status Code | Content Type |
377
- | ------------------------------- | ------------------------------- | ------------------------------- |
378
- | errors.UpdatePromptResponseBody | 404 | application/json |
379
- | errors.APIError | 4XX, 5XX | \*/\* |
380
-
381
- ## delete
382
-
383
- Delete a prompt
384
-
385
- ### Example Usage
386
-
387
- ```typescript
388
- import { Orq } from "@orq-ai/node";
389
-
390
- const orq = new Orq({
391
- apiKey: process.env["ORQ_API_KEY"] ?? "",
392
- });
393
-
394
- async function run() {
395
- await orq.prompts.delete({
396
- id: "<id>",
397
- });
398
-
399
-
400
- }
401
-
402
- run();
403
- ```
404
-
405
- ### Standalone function
406
-
407
- The standalone function version of this method:
408
-
409
- ```typescript
410
- import { OrqCore } from "@orq-ai/node/core.js";
411
- import { promptsDelete } from "@orq-ai/node/funcs/promptsDelete.js";
412
-
413
- // Use `OrqCore` for best tree-shaking performance.
414
- // You can create one instance of it to use across an application.
415
- const orq = new OrqCore({
416
- apiKey: process.env["ORQ_API_KEY"] ?? "",
417
- });
418
-
419
- async function run() {
420
- const res = await promptsDelete(orq, {
421
- id: "<id>",
422
- });
423
-
424
- if (!res.ok) {
425
- throw res.error;
426
- }
427
-
428
- const { value: result } = res;
429
-
430
-
431
- }
432
-
433
- run();
434
- ```
435
-
436
- ### Parameters
437
-
438
- | Parameter | Type | Required | Description |
439
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
440
- | `request` | [operations.DeletePromptRequest](../../models/operations/deletepromptrequest.md) | :heavy_check_mark: | The request object to use for the request. |
441
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
442
- | `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. |
443
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
444
-
445
- ### Response
446
-
447
- **Promise\<void\>**
448
-
449
- ### Errors
450
-
451
- | Error Type | Status Code | Content Type |
452
- | --------------- | --------------- | --------------- |
453
- | errors.APIError | 4XX, 5XX | \*/\* |
454
-
455
- ## listVersions
456
-
457
- Returns a list of your prompt versions. The prompt versions are returned sorted by creation date, with the most recent prompt versions appearing first
458
-
459
- ### Example Usage
460
-
461
- ```typescript
462
- import { Orq } from "@orq-ai/node";
463
-
464
- const orq = new Orq({
465
- apiKey: process.env["ORQ_API_KEY"] ?? "",
466
- });
467
-
468
- async function run() {
469
- const result = await orq.prompts.listVersions({
470
- promptId: "<id>",
471
- });
472
-
473
- // Handle the result
474
- console.log(result);
475
- }
476
-
477
- run();
478
- ```
479
-
480
- ### Standalone function
481
-
482
- The standalone function version of this method:
483
-
484
- ```typescript
485
- import { OrqCore } from "@orq-ai/node/core.js";
486
- import { promptsListVersions } from "@orq-ai/node/funcs/promptsListVersions.js";
487
-
488
- // Use `OrqCore` for best tree-shaking performance.
489
- // You can create one instance of it to use across an application.
490
- const orq = new OrqCore({
491
- apiKey: process.env["ORQ_API_KEY"] ?? "",
492
- });
493
-
494
- async function run() {
495
- const res = await promptsListVersions(orq, {
496
- promptId: "<id>",
497
- });
498
-
499
- if (!res.ok) {
500
- throw res.error;
501
- }
502
-
503
- const { value: result } = res;
504
-
505
- // Handle the result
506
- console.log(result);
507
- }
508
-
509
- run();
510
- ```
511
-
512
- ### Parameters
513
-
514
- | Parameter | Type | Required | Description |
515
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
516
- | `request` | [operations.ListPromptVersionsRequest](../../models/operations/listpromptversionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
517
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
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. |
519
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
520
-
521
- ### Response
522
-
523
- **Promise\<[operations.ListPromptVersionsResponseBody](../../models/operations/listpromptversionsresponsebody.md)\>**
524
-
525
- ### Errors
526
-
527
- | Error Type | Status Code | Content Type |
528
- | --------------- | --------------- | --------------- |
529
- | errors.APIError | 4XX, 5XX | \*/\* |
530
-
531
- ## getVersion
532
-
533
- Retrieves a specific version of a prompt by its ID and version ID.
534
-
535
- ### Example Usage
536
-
537
- ```typescript
538
- import { Orq } from "@orq-ai/node";
539
-
540
- const orq = new Orq({
541
- apiKey: process.env["ORQ_API_KEY"] ?? "",
542
- });
543
-
544
- async function run() {
545
- const result = await orq.prompts.getVersion({
546
- promptId: "<id>",
547
- versionId: "<id>",
548
- });
549
-
550
- // Handle the result
551
- console.log(result);
552
- }
553
-
554
- run();
555
- ```
556
-
557
- ### Standalone function
558
-
559
- The standalone function version of this method:
560
-
561
- ```typescript
562
- import { OrqCore } from "@orq-ai/node/core.js";
563
- import { promptsGetVersion } from "@orq-ai/node/funcs/promptsGetVersion.js";
564
-
565
- // Use `OrqCore` for best tree-shaking performance.
566
- // You can create one instance of it to use across an application.
567
- const orq = new OrqCore({
568
- apiKey: process.env["ORQ_API_KEY"] ?? "",
569
- });
570
-
571
- async function run() {
572
- const res = await promptsGetVersion(orq, {
573
- promptId: "<id>",
574
- versionId: "<id>",
575
- });
576
-
577
- if (!res.ok) {
578
- throw res.error;
579
- }
580
-
581
- const { value: result } = res;
582
-
583
- // Handle the result
584
- console.log(result);
585
- }
586
-
587
- run();
588
- ```
589
-
590
- ### Parameters
591
-
592
- | Parameter | Type | Required | Description |
593
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
594
- | `request` | [operations.GetPromptVersionRequest](../../models/operations/getpromptversionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
595
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
596
- | `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. |
597
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
598
-
599
- ### Response
600
-
601
- **Promise\<[operations.GetPromptVersionResponseBody](../../models/operations/getpromptversionresponsebody.md)\>**
602
-
603
- ### Errors
604
-
605
- | Error Type | Status Code | Content Type |
606
- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
607
- | errors.GetPromptVersionResponseBody | 404 | application/json |
608
- | errors.APIError | 4XX, 5XX | \*/\* |