@orq-ai/node 1.32.0-rc.5 → 1.32.0-rc.6
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.
- package/README.md +30 -0
- package/docs/sdks/prompt/README.md +6 -0
- package/docs/sdks/prompts/README.md +533 -0
- package/docs/sdks/snippets/README.md +84 -0
- package/docs/sdks/templates/README.md +80 -0
- package/funcs/promptSnippetsFindOne.d.ts +12 -0
- package/funcs/promptSnippetsFindOne.d.ts.map +1 -0
- package/funcs/promptSnippetsFindOne.js +108 -0
- package/funcs/promptSnippetsFindOne.js.map +1 -0
- package/funcs/promptTemplatesGetAll.d.ts +12 -0
- package/funcs/promptTemplatesGetAll.d.ts.map +1 -0
- package/funcs/promptTemplatesGetAll.js +108 -0
- package/funcs/promptTemplatesGetAll.js.map +1 -0
- package/funcs/promptsCreate.d.ts +12 -0
- package/funcs/promptsCreate.d.ts.map +1 -0
- package/funcs/promptsCreate.js +105 -0
- package/funcs/promptsCreate.js.map +1 -0
- package/funcs/promptsCreateVersion.d.ts +12 -0
- package/funcs/promptsCreateVersion.d.ts.map +1 -0
- package/funcs/promptsCreateVersion.js +109 -0
- package/funcs/promptsCreateVersion.js.map +1 -0
- package/funcs/promptsDelete.d.ts +12 -0
- package/funcs/promptsDelete.d.ts.map +1 -0
- package/funcs/promptsDelete.js +109 -0
- package/funcs/promptsDelete.js.map +1 -0
- package/funcs/promptsDuplicate.d.ts +12 -0
- package/funcs/promptsDuplicate.d.ts.map +1 -0
- package/funcs/promptsDuplicate.js +109 -0
- package/funcs/promptsDuplicate.js.map +1 -0
- package/funcs/promptsGetAll.d.ts +12 -0
- package/funcs/promptsGetAll.d.ts.map +1 -0
- package/funcs/promptsGetAll.js +108 -0
- package/funcs/promptsGetAll.js.map +1 -0
- package/funcs/promptsGetOne.d.ts +12 -0
- package/funcs/promptsGetOne.d.ts.map +1 -0
- package/funcs/promptsGetOne.js +109 -0
- package/funcs/promptsGetOne.js.map +1 -0
- package/funcs/promptsUpdate.d.ts +13 -0
- package/funcs/promptsUpdate.d.ts.map +1 -0
- package/funcs/promptsUpdate.js +113 -0
- package/funcs/promptsUpdate.js.map +1 -0
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/updateprompt.d.ts +36 -0
- package/models/errors/updateprompt.d.ts.map +1 -0
- package/models/errors/updateprompt.js +79 -0
- package/models/errors/updateprompt.js.map +1 -0
- package/models/operations/bulkfileupload.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createprompt.d.ts +2035 -0
- package/models/operations/createprompt.d.ts.map +1 -0
- package/models/operations/createprompt.js +1853 -0
- package/models/operations/createprompt.js.map +1 -0
- package/models/operations/createpromptversion.d.ts +2001 -0
- package/models/operations/createpromptversion.d.ts.map +1 -0
- package/models/operations/createpromptversion.js +1848 -0
- package/models/operations/createpromptversion.js.map +1 -0
- package/models/operations/deleteprompt.d.ts +32 -0
- package/models/operations/deleteprompt.d.ts.map +1 -0
- package/models/operations/deleteprompt.js +69 -0
- package/models/operations/deleteprompt.js.map +1 -0
- package/models/operations/deploymentgetconfig.d.ts +96 -96
- package/models/operations/deploymentgetconfig.d.ts.map +1 -1
- package/models/operations/deploymentgetconfig.js +136 -135
- package/models/operations/deploymentgetconfig.js.map +1 -1
- package/models/operations/deploymentinvoke.d.ts +46 -49
- package/models/operations/deploymentinvoke.d.ts.map +1 -1
- package/models/operations/deploymentinvoke.js +61 -63
- package/models/operations/deploymentinvoke.js.map +1 -1
- package/models/operations/deployments.d.ts +53 -53
- package/models/operations/deployments.d.ts.map +1 -1
- package/models/operations/deployments.js +66 -67
- package/models/operations/deployments.js.map +1 -1
- package/models/operations/duplicateprompt.d.ts +32 -0
- package/models/operations/duplicateprompt.d.ts.map +1 -0
- package/models/operations/duplicateprompt.js +69 -0
- package/models/operations/duplicateprompt.js.map +1 -0
- package/models/operations/fileupload.js +2 -2
- package/models/operations/findonepromptsnippet.d.ts +6278 -0
- package/models/operations/findonepromptsnippet.d.ts.map +1 -0
- package/models/operations/findonepromptsnippet.js +5891 -0
- package/models/operations/findonepromptsnippet.js.map +1 -0
- package/models/operations/getallprompts.d.ts +6613 -0
- package/models/operations/getallprompts.d.ts.map +1 -0
- package/models/operations/getallprompts.js +6161 -0
- package/models/operations/getallprompts.js.map +1 -0
- package/models/operations/getallprompttemplates.d.ts +6607 -0
- package/models/operations/getallprompttemplates.d.ts.map +1 -0
- package/models/operations/getallprompttemplates.js +6225 -0
- package/models/operations/getallprompttemplates.js.map +1 -0
- package/models/operations/getoneprompt.d.ts +32 -0
- package/models/operations/getoneprompt.d.ts.map +1 -0
- package/models/operations/getoneprompt.js +69 -0
- package/models/operations/getoneprompt.js.map +1 -0
- package/models/operations/index.d.ts +9 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +9 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/updateprompt.d.ts +7251 -0
- package/models/operations/updateprompt.d.ts.map +1 -0
- package/models/operations/updateprompt.js +6678 -0
- package/models/operations/updateprompt.js.map +1 -0
- package/package.json +1 -1
- package/sdk/prompt.d.ts +10 -0
- package/sdk/prompt.d.ts.map +1 -0
- package/sdk/prompt.js +21 -0
- package/sdk/prompt.js.map +1 -0
- package/sdk/prompts.d.ts +33 -0
- package/sdk/prompts.d.ts.map +1 -0
- package/sdk/prompts.js +61 -0
- package/sdk/prompts.js.map +1 -0
- package/sdk/sdk.d.ts +6 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +10 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/snippets.d.ts +9 -0
- package/sdk/snippets.d.ts.map +1 -0
- package/sdk/snippets.js +19 -0
- package/sdk/snippets.js.map +1 -0
- package/sdk/templates.d.ts +9 -0
- package/sdk/templates.d.ts.map +1 -0
- package/sdk/templates.js +19 -0
- package/sdk/templates.js.map +1 -0
- package/src/funcs/promptSnippetsFindOne.ts +128 -0
- package/src/funcs/promptTemplatesGetAll.ts +130 -0
- package/src/funcs/promptsCreate.ts +124 -0
- package/src/funcs/promptsCreateVersion.ts +129 -0
- package/src/funcs/promptsDelete.ts +128 -0
- package/src/funcs/promptsDuplicate.ts +128 -0
- package/src/funcs/promptsGetAll.ts +128 -0
- package/src/funcs/promptsGetOne.ts +128 -0
- package/src/funcs/promptsUpdate.ts +136 -0
- package/src/lib/config.ts +2 -2
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/updateprompt.ts +71 -0
- package/src/models/operations/bulkfileupload.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createprompt.ts +3455 -0
- package/src/models/operations/createpromptversion.ts +3697 -0
- package/src/models/operations/deleteprompt.ts +69 -0
- package/src/models/operations/deploymentgetconfig.ts +255 -188
- package/src/models/operations/deploymentinvoke.ts +95 -81
- package/src/models/operations/deployments.ts +101 -88
- package/src/models/operations/duplicateprompt.ts +69 -0
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/findonepromptsnippet.ts +13629 -0
- package/src/models/operations/getallprompts.ts +13390 -0
- package/src/models/operations/getallprompttemplates.ts +13690 -0
- package/src/models/operations/getoneprompt.ts +69 -0
- package/src/models/operations/index.ts +9 -0
- package/src/models/operations/updateprompt.ts +14407 -0
- package/src/sdk/prompt.ts +19 -0
- package/src/sdk/prompts.ts +114 -0
- package/src/sdk/sdk.ts +12 -0
- package/src/sdk/snippets.ts +24 -0
- package/src/sdk/templates.ts +24 -0
package/README.md
CHANGED
|
@@ -174,6 +174,27 @@ run();
|
|
|
174
174
|
* [bulkUpload](docs/sdks/files/README.md#bulkupload) - Bulk upload file
|
|
175
175
|
|
|
176
176
|
|
|
177
|
+
### [prompt](docs/sdks/prompt/README.md)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
#### [prompt.snippets](docs/sdks/snippets/README.md)
|
|
181
|
+
|
|
182
|
+
* [findOne](docs/sdks/snippets/README.md#findone) - Get one prompt snippet
|
|
183
|
+
|
|
184
|
+
#### [prompt.templates](docs/sdks/templates/README.md)
|
|
185
|
+
|
|
186
|
+
* [getAll](docs/sdks/templates/README.md#getall) - Get all prompt templates
|
|
187
|
+
|
|
188
|
+
### [prompts](docs/sdks/prompts/README.md)
|
|
189
|
+
|
|
190
|
+
* [create](docs/sdks/prompts/README.md#create) - Create a new prompt
|
|
191
|
+
* [createVersion](docs/sdks/prompts/README.md#createversion) - Create a new prompt version
|
|
192
|
+
* [delete](docs/sdks/prompts/README.md#delete) - Delete a prompt
|
|
193
|
+
* [getOne](docs/sdks/prompts/README.md#getone) - Get one prompt
|
|
194
|
+
* [update](docs/sdks/prompts/README.md#update) - Update a prompt
|
|
195
|
+
* [duplicate](docs/sdks/prompts/README.md#duplicate) - Duplicate a prompt
|
|
196
|
+
* [getAll](docs/sdks/prompts/README.md#getall) - Get all prompts
|
|
197
|
+
|
|
177
198
|
### [remoteconfig](docs/sdks/remoteconfig/README.md)
|
|
178
199
|
|
|
179
200
|
* [getConfig](docs/sdks/remoteconfig/README.md#getconfig) - Get Configurations
|
|
@@ -205,6 +226,15 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
|
205
226
|
- [`feedbackCreate`](docs/sdks/feedback/README.md#create) - Submit feedback
|
|
206
227
|
- [`filesBulkUpload`](docs/sdks/files/README.md#bulkupload) - Bulk upload file
|
|
207
228
|
- [`filesUpload`](docs/sdks/files/README.md#upload) - Upload file
|
|
229
|
+
- [`promptsCreate`](docs/sdks/prompts/README.md#create) - Create a new prompt
|
|
230
|
+
- [`promptsCreateVersion`](docs/sdks/prompts/README.md#createversion) - Create a new prompt version
|
|
231
|
+
- [`promptsDelete`](docs/sdks/prompts/README.md#delete) - Delete a prompt
|
|
232
|
+
- [`promptsDuplicate`](docs/sdks/prompts/README.md#duplicate) - Duplicate a prompt
|
|
233
|
+
- [`promptsGetAll`](docs/sdks/prompts/README.md#getall) - Get all prompts
|
|
234
|
+
- [`promptsGetOne`](docs/sdks/prompts/README.md#getone) - Get one prompt
|
|
235
|
+
- [`promptSnippetsFindOne`](docs/sdks/snippets/README.md#findone) - Get one prompt snippet
|
|
236
|
+
- [`promptsUpdate`](docs/sdks/prompts/README.md#update) - Update a prompt
|
|
237
|
+
- [`promptTemplatesGetAll`](docs/sdks/templates/README.md#getall) - Get all prompt templates
|
|
208
238
|
- [`remoteconfigGetConfig`](docs/sdks/remoteconfig/README.md#getconfig) - Get Configurations
|
|
209
239
|
|
|
210
240
|
</details>
|
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
# Prompts
|
|
2
|
+
(*prompts*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [create](#create) - Create a new prompt
|
|
9
|
+
* [createVersion](#createversion) - Create a new prompt version
|
|
10
|
+
* [delete](#delete) - Delete a prompt
|
|
11
|
+
* [getOne](#getone) - Get one prompt
|
|
12
|
+
* [update](#update) - Update a prompt
|
|
13
|
+
* [duplicate](#duplicate) - Duplicate a prompt
|
|
14
|
+
* [getAll](#getall) - Get all prompts
|
|
15
|
+
|
|
16
|
+
## create
|
|
17
|
+
|
|
18
|
+
Create a new prompt
|
|
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.create();
|
|
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 { promptsCreate } from "@orq-ai/node/funcs/promptsCreate.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 promptsCreate(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.CreatePromptRequestBody](../../models/operations/createpromptrequestbody.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.CreatePromptResponseBody](../../models/operations/createpromptresponsebody.md)\>**
|
|
81
|
+
|
|
82
|
+
### Errors
|
|
83
|
+
|
|
84
|
+
| Error Type | Status Code | Content Type |
|
|
85
|
+
| --------------- | --------------- | --------------- |
|
|
86
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
87
|
+
|
|
88
|
+
## createVersion
|
|
89
|
+
|
|
90
|
+
Create a new prompt version
|
|
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.createVersion({
|
|
103
|
+
id: "<id>",
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// Handle the result
|
|
107
|
+
console.log(result);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
run();
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Standalone function
|
|
114
|
+
|
|
115
|
+
The standalone function version of this method:
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
119
|
+
import { promptsCreateVersion } from "@orq-ai/node/funcs/promptsCreateVersion.js";
|
|
120
|
+
|
|
121
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
122
|
+
// You can create one instance of it to use across an application.
|
|
123
|
+
const orq = new OrqCore({
|
|
124
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
async function run() {
|
|
128
|
+
const res = await promptsCreateVersion(orq, {
|
|
129
|
+
id: "<id>",
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
if (!res.ok) {
|
|
133
|
+
throw res.error;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const { value: result } = res;
|
|
137
|
+
|
|
138
|
+
// Handle the result
|
|
139
|
+
console.log(result);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
run();
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Parameters
|
|
146
|
+
|
|
147
|
+
| Parameter | Type | Required | Description |
|
|
148
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
149
|
+
| `request` | [operations.CreatePromptVersionRequest](../../models/operations/createpromptversionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
150
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
151
|
+
| `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. |
|
|
152
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
153
|
+
|
|
154
|
+
### Response
|
|
155
|
+
|
|
156
|
+
**Promise\<[operations.CreatePromptVersionResponseBody](../../models/operations/createpromptversionresponsebody.md)\>**
|
|
157
|
+
|
|
158
|
+
### Errors
|
|
159
|
+
|
|
160
|
+
| Error Type | Status Code | Content Type |
|
|
161
|
+
| --------------- | --------------- | --------------- |
|
|
162
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
163
|
+
|
|
164
|
+
## delete
|
|
165
|
+
|
|
166
|
+
Delete a prompt
|
|
167
|
+
|
|
168
|
+
### Example Usage
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
import { Orq } from "@orq-ai/node";
|
|
172
|
+
|
|
173
|
+
const orq = new Orq({
|
|
174
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
async function run() {
|
|
178
|
+
await orq.prompts.delete({
|
|
179
|
+
id: "<id>",
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
run();
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Standalone function
|
|
189
|
+
|
|
190
|
+
The standalone function version of this method:
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
194
|
+
import { promptsDelete } from "@orq-ai/node/funcs/promptsDelete.js";
|
|
195
|
+
|
|
196
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
197
|
+
// You can create one instance of it to use across an application.
|
|
198
|
+
const orq = new OrqCore({
|
|
199
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
async function run() {
|
|
203
|
+
const res = await promptsDelete(orq, {
|
|
204
|
+
id: "<id>",
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
if (!res.ok) {
|
|
208
|
+
throw res.error;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const { value: result } = res;
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
run();
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Parameters
|
|
220
|
+
|
|
221
|
+
| Parameter | Type | Required | Description |
|
|
222
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
223
|
+
| `request` | [operations.DeletePromptRequest](../../models/operations/deletepromptrequest.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\<void\>**
|
|
231
|
+
|
|
232
|
+
### Errors
|
|
233
|
+
|
|
234
|
+
| Error Type | Status Code | Content Type |
|
|
235
|
+
| --------------- | --------------- | --------------- |
|
|
236
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
237
|
+
|
|
238
|
+
## getOne
|
|
239
|
+
|
|
240
|
+
Get one prompt
|
|
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
|
+
await orq.prompts.getOne({
|
|
253
|
+
id: "<id>",
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
run();
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Standalone function
|
|
263
|
+
|
|
264
|
+
The standalone function version of this method:
|
|
265
|
+
|
|
266
|
+
```typescript
|
|
267
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
268
|
+
import { promptsGetOne } from "@orq-ai/node/funcs/promptsGetOne.js";
|
|
269
|
+
|
|
270
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
271
|
+
// You can create one instance of it to use across an application.
|
|
272
|
+
const orq = new OrqCore({
|
|
273
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
async function run() {
|
|
277
|
+
const res = await promptsGetOne(orq, {
|
|
278
|
+
id: "<id>",
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
if (!res.ok) {
|
|
282
|
+
throw res.error;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const { value: result } = res;
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
run();
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Parameters
|
|
294
|
+
|
|
295
|
+
| Parameter | Type | Required | Description |
|
|
296
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
297
|
+
| `request` | [operations.GetOnePromptRequest](../../models/operations/getonepromptrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
298
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
299
|
+
| `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. |
|
|
300
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
301
|
+
|
|
302
|
+
### Response
|
|
303
|
+
|
|
304
|
+
**Promise\<void\>**
|
|
305
|
+
|
|
306
|
+
### Errors
|
|
307
|
+
|
|
308
|
+
| Error Type | Status Code | Content Type |
|
|
309
|
+
| --------------- | --------------- | --------------- |
|
|
310
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
311
|
+
|
|
312
|
+
## update
|
|
313
|
+
|
|
314
|
+
Update a prompt
|
|
315
|
+
|
|
316
|
+
### Example Usage
|
|
317
|
+
|
|
318
|
+
```typescript
|
|
319
|
+
import { Orq } from "@orq-ai/node";
|
|
320
|
+
|
|
321
|
+
const orq = new Orq({
|
|
322
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
async function run() {
|
|
326
|
+
const result = await orq.prompts.update({
|
|
327
|
+
id: "<id>",
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
// Handle the result
|
|
331
|
+
console.log(result);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
run();
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Standalone function
|
|
338
|
+
|
|
339
|
+
The standalone function version of this method:
|
|
340
|
+
|
|
341
|
+
```typescript
|
|
342
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
343
|
+
import { promptsUpdate } from "@orq-ai/node/funcs/promptsUpdate.js";
|
|
344
|
+
|
|
345
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
346
|
+
// You can create one instance of it to use across an application.
|
|
347
|
+
const orq = new OrqCore({
|
|
348
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
async function run() {
|
|
352
|
+
const res = await promptsUpdate(orq, {
|
|
353
|
+
id: "<id>",
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
if (!res.ok) {
|
|
357
|
+
throw res.error;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const { value: result } = res;
|
|
361
|
+
|
|
362
|
+
// Handle the result
|
|
363
|
+
console.log(result);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
run();
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Parameters
|
|
370
|
+
|
|
371
|
+
| Parameter | Type | Required | Description |
|
|
372
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
373
|
+
| `request` | [operations.UpdatePromptRequest](../../models/operations/updatepromptrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
374
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
375
|
+
| `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. |
|
|
376
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
377
|
+
|
|
378
|
+
### Response
|
|
379
|
+
|
|
380
|
+
**Promise\<[operations.UpdatePromptResponseBody](../../models/operations/updatepromptresponsebody.md)\>**
|
|
381
|
+
|
|
382
|
+
### Errors
|
|
383
|
+
|
|
384
|
+
| Error Type | Status Code | Content Type |
|
|
385
|
+
| ------------------------------- | ------------------------------- | ------------------------------- |
|
|
386
|
+
| errors.UpdatePromptResponseBody | 404 | application/json |
|
|
387
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
388
|
+
|
|
389
|
+
## duplicate
|
|
390
|
+
|
|
391
|
+
Duplicate a prompt
|
|
392
|
+
|
|
393
|
+
### Example Usage
|
|
394
|
+
|
|
395
|
+
```typescript
|
|
396
|
+
import { Orq } from "@orq-ai/node";
|
|
397
|
+
|
|
398
|
+
const orq = new Orq({
|
|
399
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
async function run() {
|
|
403
|
+
await orq.prompts.duplicate({
|
|
404
|
+
id: "<id>",
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
run();
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Standalone function
|
|
414
|
+
|
|
415
|
+
The standalone function version of this method:
|
|
416
|
+
|
|
417
|
+
```typescript
|
|
418
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
419
|
+
import { promptsDuplicate } from "@orq-ai/node/funcs/promptsDuplicate.js";
|
|
420
|
+
|
|
421
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
422
|
+
// You can create one instance of it to use across an application.
|
|
423
|
+
const orq = new OrqCore({
|
|
424
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
async function run() {
|
|
428
|
+
const res = await promptsDuplicate(orq, {
|
|
429
|
+
id: "<id>",
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
if (!res.ok) {
|
|
433
|
+
throw res.error;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
const { value: result } = res;
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
run();
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### Parameters
|
|
445
|
+
|
|
446
|
+
| Parameter | Type | Required | Description |
|
|
447
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
448
|
+
| `request` | [operations.DuplicatePromptRequest](../../models/operations/duplicatepromptrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
449
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
450
|
+
| `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. |
|
|
451
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
452
|
+
|
|
453
|
+
### Response
|
|
454
|
+
|
|
455
|
+
**Promise\<void\>**
|
|
456
|
+
|
|
457
|
+
### Errors
|
|
458
|
+
|
|
459
|
+
| Error Type | Status Code | Content Type |
|
|
460
|
+
| --------------- | --------------- | --------------- |
|
|
461
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
462
|
+
|
|
463
|
+
## getAll
|
|
464
|
+
|
|
465
|
+
Get all prompts
|
|
466
|
+
|
|
467
|
+
### Example Usage
|
|
468
|
+
|
|
469
|
+
```typescript
|
|
470
|
+
import { Orq } from "@orq-ai/node";
|
|
471
|
+
|
|
472
|
+
const orq = new Orq({
|
|
473
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
async function run() {
|
|
477
|
+
const result = await orq.prompts.getAll();
|
|
478
|
+
|
|
479
|
+
// Handle the result
|
|
480
|
+
console.log(result);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
run();
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
### Standalone function
|
|
487
|
+
|
|
488
|
+
The standalone function version of this method:
|
|
489
|
+
|
|
490
|
+
```typescript
|
|
491
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
492
|
+
import { promptsGetAll } from "@orq-ai/node/funcs/promptsGetAll.js";
|
|
493
|
+
|
|
494
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
495
|
+
// You can create one instance of it to use across an application.
|
|
496
|
+
const orq = new OrqCore({
|
|
497
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
async function run() {
|
|
501
|
+
const res = await promptsGetAll(orq);
|
|
502
|
+
|
|
503
|
+
if (!res.ok) {
|
|
504
|
+
throw res.error;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
const { value: result } = res;
|
|
508
|
+
|
|
509
|
+
// Handle the result
|
|
510
|
+
console.log(result);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
run();
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
### Parameters
|
|
517
|
+
|
|
518
|
+
| Parameter | Type | Required | Description |
|
|
519
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
520
|
+
| `request` | [operations.GetAllPromptsRequest](../../models/operations/getallpromptsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
521
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
522
|
+
| `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. |
|
|
523
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
524
|
+
|
|
525
|
+
### Response
|
|
526
|
+
|
|
527
|
+
**Promise\<[operations.GetAllPromptsResponseBody](../../models/operations/getallpromptsresponsebody.md)\>**
|
|
528
|
+
|
|
529
|
+
### Errors
|
|
530
|
+
|
|
531
|
+
| Error Type | Status Code | Content Type |
|
|
532
|
+
| --------------- | --------------- | --------------- |
|
|
533
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|