@orq-ai/node 3.1.0-rc.64 → 3.1.0

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 (145) hide show
  1. package/docs/sdks/promptsnippets/README.md +2 -48
  2. package/jsr.json +1 -1
  3. package/lib/config.d.ts +2 -2
  4. package/lib/config.js +2 -2
  5. package/lib/config.js.map +1 -1
  6. package/models/operations/createcontact.js +2 -2
  7. package/models/operations/createpromptsnippet.js +2 -2
  8. package/models/operations/fileget.js +2 -2
  9. package/models/operations/filelist.js +2 -2
  10. package/models/operations/fileupload.js +2 -2
  11. package/models/operations/findonebykeypromptsnippet.js +2 -2
  12. package/models/operations/findonepromptsnippet.js +2 -2
  13. package/models/operations/getallpromptsnippets.js +2 -2
  14. package/models/operations/updatepromptsnippet.js +2 -2
  15. package/package.json +2 -3
  16. package/packages/orq-rc/FUNCTIONS.md +106 -0
  17. package/packages/orq-rc/README.md +559 -0
  18. package/packages/orq-rc/RUNTIMES.md +48 -0
  19. package/packages/orq-rc/docs/sdks/contacts/README.md +84 -0
  20. package/packages/orq-rc/docs/sdks/deployments/README.md +316 -0
  21. package/packages/orq-rc/docs/sdks/feedback/README.md +92 -0
  22. package/packages/orq-rc/docs/sdks/files/README.md +305 -0
  23. package/packages/orq-rc/docs/sdks/metrics/README.md +86 -0
  24. package/packages/orq-rc/docs/sdks/orq/README.md +10 -0
  25. package/packages/orq-rc/docs/sdks/prompts/README.md +608 -0
  26. package/packages/orq-rc/docs/sdks/promptsnippets/README.md +534 -0
  27. package/packages/orq-rc/docs/sdks/remoteconfig/README.md +80 -0
  28. package/packages/orq-rc/jsr.json +28 -0
  29. package/packages/orq-rc/package-lock.json +1861 -0
  30. package/packages/orq-rc/package.json +31 -0
  31. package/packages/orq-rc/src/core.ts +13 -0
  32. package/packages/orq-rc/src/funcs/contactsCreate.ts +126 -0
  33. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +134 -0
  34. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +142 -0
  35. package/packages/orq-rc/src/funcs/deploymentsList.ts +141 -0
  36. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +134 -0
  37. package/packages/orq-rc/src/funcs/deploymentsStream.ts +150 -0
  38. package/packages/orq-rc/src/funcs/feedbackCreate.ts +126 -0
  39. package/packages/orq-rc/src/funcs/filesDelete.ts +130 -0
  40. package/packages/orq-rc/src/funcs/filesGet.ts +129 -0
  41. package/packages/orq-rc/src/funcs/filesList.ts +131 -0
  42. package/packages/orq-rc/src/funcs/filesUpload.ts +149 -0
  43. package/packages/orq-rc/src/funcs/promptSnippetsCreate.ts +128 -0
  44. package/packages/orq-rc/src/funcs/promptSnippetsDelete.ts +131 -0
  45. package/packages/orq-rc/src/funcs/promptSnippetsGet.ts +130 -0
  46. package/packages/orq-rc/src/funcs/promptSnippetsGetByKey.ts +132 -0
  47. package/packages/orq-rc/src/funcs/promptSnippetsList.ts +132 -0
  48. package/packages/orq-rc/src/funcs/promptSnippetsUpdate.ts +139 -0
  49. package/packages/orq-rc/src/funcs/promptsCreate.ts +126 -0
  50. package/packages/orq-rc/src/funcs/promptsDelete.ts +130 -0
  51. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +146 -0
  52. package/packages/orq-rc/src/funcs/promptsList.ts +133 -0
  53. package/packages/orq-rc/src/funcs/promptsListVersions.ts +139 -0
  54. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +132 -0
  55. package/packages/orq-rc/src/funcs/promptsUpdate.ts +138 -0
  56. package/packages/orq-rc/src/funcs/remoteconfigGetConfig.ts +127 -0
  57. package/packages/orq-rc/src/hooks/global.ts +44 -0
  58. package/packages/orq-rc/src/hooks/hooks.ts +132 -0
  59. package/packages/orq-rc/src/hooks/index.ts +6 -0
  60. package/packages/orq-rc/src/hooks/registration.ts +15 -0
  61. package/packages/orq-rc/src/hooks/types.ts +109 -0
  62. package/packages/orq-rc/src/index.ts +7 -0
  63. package/packages/orq-rc/src/lib/base64.ts +37 -0
  64. package/packages/orq-rc/src/lib/config.ts +70 -0
  65. package/packages/orq-rc/src/lib/dlv.ts +53 -0
  66. package/packages/orq-rc/src/lib/encodings.ts +483 -0
  67. package/packages/orq-rc/src/lib/env.ts +73 -0
  68. package/packages/orq-rc/src/lib/event-streams.ts +264 -0
  69. package/packages/orq-rc/src/lib/files.ts +40 -0
  70. package/packages/orq-rc/src/lib/http.ts +323 -0
  71. package/packages/orq-rc/src/lib/is-plain-object.ts +43 -0
  72. package/packages/orq-rc/src/lib/logger.ts +9 -0
  73. package/packages/orq-rc/src/lib/matchers.ts +325 -0
  74. package/packages/orq-rc/src/lib/primitives.ts +136 -0
  75. package/packages/orq-rc/src/lib/retries.ts +218 -0
  76. package/packages/orq-rc/src/lib/schemas.ts +91 -0
  77. package/packages/orq-rc/src/lib/sdks.ts +400 -0
  78. package/packages/orq-rc/src/lib/security.ts +254 -0
  79. package/packages/orq-rc/src/lib/url.ts +33 -0
  80. package/packages/orq-rc/src/models/components/deployments.ts +1666 -0
  81. package/packages/orq-rc/src/models/components/index.ts +6 -0
  82. package/packages/orq-rc/src/models/components/security.ts +71 -0
  83. package/packages/orq-rc/src/models/errors/apierror.ts +27 -0
  84. package/packages/orq-rc/src/models/errors/getpromptversion.ts +71 -0
  85. package/packages/orq-rc/src/models/errors/honoapierror.ts +82 -0
  86. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +62 -0
  87. package/packages/orq-rc/src/models/errors/index.ts +11 -0
  88. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +97 -0
  89. package/packages/orq-rc/src/models/errors/updateprompt.ts +71 -0
  90. package/packages/orq-rc/src/models/errors/updatepromptsnippet.ts +71 -0
  91. package/packages/orq-rc/src/models/operations/createcontact.ts +256 -0
  92. package/packages/orq-rc/src/models/operations/createfeedback.ts +286 -0
  93. package/packages/orq-rc/src/models/operations/createprompt.ts +3819 -0
  94. package/packages/orq-rc/src/models/operations/createpromptsnippet.ts +6239 -0
  95. package/packages/orq-rc/src/models/operations/deleteprompt.ts +69 -0
  96. package/packages/orq-rc/src/models/operations/deletepromptsnippet.ts +69 -0
  97. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +1790 -0
  98. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +3527 -0
  99. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +1144 -0
  100. package/packages/orq-rc/src/models/operations/deployments.ts +2148 -0
  101. package/packages/orq-rc/src/models/operations/deploymentstream.ts +3062 -0
  102. package/packages/orq-rc/src/models/operations/filedelete.ts +78 -0
  103. package/packages/orq-rc/src/models/operations/fileget.ts +222 -0
  104. package/packages/orq-rc/src/models/operations/filelist.ts +321 -0
  105. package/packages/orq-rc/src/models/operations/fileupload.ts +322 -0
  106. package/packages/orq-rc/src/models/operations/findonebykeypromptsnippet.ts +4483 -0
  107. package/packages/orq-rc/src/models/operations/findonepromptsnippet.ts +4343 -0
  108. package/packages/orq-rc/src/models/operations/getallprompts.ts +2116 -0
  109. package/packages/orq-rc/src/models/operations/getallpromptsnippets.ts +4472 -0
  110. package/packages/orq-rc/src/models/operations/getoneprompt.ts +1982 -0
  111. package/packages/orq-rc/src/models/operations/getpromptversion.ts +2012 -0
  112. package/packages/orq-rc/src/models/operations/index.ts +29 -0
  113. package/packages/orq-rc/src/models/operations/listpromptversions.ts +2146 -0
  114. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +190 -0
  115. package/packages/orq-rc/src/models/operations/updateprompt.ts +3917 -0
  116. package/packages/orq-rc/src/models/operations/updatepromptsnippet.ts +6544 -0
  117. package/packages/orq-rc/src/sdk/contacts.ts +27 -0
  118. package/packages/orq-rc/src/sdk/deployments.ts +89 -0
  119. package/packages/orq-rc/src/sdk/feedback.ts +27 -0
  120. package/packages/orq-rc/src/sdk/files.ts +72 -0
  121. package/packages/orq-rc/src/sdk/index.ts +5 -0
  122. package/packages/orq-rc/src/sdk/metrics.ts +27 -0
  123. package/packages/orq-rc/src/sdk/prompts.ts +126 -0
  124. package/packages/orq-rc/src/sdk/promptsnippets.ts +99 -0
  125. package/packages/orq-rc/src/sdk/remoteconfig.ts +24 -0
  126. package/packages/orq-rc/src/sdk/sdk.ts +49 -0
  127. package/packages/orq-rc/src/types/blobs.ts +31 -0
  128. package/packages/orq-rc/src/types/constdatetime.ts +15 -0
  129. package/packages/orq-rc/src/types/enums.ts +16 -0
  130. package/packages/orq-rc/src/types/fp.ts +50 -0
  131. package/packages/orq-rc/src/types/index.ts +11 -0
  132. package/packages/orq-rc/src/types/operations.ts +105 -0
  133. package/packages/orq-rc/src/types/rfcdate.ts +54 -0
  134. package/packages/orq-rc/src/types/streams.ts +21 -0
  135. package/packages/orq-rc/tsconfig.json +41 -0
  136. package/src/lib/config.ts +2 -2
  137. package/src/models/operations/createcontact.ts +2 -2
  138. package/src/models/operations/createpromptsnippet.ts +2 -2
  139. package/src/models/operations/fileget.ts +2 -2
  140. package/src/models/operations/filelist.ts +2 -2
  141. package/src/models/operations/fileupload.ts +2 -2
  142. package/src/models/operations/findonebykeypromptsnippet.ts +2 -2
  143. package/src/models/operations/findonepromptsnippet.ts +2 -2
  144. package/src/models/operations/getallpromptsnippets.ts +2 -2
  145. package/src/models/operations/updatepromptsnippet.ts +2 -2
