@orq-ai/node 3.1.6 → 3.1.8

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 (72) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/models/operations/createcontact.js +2 -2
  5. package/models/operations/fileget.js +2 -2
  6. package/models/operations/filelist.js +2 -2
  7. package/models/operations/fileupload.js +2 -2
  8. package/package.json +1 -1
  9. package/packages/orq-rc/README.md +8 -61
  10. package/packages/orq-rc/docs/sdks/deployments/README.md +0 -81
  11. package/packages/orq-rc/docs/sdks/files/README.md +8 -8
  12. package/packages/orq-rc/docs/sdks/{remoteconfig → remoteconfigs}/README.md +8 -8
  13. package/packages/orq-rc/jsr.json +1 -2
  14. package/packages/orq-rc/package-lock.json +2 -2
  15. package/packages/orq-rc/package.json +1 -1
  16. package/packages/orq-rc/src/funcs/contactsCreate.ts +1 -0
  17. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +1 -0
  18. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +1 -0
  19. package/packages/orq-rc/src/funcs/deploymentsList.ts +1 -0
  20. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +1 -0
  21. package/packages/orq-rc/src/funcs/feedbackCreate.ts +1 -0
  22. package/packages/orq-rc/src/funcs/{filesUpload.ts → filesCreate.ts} +3 -2
  23. package/packages/orq-rc/src/funcs/filesDelete.ts +1 -0
  24. package/packages/orq-rc/src/funcs/filesGet.ts +5 -1
  25. package/packages/orq-rc/src/funcs/filesList.ts +6 -3
  26. package/packages/orq-rc/src/funcs/promptsCreate.ts +1 -0
  27. package/packages/orq-rc/src/funcs/promptsDelete.ts +1 -0
  28. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +1 -0
  29. package/packages/orq-rc/src/funcs/promptsList.ts +1 -0
  30. package/packages/orq-rc/src/funcs/promptsListVersions.ts +1 -0
  31. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +1 -0
  32. package/packages/orq-rc/src/funcs/promptsUpdate.ts +1 -0
  33. package/packages/orq-rc/src/funcs/{remoteconfigGetConfig.ts → remoteconfigsRetrieve.ts} +3 -2
  34. package/packages/orq-rc/src/hooks/types.ts +1 -0
  35. package/packages/orq-rc/src/lib/config.ts +3 -3
  36. package/packages/orq-rc/src/lib/matchers.ts +1 -4
  37. package/packages/orq-rc/src/lib/security.ts +0 -1
  38. package/packages/orq-rc/src/models/errors/index.ts +0 -1
  39. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  40. package/packages/orq-rc/src/models/operations/createprompt.ts +668 -770
  41. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  42. package/packages/orq-rc/src/models/operations/filelist.ts +31 -16
  43. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  44. package/packages/orq-rc/src/models/operations/index.ts +0 -7
  45. package/packages/orq-rc/src/models/operations/updateprompt.ts +64 -81
  46. package/packages/orq-rc/src/sdk/deployments.ts +0 -19
  47. package/packages/orq-rc/src/sdk/files.ts +11 -5
  48. package/packages/orq-rc/src/sdk/{remoteconfig.ts → remoteconfigs.ts} +5 -5
  49. package/packages/orq-rc/src/sdk/sdk.ts +4 -10
  50. package/src/lib/config.ts +3 -3
  51. package/src/models/operations/createcontact.ts +2 -2
  52. package/src/models/operations/fileget.ts +2 -2
  53. package/src/models/operations/filelist.ts +2 -2
  54. package/src/models/operations/fileupload.ts +2 -2
  55. package/packages/orq-rc/docs/sdks/promptsnippets/README.md +0 -534
  56. package/packages/orq-rc/src/funcs/deploymentsStream.ts +0 -150
  57. package/packages/orq-rc/src/funcs/promptSnippetsCreate.ts +0 -128
  58. package/packages/orq-rc/src/funcs/promptSnippetsDelete.ts +0 -131
  59. package/packages/orq-rc/src/funcs/promptSnippetsGet.ts +0 -130
  60. package/packages/orq-rc/src/funcs/promptSnippetsGetByKey.ts +0 -132
  61. package/packages/orq-rc/src/funcs/promptSnippetsList.ts +0 -132
  62. package/packages/orq-rc/src/funcs/promptSnippetsUpdate.ts +0 -139
  63. package/packages/orq-rc/src/lib/event-streams.ts +0 -264
  64. package/packages/orq-rc/src/models/errors/updatepromptsnippet.ts +0 -71
  65. package/packages/orq-rc/src/models/operations/createpromptsnippet.ts +0 -6239
  66. package/packages/orq-rc/src/models/operations/deletepromptsnippet.ts +0 -69
  67. package/packages/orq-rc/src/models/operations/deploymentstream.ts +0 -3062
  68. package/packages/orq-rc/src/models/operations/findonebykeypromptsnippet.ts +0 -4483
  69. package/packages/orq-rc/src/models/operations/findonepromptsnippet.ts +0 -4343
  70. package/packages/orq-rc/src/models/operations/getallpromptsnippets.ts +0 -4472
  71. package/packages/orq-rc/src/models/operations/updatepromptsnippet.ts +0 -6544
  72. package/packages/orq-rc/src/sdk/promptsnippets.ts +0 -99
