@orq-ai/node 3.11.7 → 3.11.9
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/bin/mcp-server.js +104 -104
- package/bin/mcp-server.js.map +26 -26
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +2 -2
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +16 -16
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +2 -2
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +2 -2
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updatedatapoint.js +2 -2
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +16 -16
- package/package.json +1 -1
- package/packages/orq-rc/README.md +128 -87
- package/packages/orq-rc/docs/sdks/batches/README.md +307 -0
- package/packages/orq-rc/docs/sdks/knowledge/README.md +1 -1
- package/packages/orq-rc/docs/sdks/proxy/README.md +1284 -0
- package/packages/orq-rc/examples/package-lock.json +1 -1
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/batchesCancel.ts +166 -0
- package/packages/orq-rc/src/funcs/batchesCreate.ts +160 -0
- package/packages/orq-rc/src/funcs/batchesList.ts +165 -0
- package/packages/orq-rc/src/funcs/batchesRetrieve.ts +166 -0
- package/packages/orq-rc/src/funcs/knowledgeSearch.ts +1 -1
- package/packages/orq-rc/src/funcs/proxyAudioSpeech.ts +159 -0
- package/packages/orq-rc/src/funcs/proxyAudioTranscriptions.ts +233 -0
- package/packages/orq-rc/src/funcs/proxyAudioTranslations.ts +223 -0
- package/packages/orq-rc/src/funcs/proxyChatCompletions.ts +172 -0
- package/packages/orq-rc/src/funcs/proxyCompletions.ts +168 -0
- package/packages/orq-rc/src/funcs/proxyEmbeddings.ts +161 -0
- package/packages/orq-rc/src/funcs/proxyImagesEdit.ts +173 -0
- package/packages/orq-rc/src/funcs/proxyImagesGenerate.ts +163 -0
- package/packages/orq-rc/src/funcs/proxyImagesVariation.ts +179 -0
- package/packages/orq-rc/src/funcs/proxyModerations.ts +164 -0
- package/packages/orq-rc/src/funcs/proxyRerank.ts +158 -0
- package/packages/orq-rc/src/funcs/proxyResponsesCreate.ts +171 -0
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +33 -1
- package/packages/orq-rc/src/mcp-server/tools/batchesCancel.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/batchesCreate.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/batchesList.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/batchesRetrieve.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +1 -1
- package/packages/orq-rc/src/mcp-server/tools/proxyAudioSpeech.ts +33 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyAudioTranscriptions.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyAudioTranslations.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyChatCompletions.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyCompletions.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyEmbeddings.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyImagesEdit.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyImagesGenerate.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyImagesVariation.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyModerations.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyRerank.ts +36 -0
- package/packages/orq-rc/src/mcp-server/tools/proxyResponsesCreate.ts +37 -0
- package/packages/orq-rc/src/models/components/deployments.ts +861 -0
- package/packages/orq-rc/src/models/components/index.ts +1 -0
- package/packages/orq-rc/src/models/components/publiccontact.ts +114 -0
- package/packages/orq-rc/src/models/errors/index.ts +3 -0
- package/packages/orq-rc/src/models/errors/postv2proxyaudiotranscriptions.ts +163 -0
- package/packages/orq-rc/src/models/errors/postv2proxyaudiotranslations.ts +162 -0
- package/packages/orq-rc/src/models/errors/postv2proxymoderations.ts +151 -0
- package/packages/orq-rc/src/models/operations/cancelbatch.ts +474 -0
- package/packages/orq-rc/src/models/operations/createbatch.ts +531 -0
- package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/createchatcompletion.ts +11697 -0
- package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2205 -1224
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
- package/packages/orq-rc/src/models/operations/createresponse.ts +6908 -0
- package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +2282 -1214
- package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +938 -51
- package/packages/orq-rc/src/models/operations/deploymentstream.ts +1471 -305
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/getevals.ts +107 -92
- package/packages/orq-rc/src/models/operations/index.ts +16 -0
- package/packages/orq-rc/src/models/operations/listbatches.ts +570 -0
- package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +498 -2
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
- package/packages/orq-rc/src/models/operations/postv2proxyaudiospeech.ts +393 -0
- package/packages/orq-rc/src/models/operations/postv2proxyaudiotranscriptions.ts +731 -0
- package/packages/orq-rc/src/models/operations/postv2proxyaudiotranslations.ts +741 -0
- package/packages/orq-rc/src/models/operations/postv2proxycompletions.ts +5831 -0
- package/packages/orq-rc/src/models/operations/postv2proxyembeddings.ts +878 -0
- package/packages/orq-rc/src/models/operations/postv2proxyimagesedits.ts +596 -0
- package/packages/orq-rc/src/models/operations/postv2proxyimagesgenerations.ts +1107 -0
- package/packages/orq-rc/src/models/operations/postv2proxyimagesvariations.ts +592 -0
- package/packages/orq-rc/src/models/operations/postv2proxymoderations.ts +802 -0
- package/packages/orq-rc/src/models/operations/postv2proxyrerank.ts +526 -0
- package/packages/orq-rc/src/models/operations/retrievebatch.ts +474 -0
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +478 -2
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +974 -2
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
- package/packages/orq-rc/src/sdk/batches.ts +81 -0
- package/packages/orq-rc/src/sdk/knowledge.ts +1 -1
- package/packages/orq-rc/src/sdk/proxy.ts +211 -0
- package/packages/orq-rc/src/sdk/sdk.ts +12 -0
- package/packages/orq-rc/temp/example.ts +5 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +2 -2
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +16 -16
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +2 -2
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +2 -2
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +16 -16
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
# Batches
|
|
2
|
+
(*batches*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [create](#create) - Create Batch
|
|
9
|
+
* [list](#list) - List Batch
|
|
10
|
+
* [retrieve](#retrieve) - Retrieve Batch
|
|
11
|
+
* [cancel](#cancel) - Cancel Batch
|
|
12
|
+
|
|
13
|
+
## create
|
|
14
|
+
|
|
15
|
+
Creates and executes a batch from an uploaded file of requests
|
|
16
|
+
|
|
17
|
+
### Example Usage
|
|
18
|
+
|
|
19
|
+
<!-- UsageSnippet language="typescript" operationID="CreateBatch" method="post" path="/v2/proxy/batch" -->
|
|
20
|
+
```typescript
|
|
21
|
+
import { Orq } from "@orq-ai/node";
|
|
22
|
+
|
|
23
|
+
const orq = new Orq({
|
|
24
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
async function run() {
|
|
28
|
+
const result = await orq.batches.create({
|
|
29
|
+
inputFileId: "<id>",
|
|
30
|
+
endpoint: "<value>",
|
|
31
|
+
completionWindow: "24h",
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
console.log(result);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
run();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Standalone function
|
|
41
|
+
|
|
42
|
+
The standalone function version of this method:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
46
|
+
import { batchesCreate } from "@orq-ai/node/funcs/batchesCreate.js";
|
|
47
|
+
|
|
48
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
49
|
+
// You can create one instance of it to use across an application.
|
|
50
|
+
const orq = new OrqCore({
|
|
51
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
async function run() {
|
|
55
|
+
const res = await batchesCreate(orq, {
|
|
56
|
+
inputFileId: "<id>",
|
|
57
|
+
endpoint: "<value>",
|
|
58
|
+
completionWindow: "24h",
|
|
59
|
+
});
|
|
60
|
+
if (res.ok) {
|
|
61
|
+
const { value: result } = res;
|
|
62
|
+
console.log(result);
|
|
63
|
+
} else {
|
|
64
|
+
console.log("batchesCreate failed:", res.error);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
run();
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Parameters
|
|
72
|
+
|
|
73
|
+
| Parameter | Type | Required | Description |
|
|
74
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
75
|
+
| `request` | [operations.CreateBatchRequestBody](../../models/operations/createbatchrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
76
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
77
|
+
| `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. |
|
|
78
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
79
|
+
|
|
80
|
+
### Response
|
|
81
|
+
|
|
82
|
+
**Promise\<[operations.CreateBatchResponseBody](../../models/operations/createbatchresponsebody.md)\>**
|
|
83
|
+
|
|
84
|
+
### Errors
|
|
85
|
+
|
|
86
|
+
| Error Type | Status Code | Content Type |
|
|
87
|
+
| --------------- | --------------- | --------------- |
|
|
88
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
89
|
+
|
|
90
|
+
## list
|
|
91
|
+
|
|
92
|
+
List your workspace's batches.
|
|
93
|
+
|
|
94
|
+
### Example Usage
|
|
95
|
+
|
|
96
|
+
<!-- UsageSnippet language="typescript" operationID="ListBatches" method="get" path="/v2/proxy/batch" -->
|
|
97
|
+
```typescript
|
|
98
|
+
import { Orq } from "@orq-ai/node";
|
|
99
|
+
|
|
100
|
+
const orq = new Orq({
|
|
101
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
async function run() {
|
|
105
|
+
const result = await orq.batches.list({
|
|
106
|
+
after: "<value>",
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
console.log(result);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
run();
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Standalone function
|
|
116
|
+
|
|
117
|
+
The standalone function version of this method:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
121
|
+
import { batchesList } from "@orq-ai/node/funcs/batchesList.js";
|
|
122
|
+
|
|
123
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
124
|
+
// You can create one instance of it to use across an application.
|
|
125
|
+
const orq = new OrqCore({
|
|
126
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
async function run() {
|
|
130
|
+
const res = await batchesList(orq, {
|
|
131
|
+
after: "<value>",
|
|
132
|
+
});
|
|
133
|
+
if (res.ok) {
|
|
134
|
+
const { value: result } = res;
|
|
135
|
+
console.log(result);
|
|
136
|
+
} else {
|
|
137
|
+
console.log("batchesList failed:", res.error);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
run();
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Parameters
|
|
145
|
+
|
|
146
|
+
| Parameter | Type | Required | Description |
|
|
147
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
148
|
+
| `request` | [operations.ListBatchesRequest](../../models/operations/listbatchesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
149
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
150
|
+
| `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. |
|
|
151
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
152
|
+
|
|
153
|
+
### Response
|
|
154
|
+
|
|
155
|
+
**Promise\<[operations.ListBatchesResponseBody](../../models/operations/listbatchesresponsebody.md)\>**
|
|
156
|
+
|
|
157
|
+
### Errors
|
|
158
|
+
|
|
159
|
+
| Error Type | Status Code | Content Type |
|
|
160
|
+
| --------------- | --------------- | --------------- |
|
|
161
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
162
|
+
|
|
163
|
+
## retrieve
|
|
164
|
+
|
|
165
|
+
Retrieve a batch by ID.
|
|
166
|
+
|
|
167
|
+
### Example Usage
|
|
168
|
+
|
|
169
|
+
<!-- UsageSnippet language="typescript" operationID="RetrieveBatch" method="get" path="/v2/proxy/batch/{batch_id}" -->
|
|
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
|
+
const result = await orq.batches.retrieve({
|
|
179
|
+
batchId: "<id>",
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
console.log(result);
|
|
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 { batchesRetrieve } from "@orq-ai/node/funcs/batchesRetrieve.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 batchesRetrieve(orq, {
|
|
204
|
+
batchId: "<id>",
|
|
205
|
+
});
|
|
206
|
+
if (res.ok) {
|
|
207
|
+
const { value: result } = res;
|
|
208
|
+
console.log(result);
|
|
209
|
+
} else {
|
|
210
|
+
console.log("batchesRetrieve failed:", res.error);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
run();
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Parameters
|
|
218
|
+
|
|
219
|
+
| Parameter | Type | Required | Description |
|
|
220
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
221
|
+
| `request` | [operations.RetrieveBatchRequest](../../models/operations/retrievebatchrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
222
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
223
|
+
| `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. |
|
|
224
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
225
|
+
|
|
226
|
+
### Response
|
|
227
|
+
|
|
228
|
+
**Promise\<[operations.RetrieveBatchResponseBody](../../models/operations/retrievebatchresponsebody.md)\>**
|
|
229
|
+
|
|
230
|
+
### Errors
|
|
231
|
+
|
|
232
|
+
| Error Type | Status Code | Content Type |
|
|
233
|
+
| --------------- | --------------- | --------------- |
|
|
234
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
235
|
+
|
|
236
|
+
## cancel
|
|
237
|
+
|
|
238
|
+
Cancel a batch by ID.
|
|
239
|
+
|
|
240
|
+
### Example Usage
|
|
241
|
+
|
|
242
|
+
<!-- UsageSnippet language="typescript" operationID="CancelBatch" method="post" path="/v2/proxy/batch/{batch_id}/cancel" -->
|
|
243
|
+
```typescript
|
|
244
|
+
import { Orq } from "@orq-ai/node";
|
|
245
|
+
|
|
246
|
+
const orq = new Orq({
|
|
247
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
async function run() {
|
|
251
|
+
const result = await orq.batches.cancel({
|
|
252
|
+
batchId: "<id>",
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
console.log(result);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
run();
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Standalone function
|
|
262
|
+
|
|
263
|
+
The standalone function version of this method:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
267
|
+
import { batchesCancel } from "@orq-ai/node/funcs/batchesCancel.js";
|
|
268
|
+
|
|
269
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
270
|
+
// You can create one instance of it to use across an application.
|
|
271
|
+
const orq = new OrqCore({
|
|
272
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
async function run() {
|
|
276
|
+
const res = await batchesCancel(orq, {
|
|
277
|
+
batchId: "<id>",
|
|
278
|
+
});
|
|
279
|
+
if (res.ok) {
|
|
280
|
+
const { value: result } = res;
|
|
281
|
+
console.log(result);
|
|
282
|
+
} else {
|
|
283
|
+
console.log("batchesCancel failed:", res.error);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
run();
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Parameters
|
|
291
|
+
|
|
292
|
+
| Parameter | Type | Required | Description |
|
|
293
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
294
|
+
| `request` | [operations.CancelBatchRequest](../../models/operations/cancelbatchrequest.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.CancelBatchResponseBody](../../models/operations/cancelbatchresponsebody.md)\>**
|
|
302
|
+
|
|
303
|
+
### Errors
|
|
304
|
+
|
|
305
|
+
| Error Type | Status Code | Content Type |
|
|
306
|
+
| --------------- | --------------- | --------------- |
|
|
307
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
@@ -395,7 +395,7 @@ run();
|
|
|
395
395
|
|
|
396
396
|
## search
|
|
397
397
|
|
|
398
|
-
Search a Knowledge Base and return the most similar chunks, along with their search and rerank scores.
|
|
398
|
+
Search a Knowledge Base and return the most similar chunks, along with their search and rerank scores. Note that all configuration changes made in the API will override the settings in the UI.
|
|
399
399
|
|
|
400
400
|
### Example Usage
|
|
401
401
|
|