@orq-ai/node 3.1.7 → 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 (147) 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 +3 -3
  5. package/lib/config.js +3 -3
  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 +3 -3
  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 -506
  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 -235
  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/remoteconfigs/README.md +0 -80
  54. package/packages/orq-rc/jsr.json +0 -27
  55. package/packages/orq-rc/package-lock.json +0 -1861
  56. package/packages/orq-rc/package.json +0 -31
  57. package/packages/orq-rc/src/core.ts +0 -13
  58. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -127
  59. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -135
  60. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -143
  61. package/packages/orq-rc/src/funcs/deploymentsList.ts +0 -142
  62. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +0 -135
  63. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -127
  64. package/packages/orq-rc/src/funcs/filesCreate.ts +0 -150
  65. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -131
  66. package/packages/orq-rc/src/funcs/filesGet.ts +0 -133
  67. package/packages/orq-rc/src/funcs/filesList.ts +0 -134
  68. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -127
  69. package/packages/orq-rc/src/funcs/promptsDelete.ts +0 -131
  70. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +0 -147
  71. package/packages/orq-rc/src/funcs/promptsList.ts +0 -134
  72. package/packages/orq-rc/src/funcs/promptsListVersions.ts +0 -140
  73. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +0 -133
  74. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -139
  75. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +0 -128
  76. package/packages/orq-rc/src/hooks/global.ts +0 -44
  77. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  78. package/packages/orq-rc/src/hooks/index.ts +0 -6
  79. package/packages/orq-rc/src/hooks/registration.ts +0 -15
  80. package/packages/orq-rc/src/hooks/types.ts +0 -110
  81. package/packages/orq-rc/src/index.ts +0 -7
  82. package/packages/orq-rc/src/lib/base64.ts +0 -37
  83. package/packages/orq-rc/src/lib/config.ts +0 -70
  84. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  85. package/packages/orq-rc/src/lib/encodings.ts +0 -483
  86. package/packages/orq-rc/src/lib/env.ts +0 -73
  87. package/packages/orq-rc/src/lib/files.ts +0 -40
  88. package/packages/orq-rc/src/lib/http.ts +0 -323
  89. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  90. package/packages/orq-rc/src/lib/logger.ts +0 -9
  91. package/packages/orq-rc/src/lib/matchers.ts +0 -322
  92. package/packages/orq-rc/src/lib/primitives.ts +0 -136
  93. package/packages/orq-rc/src/lib/retries.ts +0 -218
  94. package/packages/orq-rc/src/lib/schemas.ts +0 -91
  95. package/packages/orq-rc/src/lib/sdks.ts +0 -400
  96. package/packages/orq-rc/src/lib/security.ts +0 -253
  97. package/packages/orq-rc/src/lib/url.ts +0 -33
  98. package/packages/orq-rc/src/models/components/deployments.ts +0 -1666
  99. package/packages/orq-rc/src/models/components/index.ts +0 -6
  100. package/packages/orq-rc/src/models/components/security.ts +0 -71
  101. package/packages/orq-rc/src/models/errors/apierror.ts +0 -27
  102. package/packages/orq-rc/src/models/errors/getpromptversion.ts +0 -71
  103. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -82
  104. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  105. package/packages/orq-rc/src/models/errors/index.ts +0 -10
  106. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -97
  107. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -71
  108. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -256
  109. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -286
  110. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -3717
  111. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -69
  112. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -1790
  113. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -3527
  114. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -1144
  115. package/packages/orq-rc/src/models/operations/deployments.ts +0 -2148
  116. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -78
  117. package/packages/orq-rc/src/models/operations/fileget.ts +0 -222
  118. package/packages/orq-rc/src/models/operations/filelist.ts +0 -336
  119. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -322
  120. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -2116
  121. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -1982
  122. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -2012
  123. package/packages/orq-rc/src/models/operations/index.ts +0 -22
  124. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -2146
  125. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -190
  126. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -3900
  127. package/packages/orq-rc/src/sdk/contacts.ts +0 -27
  128. package/packages/orq-rc/src/sdk/deployments.ts +0 -70
  129. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  130. package/packages/orq-rc/src/sdk/files.ts +0 -78
  131. package/packages/orq-rc/src/sdk/index.ts +0 -5
  132. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  133. package/packages/orq-rc/src/sdk/prompts.ts +0 -126
  134. package/packages/orq-rc/src/sdk/remoteconfigs.ts +0 -24
  135. package/packages/orq-rc/src/sdk/sdk.ts +0 -43
  136. package/packages/orq-rc/src/types/blobs.ts +0 -31
  137. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  138. package/packages/orq-rc/src/types/enums.ts +0 -16
  139. package/packages/orq-rc/src/types/fp.ts +0 -50
  140. package/packages/orq-rc/src/types/index.ts +0 -11
  141. package/packages/orq-rc/src/types/operations.ts +0 -105
  142. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  143. package/packages/orq-rc/src/types/streams.ts +0 -21
  144. package/packages/orq-rc/tsconfig.json +0 -41
  145. package/src/funcs/deploymentsStream.ts +0 -151
  146. package/src/lib/event-streams.ts +0 -264
  147. 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 | \*/\* |