@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,316 +0,0 @@
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 | \*/\* |
@@ -1,92 +0,0 @@
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 | \*/\* |