@@ -245,7 +245,7 @@ export const FileUploadResponseBody$inboundSchema: z.ZodType<
245
245
  file_name: z.string(),
246
246
  workspace_id: z.string(),
247
247
  created: z.string().datetime({ offset: true }).default(
248
- "2025-02-13T10:41:36.512Z",
248
+ "2025-02-16T19:05:32.895Z",
249
249
  ).transform(v => new Date(v)),
250
250
  }).transform((v) => {
251
251
  return remap$(v, {
@@ -279,7 +279,7 @@ export const FileUploadResponseBody$outboundSchema: z.ZodType<
279
279
  bytes: z.number(),
280
280
  fileName: z.string(),
281
281
  workspaceId: z.string(),
282
- created: z.date().default(() => new Date("2025-02-13T10:41:36.512Z"))
282
+ created: z.date().default(() => new Date("2025-02-16T19:05:32.895Z"))
283
283
  .transform(v => v.toISOString()),
284
284
  }).transform((v) => {
285
285
  return remap$(v, {
@@ -1,534 +0,0 @@
1
- # PromptSnippets
2
- (*promptSnippets*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [list](#list) - List all prompts snippets
9
- * [create](#create) - Create a prompt snippet
10
- * [update](#update) - Update a prompt snippet
11
- * [delete](#delete) - Delete a prompt snippet
12
- * [get](#get) - Retrieve a prompt snippet
13
- * [getByKey](#getbykey) - Retrieve a prompt snippet by key
14
-
15
- ## list
16
-
17
- List all prompts snippets
18
-
19
- ### Example Usage
20
-
21
- ```typescript
22
- import { Orq } from "@orq-ai/node";
23
-
24
- const orq = new Orq({
25
- apiKey: process.env["ORQ_API_KEY"] ?? "",
26
- });
27
-
28
- async function run() {
29
- const result = await orq.promptSnippets.list({});
30
-
31
- // Handle the result
32
- console.log(result);
33
- }
34
-
35
- run();
36
- ```
37
-
38
- ### Standalone function
39
-
40
- The standalone function version of this method:
41
-
42
- ```typescript
43
- import { OrqCore } from "@orq-ai/node/core.js";
44
- import { promptSnippetsList } from "@orq-ai/node/funcs/promptSnippetsList.js";
45
-
46
- // Use `OrqCore` for best tree-shaking performance.
47
- // You can create one instance of it to use across an application.
48
- const orq = new OrqCore({
49
- apiKey: process.env["ORQ_API_KEY"] ?? "",
50
- });
51
-
52
- async function run() {
53
- const res = await promptSnippetsList(orq, {});
54
-
55
- if (!res.ok) {
56
- throw res.error;
57
- }
58
-
59
- const { value: result } = res;
60
-
61
- // Handle the result
62
- console.log(result);
63
- }
64
-
65
- run();
66
- ```
67
-
68
- ### Parameters
69
-
70
- | Parameter | Type | Required | Description |
71
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
72
- | `request` | [operations.GetAllPromptSnippetsRequest](../../models/operations/getallpromptsnippetsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
73
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
74
- | `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. |
75
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
76
-
77
- ### Response
78
-
79
- **Promise\<[operations.GetAllPromptSnippetsResponseBody](../../models/operations/getallpromptsnippetsresponsebody.md)\>**
80
-
81
- ### Errors
82
-
83
- | Error Type | Status Code | Content Type |
84
- | --------------- | --------------- | --------------- |
85
- | errors.APIError | 4XX, 5XX | \*/\* |
86
-
87
- ## create
88
-
89
- Create a prompt snippet
90
-
91
- ### Example Usage
92
-
93
- ```typescript
94
- import { Orq } from "@orq-ai/node";
95
-
96
- const orq = new Orq({
97
- apiKey: process.env["ORQ_API_KEY"] ?? "",
98
- });
99
-
100
- async function run() {
101
- const result = await orq.promptSnippets.create({
102
- key: "<key>",
103
- promptConfig: {
104
- messages: [
105
- {
106
- role: "system",
107
- content: "<value>",
108
- },
109
- {
110
- role: "system",
111
- content: [
112
- {
113
- type: "image_url",
114
- imageUrl: {
115
- url: "https://well-worn-formation.biz",
116
- },
117
- },
118
- {
119
- type: "text",
120
- text: "<value>",
121
- },
122
- {
123
- type: "text",
124
- text: "<value>",
125
- },
126
- ],
127
- },
128
- {
129
- role: "assistant",
130
- content: "<value>",
131
- },
132
- ],
133
- },
134
- path: "Customer Service/Billing/Refund",
135
- });
136
-
137
- // Handle the result
138
- console.log(result);
139
- }
140
-
141
- run();
142
- ```
143
-
144
- ### Standalone function
145
-
146
- The standalone function version of this method:
147
-
148
- ```typescript
149
- import { OrqCore } from "@orq-ai/node/core.js";
150
- import { promptSnippetsCreate } from "@orq-ai/node/funcs/promptSnippetsCreate.js";
151
-
152
- // Use `OrqCore` for best tree-shaking performance.
153
- // You can create one instance of it to use across an application.
154
- const orq = new OrqCore({
155
- apiKey: process.env["ORQ_API_KEY"] ?? "",
156
- });
157
-
158
- async function run() {
159
- const res = await promptSnippetsCreate(orq, {
160
- key: "<key>",
161
- promptConfig: {
162
- messages: [
163
- {
164
- role: "system",
165
- content: "<value>",
166
- },
167
- {
168
- role: "system",
169
- content: [
170
- {
171
- type: "image_url",
172
- imageUrl: {
173
- url: "https://well-worn-formation.biz",
174
- },
175
- },
176
- {
177
- type: "text",
178
- text: "<value>",
179
- },
180
- {
181
- type: "text",
182
- text: "<value>",
183
- },
184
- ],
185
- },
186
- {
187
- role: "assistant",
188
- content: "<value>",
189
- },
190
- ],
191
- },
192
- path: "Customer Service/Billing/Refund",
193
- });
194
-
195
- if (!res.ok) {
196
- throw res.error;
197
- }
198
-
199
- const { value: result } = res;
200
-
201
- // Handle the result
202
- console.log(result);
203
- }
204
-
205
- run();
206
- ```
207
-
208
- ### Parameters
209
-
210
- | Parameter | Type | Required | Description |
211
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
212
- | `request` | [operations.CreatePromptSnippetRequestBody](../../models/operations/createpromptsnippetrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
213
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
214
- | `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. |
215
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
216
-
217
- ### Response
218
-
219
- **Promise\<[operations.CreatePromptSnippetResponseBody](../../models/operations/createpromptsnippetresponsebody.md)\>**
220
-
221
- ### Errors
222
-
223
- | Error Type | Status Code | Content Type |
224
- | --------------- | --------------- | --------------- |
225
- | errors.APIError | 4XX, 5XX | \*/\* |
226
-
227
- ## update
228
-
229
- Update a prompt snippet
230
-
231
- ### Example Usage
232
-
233
- ```typescript
234
- import { Orq } from "@orq-ai/node";
235
-
236
- const orq = new Orq({
237
- apiKey: process.env["ORQ_API_KEY"] ?? "",
238
- });
239
-
240
- async function run() {
241
- const result = await orq.promptSnippets.update({
242
- id: "<id>",
243
- requestBody: {
244
- path: "Customer Service/Billing/Refund",
245
- },
246
- });
247
-
248
- // Handle the result
249
- console.log(result);
250
- }
251
-
252
- run();
253
- ```
254
-
255
- ### Standalone function
256
-
257
- The standalone function version of this method:
258
-
259
- ```typescript
260
- import { OrqCore } from "@orq-ai/node/core.js";
261
- import { promptSnippetsUpdate } from "@orq-ai/node/funcs/promptSnippetsUpdate.js";
262
-
263
- // Use `OrqCore` for best tree-shaking performance.
264
- // You can create one instance of it to use across an application.
265
- const orq = new OrqCore({
266
- apiKey: process.env["ORQ_API_KEY"] ?? "",
267
- });
268
-
269
- async function run() {
270
- const res = await promptSnippetsUpdate(orq, {
271
- id: "<id>",
272
- requestBody: {
273
- path: "Customer Service/Billing/Refund",
274
- },
275
- });
276
-
277
- if (!res.ok) {
278
- throw res.error;
279
- }
280
-
281
- const { value: result } = res;
282
-
283
- // Handle the result
284
- console.log(result);
285
- }
286
-
287
- run();
288
- ```
289
-
290
- ### Parameters
291
-
292
- | Parameter | Type | Required | Description |
293
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
294
- | `request` | [operations.UpdatePromptSnippetRequest](../../models/operations/updatepromptsnippetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
295
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
296
- | `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. |
297
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
298
-
299
- ### Response
300
-
301
- **Promise\<[operations.UpdatePromptSnippetResponseBody](../../models/operations/updatepromptsnippetresponsebody.md)\>**
302
-
303
- ### Errors
304
-
305
- | Error Type | Status Code | Content Type |
306
- | -------------------------------------- | -------------------------------------- | -------------------------------------- |
307
- | errors.UpdatePromptSnippetResponseBody | 404 | application/json |
308
- | errors.APIError | 4XX, 5XX | \*/\* |
309
-
310
- ## delete
311
-
312
- Delete a prompt snippet
313
-
314
- ### Example Usage
315
-
316
- ```typescript
317
- import { Orq } from "@orq-ai/node";
318
-
319
- const orq = new Orq({
320
- apiKey: process.env["ORQ_API_KEY"] ?? "",
321
- });
322
-
323
- async function run() {
324
- await orq.promptSnippets.delete({
325
- id: "<id>",
326
- });
327
-
328
-
329
- }
330
-
331
- run();
332
- ```
333
-
334
- ### Standalone function
335
-
336
- The standalone function version of this method:
337
-
338
- ```typescript
339
- import { OrqCore } from "@orq-ai/node/core.js";
340
- import { promptSnippetsDelete } from "@orq-ai/node/funcs/promptSnippetsDelete.js";
341
-
342
- // Use `OrqCore` for best tree-shaking performance.
343
- // You can create one instance of it to use across an application.
344
- const orq = new OrqCore({
345
- apiKey: process.env["ORQ_API_KEY"] ?? "",
346
- });
347
-
348
- async function run() {
349
- const res = await promptSnippetsDelete(orq, {
350
- id: "<id>",
351
- });
352
-
353
- if (!res.ok) {
354
- throw res.error;
355
- }
356
-
357
- const { value: result } = res;
358
-
359
-
360
- }
361
-
362
- run();
363
- ```
364
-
365
- ### Parameters
366
-
367
- | Parameter | Type | Required | Description |
368
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
369
- | `request` | [operations.DeletePromptSnippetRequest](../../models/operations/deletepromptsnippetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
370
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
371
- | `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. |
372
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
373
-
374
- ### Response
375
-
376
- **Promise\<void\>**
377
-
378
- ### Errors
379
-
380
- | Error Type | Status Code | Content Type |
381
- | --------------- | --------------- | --------------- |
382
- | errors.APIError | 4XX, 5XX | \*/\* |
383
-
384
- ## get
385
-
386
- Retrieve a prompt snippet
387
-
388
- ### Example Usage
389
-
390
- ```typescript
391
- import { Orq } from "@orq-ai/node";
392
-
393
- const orq = new Orq({
394
- apiKey: process.env["ORQ_API_KEY"] ?? "",
395
- });
396
-
397
- async function run() {
398
- const result = await orq.promptSnippets.get({
399
- id: "<id>",
400
- });
401
-
402
- // Handle the result
403
- console.log(result);
404
- }
405
-
406
- run();
407
- ```
408
-
409
- ### Standalone function
410
-
411
- The standalone function version of this method:
412
-
413
- ```typescript
414
- import { OrqCore } from "@orq-ai/node/core.js";
415
- import { promptSnippetsGet } from "@orq-ai/node/funcs/promptSnippetsGet.js";
416
-
417
- // Use `OrqCore` for best tree-shaking performance.
418
- // You can create one instance of it to use across an application.
419
- const orq = new OrqCore({
420
- apiKey: process.env["ORQ_API_KEY"] ?? "",
421
- });
422
-
423
- async function run() {
424
- const res = await promptSnippetsGet(orq, {
425
- id: "<id>",
426
- });
427
-
428
- if (!res.ok) {
429
- throw res.error;
430
- }
431
-
432
- const { value: result } = res;
433
-
434
- // Handle the result
435
- console.log(result);
436
- }
437
-
438
- run();
439
- ```
440
-
441
- ### Parameters
442
-
443
- | Parameter | Type | Required | Description |
444
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
445
- | `request` | [operations.FindOnePromptSnippetRequest](../../models/operations/findonepromptsnippetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
446
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
447
- | `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. |
448
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
449
-
450
- ### Response
451
-
452
- **Promise\<[operations.FindOnePromptSnippetResponseBody](../../models/operations/findonepromptsnippetresponsebody.md)\>**
453
-
454
- ### Errors
455
-
456
- | Error Type | Status Code | Content Type |
457
- | --------------- | --------------- | --------------- |
458
- | errors.APIError | 4XX, 5XX | \*/\* |
459
-
460
- ## getByKey
461
-
462
- Retrieve a prompt snippet by key
463
-
464
- ### Example Usage
465
-
466
- ```typescript
467
- import { Orq } from "@orq-ai/node";
468
-
469
- const orq = new Orq({
470
- apiKey: process.env["ORQ_API_KEY"] ?? "",
471
- });
472
-
473
- async function run() {
474
- const result = await orq.promptSnippets.getByKey({
475
- key: "<key>",
476
- });
477
-
478
- // Handle the result
479
- console.log(result);
480
- }
481
-
482
- run();
483
- ```
484
-
485
- ### Standalone function
486
-
487
- The standalone function version of this method:
488
-
489
- ```typescript
490
- import { OrqCore } from "@orq-ai/node/core.js";
491
- import { promptSnippetsGetByKey } from "@orq-ai/node/funcs/promptSnippetsGetByKey.js";
492
-
493
- // Use `OrqCore` for best tree-shaking performance.
494
- // You can create one instance of it to use across an application.
495
- const orq = new OrqCore({
496
- apiKey: process.env["ORQ_API_KEY"] ?? "",
497
- });
498
-
499
- async function run() {
500
- const res = await promptSnippetsGetByKey(orq, {
501
- key: "<key>",
502
- });
503
-
504
- if (!res.ok) {
505
- throw res.error;
506
- }
507
-
508
- const { value: result } = res;
509
-
510
- // Handle the result
511
- console.log(result);
512
- }
513
-
514
- run();
515
- ```
516
-
517
- ### Parameters
518
-
519
- | Parameter | Type | Required | Description |
520
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
521
- | `request` | [operations.FindOneByKeyPromptSnippetRequest](../../models/operations/findonebykeypromptsnippetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
522
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
523
- | `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. |
524
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
525
-
526
- ### Response
527
-
528
- **Promise\<[operations.FindOneByKeyPromptSnippetResponseBody](../../models/operations/findonebykeypromptsnippetresponsebody.md)\>**
529
-
530
- ### Errors
531
-
532
- | Error Type | Status Code | Content Type |
533
- | --------------- | --------------- | --------------- |
534
- | errors.APIError | 4XX, 5XX | \*/\* |