@orq-ai/node 3.13.2 → 3.13.4
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 +216 -246
- package/bin/mcp-server.js.map +42 -42
- package/docs/sdks/agents/README.md +3 -3
- package/examples/package-lock.json +1 -1
- package/funcs/agentsRetrieveTask.js +2 -2
- package/funcs/agentsRetrieveTask.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/operations/createbudget.js +2 -2
- 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 +28 -28
- package/models/operations/createtool.js +14 -14
- package/models/operations/duplicatetool.js +10 -10
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getagent.d.ts +5 -2
- package/models/operations/getagent.d.ts.map +1 -1
- package/models/operations/getagent.js +4 -12
- package/models/operations/getagent.js.map +1 -1
- package/models/operations/getagenttask.d.ts +2 -2
- package/models/operations/getagenttask.d.ts.map +1 -1
- package/models/operations/getagenttask.js +4 -2
- package/models/operations/getagenttask.js.map +1 -1
- package/models/operations/getalltools.js +10 -10
- package/models/operations/getbudget.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/listagents.d.ts +5 -2
- package/models/operations/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js +4 -12
- package/models/operations/listagents.js.map +1 -1
- package/models/operations/listbudgets.js +2 -2
- 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/retrievetool.js +10 -10
- package/models/operations/runagent.d.ts +5 -2
- package/models/operations/runagent.d.ts.map +1 -1
- package/models/operations/runagent.js +4 -12
- package/models/operations/runagent.js.map +1 -1
- package/models/operations/streamrunagent.d.ts +5 -2
- package/models/operations/streamrunagent.d.ts.map +1 -1
- package/models/operations/streamrunagent.js +4 -12
- package/models/operations/streamrunagent.js.map +1 -1
- package/models/operations/updatebudget.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 +28 -28
- package/models/operations/updatetool.js +14 -14
- package/package.json +1 -1
- package/packages/orq-rc/README.md +97 -91
- package/packages/orq-rc/docs/sdks/agents/README.md +3 -3
- package/packages/orq-rc/docs/sdks/knowledge/README.md +228 -0
- package/packages/orq-rc/docs/sdks/tools/README.md +14 -16
- 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/agentsRetrieveTask.ts +2 -2
- package/packages/orq-rc/src/funcs/knowledgeDeleteChunks.ts +170 -0
- package/packages/orq-rc/src/funcs/knowledgeGetChunksCount.ts +170 -0
- package/packages/orq-rc/src/funcs/knowledgeListChunksPaginated.ts +171 -0
- package/packages/orq-rc/src/funcs/toolsDelete.ts +2 -2
- package/packages/orq-rc/src/funcs/toolsDuplicate.ts +3 -3
- package/packages/orq-rc/src/funcs/toolsRetrieve.ts +3 -3
- package/packages/orq-rc/src/funcs/toolsUpdate.ts +2 -2
- 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 +7 -1
- package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunks.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/knowledgeGetChunksCount.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunksPaginated.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/toolsDuplicate.ts +1 -1
- package/packages/orq-rc/src/mcp-server/tools/toolsRetrieve.ts +1 -1
- package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
- 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 +2 -2
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +28 -28
- package/packages/orq-rc/src/models/operations/createprompt.ts +8 -0
- package/packages/orq-rc/src/models/operations/createtool.ts +10 -22
- package/packages/orq-rc/src/models/operations/deletechunks.ts +243 -0
- package/packages/orq-rc/src/models/operations/deletetool.ts +6 -6
- package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +4 -0
- package/packages/orq-rc/src/models/operations/deployments.ts +4 -0
- package/packages/orq-rc/src/models/operations/duplicatetool.ts +23 -15
- 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/getagent.ts +9 -14
- package/packages/orq-rc/src/models/operations/getagenttask.ts +6 -4
- package/packages/orq-rc/src/models/operations/getallprompts.ts +4 -0
- package/packages/orq-rc/src/models/operations/getalltools.ts +10 -10
- package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/getchunkscount.ts +230 -0
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/getoneprompt.ts +4 -0
- package/packages/orq-rc/src/models/operations/getpromptversion.ts +4 -0
- package/packages/orq-rc/src/models/operations/index.ts +3 -0
- package/packages/orq-rc/src/models/operations/listagents.ts +9 -14
- package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listchunkspaginated.ts +507 -0
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -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/listpromptversions.ts +4 -0
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -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/retrievetool.ts +16 -16
- package/packages/orq-rc/src/models/operations/runagent.ts +7 -18
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +7 -18
- 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 +2 -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 +28 -28
- package/packages/orq-rc/src/models/operations/updateprompt.ts +8 -0
- package/packages/orq-rc/src/models/operations/updatetool.ts +44 -28
- package/packages/orq-rc/src/sdk/knowledge.ts +45 -0
- package/packages/orq-rc/src/sdk/tools.ts +2 -2
- package/src/funcs/agentsRetrieveTask.ts +2 -2
- 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/createbudget.ts +2 -2
- 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 +28 -28
- package/src/models/operations/createtool.ts +14 -14
- package/src/models/operations/duplicatetool.ts +10 -10
- 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/getagent.ts +9 -14
- package/src/models/operations/getagenttask.ts +6 -4
- package/src/models/operations/getalltools.ts +10 -10
- package/src/models/operations/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/listagents.ts +9 -14
- package/src/models/operations/listbudgets.ts +2 -2
- 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/retrievetool.ts +10 -10
- package/src/models/operations/runagent.ts +9 -14
- package/src/models/operations/streamrunagent.ts +9 -14
- package/src/models/operations/updatebudget.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 +28 -28
- package/src/models/operations/updatetool.ts +14 -14
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
* [updateDatasource](#updatedatasource) - Update a datasource
|
|
19
19
|
* [createChunks](#createchunks) - Create chunks for a datasource
|
|
20
20
|
* [listChunks](#listchunks) - List all chunks for a datasource
|
|
21
|
+
* [deleteChunks](#deletechunks) - Delete multiple chunks
|
|
22
|
+
* [listChunksPaginated](#listchunkspaginated) - List chunks with offset-based pagination
|
|
23
|
+
* [getChunksCount](#getchunkscount) - Get chunks total count
|
|
21
24
|
* [updateChunk](#updatechunk) - Update a chunk
|
|
22
25
|
* [deleteChunk](#deletechunk) - Delete a chunk
|
|
23
26
|
* [retrieveChunk](#retrievechunk) - Retrieve a chunk
|
|
@@ -1023,6 +1026,231 @@ run();
|
|
|
1023
1026
|
| --------------- | --------------- | --------------- |
|
|
1024
1027
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
1025
1028
|
|
|
1029
|
+
## deleteChunks
|
|
1030
|
+
|
|
1031
|
+
Delete multiple chunks
|
|
1032
|
+
|
|
1033
|
+
### Example Usage
|
|
1034
|
+
|
|
1035
|
+
<!-- UsageSnippet language="typescript" operationID="DeleteChunks" method="delete" path="/v2/knowledge/{knowledge_id}/datasources/{datasource_id}/chunks" -->
|
|
1036
|
+
```typescript
|
|
1037
|
+
import { Orq } from "@orq-ai/node";
|
|
1038
|
+
|
|
1039
|
+
const orq = new Orq({
|
|
1040
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
1041
|
+
});
|
|
1042
|
+
|
|
1043
|
+
async function run() {
|
|
1044
|
+
const result = await orq.knowledge.deleteChunks({
|
|
1045
|
+
knowledgeId: "<id>",
|
|
1046
|
+
datasourceId: "<id>",
|
|
1047
|
+
});
|
|
1048
|
+
|
|
1049
|
+
console.log(result);
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
run();
|
|
1053
|
+
```
|
|
1054
|
+
|
|
1055
|
+
### Standalone function
|
|
1056
|
+
|
|
1057
|
+
The standalone function version of this method:
|
|
1058
|
+
|
|
1059
|
+
```typescript
|
|
1060
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
1061
|
+
import { knowledgeDeleteChunks } from "@orq-ai/node/funcs/knowledgeDeleteChunks.js";
|
|
1062
|
+
|
|
1063
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
1064
|
+
// You can create one instance of it to use across an application.
|
|
1065
|
+
const orq = new OrqCore({
|
|
1066
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
1067
|
+
});
|
|
1068
|
+
|
|
1069
|
+
async function run() {
|
|
1070
|
+
const res = await knowledgeDeleteChunks(orq, {
|
|
1071
|
+
knowledgeId: "<id>",
|
|
1072
|
+
datasourceId: "<id>",
|
|
1073
|
+
});
|
|
1074
|
+
if (res.ok) {
|
|
1075
|
+
const { value: result } = res;
|
|
1076
|
+
console.log(result);
|
|
1077
|
+
} else {
|
|
1078
|
+
console.log("knowledgeDeleteChunks failed:", res.error);
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
run();
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
### Parameters
|
|
1086
|
+
|
|
1087
|
+
| Parameter | Type | Required | Description |
|
|
1088
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1089
|
+
| `request` | [operations.DeleteChunksRequest](../../models/operations/deletechunksrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
1090
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
1091
|
+
| `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. |
|
|
1092
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
1093
|
+
|
|
1094
|
+
### Response
|
|
1095
|
+
|
|
1096
|
+
**Promise\<[operations.DeleteChunksResponseBody](../../models/operations/deletechunksresponsebody.md)\>**
|
|
1097
|
+
|
|
1098
|
+
### Errors
|
|
1099
|
+
|
|
1100
|
+
| Error Type | Status Code | Content Type |
|
|
1101
|
+
| --------------- | --------------- | --------------- |
|
|
1102
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
1103
|
+
|
|
1104
|
+
## listChunksPaginated
|
|
1105
|
+
|
|
1106
|
+
List chunks with offset-based pagination
|
|
1107
|
+
|
|
1108
|
+
### Example Usage
|
|
1109
|
+
|
|
1110
|
+
<!-- UsageSnippet language="typescript" operationID="ListChunksPaginated" method="post" path="/v2/knowledge/{knowledge_id}/datasources/{datasource_id}/chunks/list" -->
|
|
1111
|
+
```typescript
|
|
1112
|
+
import { Orq } from "@orq-ai/node";
|
|
1113
|
+
|
|
1114
|
+
const orq = new Orq({
|
|
1115
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
1116
|
+
});
|
|
1117
|
+
|
|
1118
|
+
async function run() {
|
|
1119
|
+
const result = await orq.knowledge.listChunksPaginated({
|
|
1120
|
+
knowledgeId: "<id>",
|
|
1121
|
+
datasourceId: "<id>",
|
|
1122
|
+
});
|
|
1123
|
+
|
|
1124
|
+
console.log(result);
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
run();
|
|
1128
|
+
```
|
|
1129
|
+
|
|
1130
|
+
### Standalone function
|
|
1131
|
+
|
|
1132
|
+
The standalone function version of this method:
|
|
1133
|
+
|
|
1134
|
+
```typescript
|
|
1135
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
1136
|
+
import { knowledgeListChunksPaginated } from "@orq-ai/node/funcs/knowledgeListChunksPaginated.js";
|
|
1137
|
+
|
|
1138
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
1139
|
+
// You can create one instance of it to use across an application.
|
|
1140
|
+
const orq = new OrqCore({
|
|
1141
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
1142
|
+
});
|
|
1143
|
+
|
|
1144
|
+
async function run() {
|
|
1145
|
+
const res = await knowledgeListChunksPaginated(orq, {
|
|
1146
|
+
knowledgeId: "<id>",
|
|
1147
|
+
datasourceId: "<id>",
|
|
1148
|
+
});
|
|
1149
|
+
if (res.ok) {
|
|
1150
|
+
const { value: result } = res;
|
|
1151
|
+
console.log(result);
|
|
1152
|
+
} else {
|
|
1153
|
+
console.log("knowledgeListChunksPaginated failed:", res.error);
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
run();
|
|
1158
|
+
```
|
|
1159
|
+
|
|
1160
|
+
### Parameters
|
|
1161
|
+
|
|
1162
|
+
| Parameter | Type | Required | Description |
|
|
1163
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1164
|
+
| `request` | [operations.ListChunksPaginatedRequest](../../models/operations/listchunkspaginatedrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
1165
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
1166
|
+
| `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. |
|
|
1167
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
1168
|
+
|
|
1169
|
+
### Response
|
|
1170
|
+
|
|
1171
|
+
**Promise\<[operations.ListChunksPaginatedResponseBody](../../models/operations/listchunkspaginatedresponsebody.md)\>**
|
|
1172
|
+
|
|
1173
|
+
### Errors
|
|
1174
|
+
|
|
1175
|
+
| Error Type | Status Code | Content Type |
|
|
1176
|
+
| --------------- | --------------- | --------------- |
|
|
1177
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
1178
|
+
|
|
1179
|
+
## getChunksCount
|
|
1180
|
+
|
|
1181
|
+
Get chunks total count
|
|
1182
|
+
|
|
1183
|
+
### Example Usage
|
|
1184
|
+
|
|
1185
|
+
<!-- UsageSnippet language="typescript" operationID="GetChunksCount" method="post" path="/v2/knowledge/{knowledge_id}/datasources/{datasource_id}/chunks/count" -->
|
|
1186
|
+
```typescript
|
|
1187
|
+
import { Orq } from "@orq-ai/node";
|
|
1188
|
+
|
|
1189
|
+
const orq = new Orq({
|
|
1190
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
1191
|
+
});
|
|
1192
|
+
|
|
1193
|
+
async function run() {
|
|
1194
|
+
const result = await orq.knowledge.getChunksCount({
|
|
1195
|
+
knowledgeId: "<id>",
|
|
1196
|
+
datasourceId: "<id>",
|
|
1197
|
+
});
|
|
1198
|
+
|
|
1199
|
+
console.log(result);
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
run();
|
|
1203
|
+
```
|
|
1204
|
+
|
|
1205
|
+
### Standalone function
|
|
1206
|
+
|
|
1207
|
+
The standalone function version of this method:
|
|
1208
|
+
|
|
1209
|
+
```typescript
|
|
1210
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
1211
|
+
import { knowledgeGetChunksCount } from "@orq-ai/node/funcs/knowledgeGetChunksCount.js";
|
|
1212
|
+
|
|
1213
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
1214
|
+
// You can create one instance of it to use across an application.
|
|
1215
|
+
const orq = new OrqCore({
|
|
1216
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
1217
|
+
});
|
|
1218
|
+
|
|
1219
|
+
async function run() {
|
|
1220
|
+
const res = await knowledgeGetChunksCount(orq, {
|
|
1221
|
+
knowledgeId: "<id>",
|
|
1222
|
+
datasourceId: "<id>",
|
|
1223
|
+
});
|
|
1224
|
+
if (res.ok) {
|
|
1225
|
+
const { value: result } = res;
|
|
1226
|
+
console.log(result);
|
|
1227
|
+
} else {
|
|
1228
|
+
console.log("knowledgeGetChunksCount failed:", res.error);
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
run();
|
|
1233
|
+
```
|
|
1234
|
+
|
|
1235
|
+
### Parameters
|
|
1236
|
+
|
|
1237
|
+
| Parameter | Type | Required | Description |
|
|
1238
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1239
|
+
| `request` | [operations.GetChunksCountRequest](../../models/operations/getchunkscountrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
1240
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
1241
|
+
| `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. |
|
|
1242
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
1243
|
+
|
|
1244
|
+
### Response
|
|
1245
|
+
|
|
1246
|
+
**Promise\<[operations.GetChunksCountResponseBody](../../models/operations/getchunkscountresponsebody.md)\>**
|
|
1247
|
+
|
|
1248
|
+
### Errors
|
|
1249
|
+
|
|
1250
|
+
| Error Type | Status Code | Content Type |
|
|
1251
|
+
| --------------- | --------------- | --------------- |
|
|
1252
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
1253
|
+
|
|
1026
1254
|
## updateChunk
|
|
1027
1255
|
|
|
1028
1256
|
Update a chunk
|
|
@@ -98,7 +98,6 @@ const orq = new Orq({
|
|
|
98
98
|
|
|
99
99
|
async function run() {
|
|
100
100
|
const result = await orq.tools.create({
|
|
101
|
-
id: "01K5ZT3CYBDREF06WS7W7BX3Y2",
|
|
102
101
|
path: "Default",
|
|
103
102
|
key: "<key>",
|
|
104
103
|
displayName: "Ellie78",
|
|
@@ -137,7 +136,6 @@ const orq = new OrqCore({
|
|
|
137
136
|
|
|
138
137
|
async function run() {
|
|
139
138
|
const res = await toolsCreate(orq, {
|
|
140
|
-
id: "01K5ZT3CYBDREF06WS7W7BX3Y2",
|
|
141
139
|
path: "Default",
|
|
142
140
|
key: "<key>",
|
|
143
141
|
displayName: "Ellie78",
|
|
@@ -189,7 +187,7 @@ Updates a tool in the workspace.
|
|
|
189
187
|
|
|
190
188
|
### Example Usage
|
|
191
189
|
|
|
192
|
-
<!-- UsageSnippet language="typescript" operationID="UpdateTool" method="patch" path="/v2/tools/{
|
|
190
|
+
<!-- UsageSnippet language="typescript" operationID="UpdateTool" method="patch" path="/v2/tools/{tool_id}" -->
|
|
193
191
|
```typescript
|
|
194
192
|
import { Orq } from "@orq-ai/node";
|
|
195
193
|
|
|
@@ -199,7 +197,7 @@ const orq = new Orq({
|
|
|
199
197
|
|
|
200
198
|
async function run() {
|
|
201
199
|
const result = await orq.tools.update({
|
|
202
|
-
|
|
200
|
+
toolId: "<id>",
|
|
203
201
|
requestBody: {
|
|
204
202
|
path: "Default",
|
|
205
203
|
status: "live",
|
|
@@ -229,7 +227,7 @@ const orq = new OrqCore({
|
|
|
229
227
|
|
|
230
228
|
async function run() {
|
|
231
229
|
const res = await toolsUpdate(orq, {
|
|
232
|
-
|
|
230
|
+
toolId: "<id>",
|
|
233
231
|
requestBody: {
|
|
234
232
|
path: "Default",
|
|
235
233
|
status: "live",
|
|
@@ -273,7 +271,7 @@ Deletes a tool by key.
|
|
|
273
271
|
|
|
274
272
|
### Example Usage
|
|
275
273
|
|
|
276
|
-
<!-- UsageSnippet language="typescript" operationID="DeleteTool" method="delete" path="/v2/tools/{
|
|
274
|
+
<!-- UsageSnippet language="typescript" operationID="DeleteTool" method="delete" path="/v2/tools/{tool_id}" -->
|
|
277
275
|
```typescript
|
|
278
276
|
import { Orq } from "@orq-ai/node";
|
|
279
277
|
|
|
@@ -283,7 +281,7 @@ const orq = new Orq({
|
|
|
283
281
|
|
|
284
282
|
async function run() {
|
|
285
283
|
await orq.tools.delete({
|
|
286
|
-
|
|
284
|
+
toolId: "<id>",
|
|
287
285
|
});
|
|
288
286
|
|
|
289
287
|
|
|
@@ -308,7 +306,7 @@ const orq = new OrqCore({
|
|
|
308
306
|
|
|
309
307
|
async function run() {
|
|
310
308
|
const res = await toolsDelete(orq, {
|
|
311
|
-
|
|
309
|
+
toolId: "<id>",
|
|
312
310
|
});
|
|
313
311
|
if (res.ok) {
|
|
314
312
|
const { value: result } = res;
|
|
@@ -342,11 +340,11 @@ run();
|
|
|
342
340
|
|
|
343
341
|
## retrieve
|
|
344
342
|
|
|
345
|
-
Retrieves a tool by
|
|
343
|
+
Retrieves a tool by id.
|
|
346
344
|
|
|
347
345
|
### Example Usage
|
|
348
346
|
|
|
349
|
-
<!-- UsageSnippet language="typescript" operationID="RetrieveTool" method="get" path="/v2/tools/{
|
|
347
|
+
<!-- UsageSnippet language="typescript" operationID="RetrieveTool" method="get" path="/v2/tools/{tool_id}" -->
|
|
350
348
|
```typescript
|
|
351
349
|
import { Orq } from "@orq-ai/node";
|
|
352
350
|
|
|
@@ -356,7 +354,7 @@ const orq = new Orq({
|
|
|
356
354
|
|
|
357
355
|
async function run() {
|
|
358
356
|
const result = await orq.tools.retrieve({
|
|
359
|
-
|
|
357
|
+
toolId: "<id>",
|
|
360
358
|
});
|
|
361
359
|
|
|
362
360
|
console.log(result);
|
|
@@ -381,7 +379,7 @@ const orq = new OrqCore({
|
|
|
381
379
|
|
|
382
380
|
async function run() {
|
|
383
381
|
const res = await toolsRetrieve(orq, {
|
|
384
|
-
|
|
382
|
+
toolId: "<id>",
|
|
385
383
|
});
|
|
386
384
|
if (res.ok) {
|
|
387
385
|
const { value: result } = res;
|
|
@@ -415,11 +413,11 @@ run();
|
|
|
415
413
|
|
|
416
414
|
## duplicate
|
|
417
415
|
|
|
418
|
-
Creates a copy of an existing tool with a new
|
|
416
|
+
Creates a copy of an existing tool with a new id and ID.
|
|
419
417
|
|
|
420
418
|
### Example Usage
|
|
421
419
|
|
|
422
|
-
<!-- UsageSnippet language="typescript" operationID="DuplicateTool" method="post" path="/v2/tools/{
|
|
420
|
+
<!-- UsageSnippet language="typescript" operationID="DuplicateTool" method="post" path="/v2/tools/{tool_id}/duplicate" -->
|
|
423
421
|
```typescript
|
|
424
422
|
import { Orq } from "@orq-ai/node";
|
|
425
423
|
|
|
@@ -429,7 +427,7 @@ const orq = new Orq({
|
|
|
429
427
|
|
|
430
428
|
async function run() {
|
|
431
429
|
const result = await orq.tools.duplicate({
|
|
432
|
-
|
|
430
|
+
toolId: "<id>",
|
|
433
431
|
});
|
|
434
432
|
|
|
435
433
|
console.log(result);
|
|
@@ -454,7 +452,7 @@ const orq = new OrqCore({
|
|
|
454
452
|
|
|
455
453
|
async function run() {
|
|
456
454
|
const res = await toolsDuplicate(orq, {
|
|
457
|
-
|
|
455
|
+
toolId: "<id>",
|
|
458
456
|
});
|
|
459
457
|
if (res.ok) {
|
|
460
458
|
const { value: result } = res;
|
package/packages/orq-rc/jsr.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orq-ai/node",
|
|
3
|
-
"version": "3.14.0-rc.
|
|
3
|
+
"version": "3.14.0-rc.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@orq-ai/node",
|
|
9
|
-
"version": "3.14.0-rc.
|
|
9
|
+
"version": "3.14.0-rc.6",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"zod": "^3.20.0"
|
|
12
12
|
},
|
|
@@ -89,7 +89,7 @@ async function $do(
|
|
|
89
89
|
const body = null;
|
|
90
90
|
|
|
91
91
|
const pathParams = {
|
|
92
|
-
|
|
92
|
+
agent_key: encodeSimple("agent_key", payload.agent_key, {
|
|
93
93
|
explode: false,
|
|
94
94
|
charEncoding: "percent",
|
|
95
95
|
}),
|
|
@@ -99,7 +99,7 @@ async function $do(
|
|
|
99
99
|
}),
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
const path = pathToFunc("/v2/agents/{
|
|
102
|
+
const path = pathToFunc("/v2/agents/{agent_key}/tasks/{task_id}")(pathParams);
|
|
103
103
|
|
|
104
104
|
const headers = new Headers(compactMap({
|
|
105
105
|
Accept: "application/json",
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Delete multiple chunks
|
|
29
|
+
*/
|
|
30
|
+
export function knowledgeDeleteChunks(
|
|
31
|
+
client: OrqCore,
|
|
32
|
+
request: operations.DeleteChunksRequest,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<
|
|
35
|
+
Result<
|
|
36
|
+
operations.DeleteChunksResponseBody,
|
|
37
|
+
| OrqError
|
|
38
|
+
| ResponseValidationError
|
|
39
|
+
| ConnectionError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| InvalidRequestError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| SDKValidationError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
return new APIPromise($do(
|
|
48
|
+
client,
|
|
49
|
+
request,
|
|
50
|
+
options,
|
|
51
|
+
));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function $do(
|
|
55
|
+
client: OrqCore,
|
|
56
|
+
request: operations.DeleteChunksRequest,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<
|
|
59
|
+
[
|
|
60
|
+
Result<
|
|
61
|
+
operations.DeleteChunksResponseBody,
|
|
62
|
+
| OrqError
|
|
63
|
+
| ResponseValidationError
|
|
64
|
+
| ConnectionError
|
|
65
|
+
| RequestAbortedError
|
|
66
|
+
| RequestTimeoutError
|
|
67
|
+
| InvalidRequestError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| SDKValidationError
|
|
70
|
+
>,
|
|
71
|
+
APICall,
|
|
72
|
+
]
|
|
73
|
+
> {
|
|
74
|
+
const parsed = safeParse(
|
|
75
|
+
request,
|
|
76
|
+
(value) => operations.DeleteChunksRequest$outboundSchema.parse(value),
|
|
77
|
+
"Input validation failed",
|
|
78
|
+
);
|
|
79
|
+
if (!parsed.ok) {
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
81
|
+
}
|
|
82
|
+
const payload = parsed.value;
|
|
83
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
84
|
+
|
|
85
|
+
const pathParams = {
|
|
86
|
+
datasource_id: encodeSimple("datasource_id", payload.datasource_id, {
|
|
87
|
+
explode: false,
|
|
88
|
+
charEncoding: "percent",
|
|
89
|
+
}),
|
|
90
|
+
knowledge_id: encodeSimple("knowledge_id", payload.knowledge_id, {
|
|
91
|
+
explode: false,
|
|
92
|
+
charEncoding: "percent",
|
|
93
|
+
}),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const path = pathToFunc(
|
|
97
|
+
"/v2/knowledge/{knowledge_id}/datasources/{datasource_id}/chunks",
|
|
98
|
+
)(pathParams);
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
106
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
107
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
|
+
|
|
109
|
+
const context = {
|
|
110
|
+
options: client._options,
|
|
111
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
+
operationID: "DeleteChunks",
|
|
113
|
+
oAuth2Scopes: [],
|
|
114
|
+
|
|
115
|
+
resolvedSecurity: requestSecurity,
|
|
116
|
+
|
|
117
|
+
securitySource: client._options.apiKey,
|
|
118
|
+
retryConfig: options?.retries
|
|
119
|
+
|| client._options.retryConfig
|
|
120
|
+
|| { strategy: "none" },
|
|
121
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const requestRes = client._createRequest(context, {
|
|
125
|
+
security: requestSecurity,
|
|
126
|
+
method: "DELETE",
|
|
127
|
+
baseURL: options?.serverURL,
|
|
128
|
+
path: path,
|
|
129
|
+
headers: headers,
|
|
130
|
+
body: body,
|
|
131
|
+
userAgent: client._options.userAgent,
|
|
132
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
133
|
+
}, options);
|
|
134
|
+
if (!requestRes.ok) {
|
|
135
|
+
return [requestRes, { status: "invalid" }];
|
|
136
|
+
}
|
|
137
|
+
const req = requestRes.value;
|
|
138
|
+
|
|
139
|
+
const doResult = await client._do(req, {
|
|
140
|
+
context,
|
|
141
|
+
errorCodes: ["4XX", "5XX"],
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const [result] = await M.match<
|
|
151
|
+
operations.DeleteChunksResponseBody,
|
|
152
|
+
| OrqError
|
|
153
|
+
| ResponseValidationError
|
|
154
|
+
| ConnectionError
|
|
155
|
+
| RequestAbortedError
|
|
156
|
+
| RequestTimeoutError
|
|
157
|
+
| InvalidRequestError
|
|
158
|
+
| UnexpectedClientError
|
|
159
|
+
| SDKValidationError
|
|
160
|
+
>(
|
|
161
|
+
M.json(200, operations.DeleteChunksResponseBody$inboundSchema),
|
|
162
|
+
M.fail("4XX"),
|
|
163
|
+
M.fail("5XX"),
|
|
164
|
+
)(response, req);
|
|
165
|
+
if (!result.ok) {
|
|
166
|
+
return [result, { status: "complete", request: req, response }];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return [result, { status: "complete", request: req, response }];
|
|
170
|
+
}
|