@@ -0,0 +1,316 @@
1
+ # Deployments
2
+ (*deployments*)
3
+
4
+ ## Overview
5
+
6
+ ### Available Operations
7
+
8
+ * [list](#list) - List all deployments
9
+ * [getConfig](#getconfig) - Get config
10
+ * [invoke](#invoke) - Invoke
11
+ * [stream](#stream) - Stream
12
+
13
+ ## list
14
+
15
+ Returns a list of your deployments. The deployments are returned sorted by creation date, with the most recent deployments appearing first.
16
+
17
+ ### Example Usage
18
+
19
+ ```typescript
20
+ import { Orq } from "@orq-ai/node";
21
+
22
+ const orq = new Orq({
23
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
24
+ });
25
+
26
+ async function run() {
27
+ const result = await orq.deployments.list({});
28
+
29
+ // Handle the result
30
+ console.log(result);
31
+ }
32
+
33
+ run();
34
+ ```
35
+
36
+ ### Standalone function
37
+
38
+ The standalone function version of this method:
39
+
40
+ ```typescript
41
+ import { OrqCore } from "@orq-ai/node/core.js";
42
+ import { deploymentsList } from "@orq-ai/node/funcs/deploymentsList.js";
43
+
44
+ // Use `OrqCore` for best tree-shaking performance.
45
+ // You can create one instance of it to use across an application.
46
+ const orq = new OrqCore({
47
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
48
+ });
49
+
50
+ async function run() {
51
+ const res = await deploymentsList(orq, {});
52
+
53
+ if (!res.ok) {
54
+ throw res.error;
55
+ }
56
+
57
+ const { value: result } = res;
58
+
59
+ // Handle the result
60
+ console.log(result);
61
+ }
62
+
63
+ run();
64
+ ```
65
+
66
+ ### Parameters
67
+
68
+ | Parameter | Type | Required | Description |
69
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
70
+ | `request` | [operations.DeploymentsRequest](../../models/operations/deploymentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
71
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
72
+ | `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. |
73
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
74
+
75
+ ### Response
76
+
77
+ **Promise\<[operations.DeploymentsResponseBody](../../models/operations/deploymentsresponsebody.md)\>**
78
+
79
+ ### Errors
80
+
81
+ | Error Type | Status Code | Content Type |
82
+ | ------------------- | ------------------- | ------------------- |
83
+ | errors.HonoApiError | 500 | application/json |
84
+ | errors.APIError | 4XX, 5XX | \*/\* |
85
+
86
+ ## getConfig
87
+
88
+ Retrieve the deployment configuration
89
+
90
+ ### Example Usage
91
+
92
+ ```typescript
93
+ import { Orq } from "@orq-ai/node";
94
+
95
+ const orq = new Orq({
96
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
97
+ });
98
+
99
+ async function run() {
100
+ const result = await orq.deployments.getConfig({
101
+ key: "<key>",
102
+ });
103
+
104
+ // Handle the result
105
+ console.log(result);
106
+ }
107
+
108
+ run();
109
+ ```
110
+
111
+ ### Standalone function
112
+
113
+ The standalone function version of this method:
114
+
115
+ ```typescript
116
+ import { OrqCore } from "@orq-ai/node/core.js";
117
+ import { deploymentsGetConfig } from "@orq-ai/node/funcs/deploymentsGetConfig.js";
118
+
119
+ // Use `OrqCore` for best tree-shaking performance.
120
+ // You can create one instance of it to use across an application.
121
+ const orq = new OrqCore({
122
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
123
+ });
124
+
125
+ async function run() {
126
+ const res = await deploymentsGetConfig(orq, {
127
+ key: "<key>",
128
+ });
129
+
130
+ if (!res.ok) {
131
+ throw res.error;
132
+ }
133
+
134
+ const { value: result } = res;
135
+
136
+ // Handle the result
137
+ console.log(result);
138
+ }
139
+
140
+ run();
141
+ ```
142
+
143
+ ### Parameters
144
+
145
+ | Parameter | Type | Required | Description |
146
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
147
+ | `request` | [operations.DeploymentGetConfigRequestBody](../../models/operations/deploymentgetconfigrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
148
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
149
+ | `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. |
150
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
151
+
152
+ ### Response
153
+
154
+ **Promise\<[operations.DeploymentGetConfigResponseBody](../../models/operations/deploymentgetconfigresponsebody.md)\>**
155
+
156
+ ### Errors
157
+
158
+ | Error Type | Status Code | Content Type |
159
+ | --------------- | --------------- | --------------- |
160
+ | errors.APIError | 4XX, 5XX | \*/\* |
161
+
162
+ ## invoke
163
+
164
+ Invoke a deployment with a given payload
165
+
166
+ ### Example Usage
167
+
168
+ ```typescript
169
+ import { Orq } from "@orq-ai/node";
170
+
171
+ const orq = new Orq({
172
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
173
+ });
174
+
175
+ async function run() {
176
+ const result = await orq.deployments.invoke({
177
+ key: "<key>",
178
+ });
179
+
180
+ // Handle the result
181
+ console.log(result);
182
+ }
183
+
184
+ run();
185
+ ```
186
+
187
+ ### Standalone function
188
+
189
+ The standalone function version of this method:
190
+
191
+ ```typescript
192
+ import { OrqCore } from "@orq-ai/node/core.js";
193
+ import { deploymentsInvoke } from "@orq-ai/node/funcs/deploymentsInvoke.js";
194
+
195
+ // Use `OrqCore` for best tree-shaking performance.
196
+ // You can create one instance of it to use across an application.
197
+ const orq = new OrqCore({
198
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
199
+ });
200
+
201
+ async function run() {
202
+ const res = await deploymentsInvoke(orq, {
203
+ key: "<key>",
204
+ });
205
+
206
+ if (!res.ok) {
207
+ throw res.error;
208
+ }
209
+
210
+ const { value: result } = res;
211
+
212
+ // Handle the result
213
+ console.log(result);
214
+ }
215
+
216
+ run();
217
+ ```
218
+
219
+ ### Parameters
220
+
221
+ | Parameter | Type | Required | Description |
222
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
223
+ | `request` | [components.Deployments](../../models/components/deployments.md) | :heavy_check_mark: | The request object to use for the request. |
224
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
225
+ | `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. |
226
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
227
+
228
+ ### Response
229
+
230
+ **Promise\<[operations.DeploymentInvokeResponseBody](../../models/operations/deploymentinvokeresponsebody.md)\>**
231
+
232
+ ### Errors
233
+
234
+ | Error Type | Status Code | Content Type |
235
+ | --------------- | --------------- | --------------- |
236
+ | errors.APIError | 4XX, 5XX | \*/\* |
237
+
238
+ ## stream
239
+
240
+ Stream deployment generation. Only supported for completions and chat completions.
241
+
242
+ ### Example Usage
243
+
244
+ ```typescript
245
+ import { Orq } from "@orq-ai/node";
246
+
247
+ const orq = new Orq({
248
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
249
+ });
250
+
251
+ async function run() {
252
+ const result = await orq.deployments.stream({
253
+ key: "<key>",
254
+ });
255
+
256
+ for await (const event of result) {
257
+ // Handle the event
258
+ console.log(event);
259
+ }
260
+ }
261
+
262
+ run();
263
+ ```
264
+
265
+ ### Standalone function
266
+
267
+ The standalone function version of this method:
268
+
269
+ ```typescript
270
+ import { OrqCore } from "@orq-ai/node/core.js";
271
+ import { deploymentsStream } from "@orq-ai/node/funcs/deploymentsStream.js";
272
+
273
+ // Use `OrqCore` for best tree-shaking performance.
274
+ // You can create one instance of it to use across an application.
275
+ const orq = new OrqCore({
276
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
277
+ });
278
+
279
+ async function run() {
280
+ const res = await deploymentsStream(orq, {
281
+ key: "<key>",
282
+ });
283
+
284
+ if (!res.ok) {
285
+ throw res.error;
286
+ }
287
+
288
+ const { value: result } = res;
289
+
290
+ for await (const event of result) {
291
+ // Handle the event
292
+ console.log(event);
293
+ }
294
+ }
295
+
296
+ run();
297
+ ```
298
+
299
+ ### Parameters
300
+
301
+ | Parameter | Type | Required | Description |
302
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
303
+ | `request` | [operations.DeploymentStreamRequestBody](../../models/operations/deploymentstreamrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
304
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
305
+ | `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. |
306
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
307
+
308
+ ### Response
309
+
310
+ **Promise\<[EventStream<operations.DeploymentStreamResponseBody>](../../models/.md)\>**
311
+
312
+ ### Errors
313
+
314
+ | Error Type | Status Code | Content Type |
315
+ | --------------- | --------------- | --------------- |
316
+ | errors.APIError | 4XX, 5XX | \*/\* |
@@ -0,0 +1,92 @@
1
+ # Feedback
2
+ (*feedback*)
3
+
4
+ ## Overview
5
+
6
+ ### Available Operations
7
+
8
+ * [create](#create) - Submit feedback
9
+
10
+ ## create
11
+
12
+ Submit feedback for the LLM transaction via the API
13
+
14
+ ### Example Usage
15
+
16
+ ```typescript
17
+ import { Orq } from "@orq-ai/node";
18
+
19
+ const orq = new Orq({
20
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
21
+ });
22
+
23
+ async function run() {
24
+ const result = await orq.feedback.create({
25
+ field: "rating",
26
+ value: [
27
+ "good",
28
+ ],
29
+ traceId: "67HTZ65Z9W91HSF51CW68KK1QH",
30
+ });
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 { feedbackCreate } from "@orq-ai/node/funcs/feedbackCreate.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 feedbackCreate(orq, {
55
+ field: "rating",
56
+ value: [
57
+ "good",
58
+ ],
59
+ traceId: "67HTZ65Z9W91HSF51CW68KK1QH",
60
+ });
61
+
62
+ if (!res.ok) {
63
+ throw res.error;
64
+ }
65
+
66
+ const { value: result } = res;
67
+
68
+ // Handle the result
69
+ console.log(result);
70
+ }
71
+
72
+ run();
73
+ ```
74
+
75
+ ### Parameters
76
+
77
+ | Parameter | Type | Required | Description |
78
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
79
+ | `request` | [operations.CreateFeedbackRequestBody](../../models/operations/createfeedbackrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
80
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
81
+ | `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. |
82
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
83
+
84
+ ### Response
85
+
86
+ **Promise\<[operations.CreateFeedbackResponseBody](../../models/operations/createfeedbackresponsebody.md)\>**
87
+
88
+ ### Errors
89
+
90
+ | Error Type | Status Code | Content Type |
91
+ | --------------- | --------------- | --------------- |
92
+ | errors.APIError | 4XX, 5XX | \*/\* |