@orq-ai/node 3.12.8 → 3.12.10
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 +112 -112
- package/bin/mcp-server.js.map +30 -30
- 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/mcp-server.js.map +1 -1
- package/mcp-server/server.js +1 -1
- package/mcp-server/server.js.map +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 +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/getbudget.js +2 -2
- package/models/operations/getevals.js +28 -28
- 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/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 +16 -16
- package/package.json +1 -1
- package/packages/orq-rc/FUNCTIONS.md +19 -9
- package/packages/orq-rc/README.md +179 -123
- package/packages/orq-rc/docs/sdks/knowledge/README.md +12 -0
- package/packages/orq-rc/docs/sdks/orq/README.md +0 -81
- package/packages/orq-rc/examples/contactsCreate.example.ts +42 -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/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 +1 -3
- 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/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 +139 -117
- package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/index.ts +0 -1
- package/packages/orq-rc/src/models/operations/listagents.ts +5 -5
- 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 +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/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/runagent.ts +300 -12
- package/packages/orq-rc/src/models/operations/searchknowledge.ts +29 -259
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +335 -12
- 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/sdk/sdk.ts +1 -15
- 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 +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/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- 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/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 +16 -16
- package/packages/orq-rc/examples/postV2AgentsInternal.example.ts +0 -30
- package/packages/orq-rc/src/funcs/postV2AgentsInternal.ts +0 -159
- package/packages/orq-rc/src/mcp-server/tools/postV2AgentsInternal.ts +0 -33
- package/packages/orq-rc/src/models/operations/postv2agentsinternal.ts +0 -103
|
@@ -543,7 +543,7 @@ export const UpdateBudgetResponseBody$inboundSchema: z.ZodType<
|
|
|
543
543
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
544
544
|
.optional(),
|
|
545
545
|
updated: z.string().datetime({ offset: true }).default(
|
|
546
|
-
"2025-09-
|
|
546
|
+
"2025-09-18T14:54:46.365Z",
|
|
547
547
|
).transform(v => new Date(v)),
|
|
548
548
|
}).transform((v) => {
|
|
549
549
|
return remap$(v, {
|
|
@@ -581,7 +581,7 @@ export const UpdateBudgetResponseBody$outboundSchema: z.ZodType<
|
|
|
581
581
|
isActive: z.boolean(),
|
|
582
582
|
consumption: z.lazy(() => UpdateBudgetConsumption$outboundSchema).optional(),
|
|
583
583
|
created: z.date().transform(v => v.toISOString()).optional(),
|
|
584
|
-
updated: z.date().default(() => new Date("2025-09-
|
|
584
|
+
updated: z.date().default(() => new Date("2025-09-18T14:54:46.365Z"))
|
|
585
585
|
.transform(v => v.toISOString()),
|
|
586
586
|
}).transform((v) => {
|
|
587
587
|
return remap$(v, {
|
|
@@ -244,7 +244,7 @@ export const UpdateContactResponseBody$inboundSchema: z.ZodType<
|
|
|
244
244
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
245
245
|
.optional(),
|
|
246
246
|
updated: z.string().datetime({ offset: true }).default(
|
|
247
|
-
"2025-09-
|
|
247
|
+
"2025-09-18T14:54:46.365Z",
|
|
248
248
|
).transform(v => new Date(v)),
|
|
249
249
|
}).transform((v) => {
|
|
250
250
|
return remap$(v, {
|
|
@@ -282,7 +282,7 @@ export const UpdateContactResponseBody$outboundSchema: z.ZodType<
|
|
|
282
282
|
tags: z.array(z.string()).optional(),
|
|
283
283
|
metadata: z.record(z.any()).optional(),
|
|
284
284
|
created: z.date().transform(v => v.toISOString()).optional(),
|
|
285
|
-
updated: z.date().default(() => new Date("2025-09-
|
|
285
|
+
updated: z.date().default(() => new Date("2025-09-18T14:54:46.365Z"))
|
|
286
286
|
.transform(v => v.toISOString()),
|
|
287
287
|
}).transform((v) => {
|
|
288
288
|
return remap$(v, {
|
|
@@ -6018,7 +6018,7 @@ export const UpdateDatapointResponseBody$inboundSchema: z.ZodType<
|
|
|
6018
6018
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
6019
6019
|
.optional(),
|
|
6020
6020
|
updated: z.string().datetime({ offset: true }).default(
|
|
6021
|
-
"2025-09-
|
|
6021
|
+
"2025-09-18T14:54:46.365Z",
|
|
6022
6022
|
).transform(v => new Date(v)),
|
|
6023
6023
|
}).transform((v) => {
|
|
6024
6024
|
return remap$(v, {
|
|
@@ -6080,7 +6080,7 @@ export const UpdateDatapointResponseBody$outboundSchema: z.ZodType<
|
|
|
6080
6080
|
createdById: z.string().optional(),
|
|
6081
6081
|
updatedById: z.string().optional(),
|
|
6082
6082
|
created: z.date().transform(v => v.toISOString()).optional(),
|
|
6083
|
-
updated: z.date().default(() => new Date("2025-09-
|
|
6083
|
+
updated: z.date().default(() => new Date("2025-09-18T14:54:46.365Z"))
|
|
6084
6084
|
.transform(v => v.toISOString()),
|
|
6085
6085
|
}).transform((v) => {
|
|
6086
6086
|
return remap$(v, {
|
|
@@ -302,7 +302,7 @@ export const UpdateDatasetResponseBody$inboundSchema: z.ZodType<
|
|
|
302
302
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
303
303
|
.optional(),
|
|
304
304
|
updated: z.string().datetime({ offset: true }).default(
|
|
305
|
-
"2025-09-
|
|
305
|
+
"2025-09-18T14:54:46.365Z",
|
|
306
306
|
).transform(v => new Date(v)),
|
|
307
307
|
}).transform((v) => {
|
|
308
308
|
return remap$(v, {
|
|
@@ -347,7 +347,7 @@ export const UpdateDatasetResponseBody$outboundSchema: z.ZodType<
|
|
|
347
347
|
parentId: z.string().optional(),
|
|
348
348
|
version: z.string().optional(),
|
|
349
349
|
created: z.date().transform(v => v.toISOString()).optional(),
|
|
350
|
-
updated: z.date().default(() => new Date("2025-09-
|
|
350
|
+
updated: z.date().default(() => new Date("2025-09-18T14:54:46.365Z"))
|
|
351
351
|
.transform(v => v.toISOString()),
|
|
352
352
|
}).transform((v) => {
|
|
353
353
|
return remap$(v, {
|
|
@@ -244,7 +244,7 @@ export const UpdateDatasourceResponseBody$inboundSchema: z.ZodType<
|
|
|
244
244
|
z.ZodTypeDef,
|
|
245
245
|
unknown
|
|
246
246
|
> = z.object({
|
|
247
|
-
_id: z.string().default("
|
|
247
|
+
_id: z.string().default("01K5EN4F74GJAWFFWRZFHDTS00"),
|
|
248
248
|
display_name: z.string(),
|
|
249
249
|
description: z.string().optional(),
|
|
250
250
|
status: UpdateDatasourceStatus$inboundSchema,
|
|
@@ -288,7 +288,7 @@ export const UpdateDatasourceResponseBody$outboundSchema: z.ZodType<
|
|
|
288
288
|
z.ZodTypeDef,
|
|
289
289
|
UpdateDatasourceResponseBody
|
|
290
290
|
> = z.object({
|
|
291
|
-
id: z.string().default("
|
|
291
|
+
id: z.string().default("01K5EN4F74GJAWFFWRZFHDTS00"),
|
|
292
292
|
displayName: z.string(),
|
|
293
293
|
description: z.string().optional(),
|
|
294
294
|
status: UpdateDatasourceStatus$outboundSchema,
|
|
@@ -2674,8 +2674,8 @@ export const UpdateEvalResponseBodyPython$inboundSchema: z.ZodType<
|
|
|
2674
2674
|
> = z.object({
|
|
2675
2675
|
_id: z.string(),
|
|
2676
2676
|
description: z.string(),
|
|
2677
|
-
created: z.string().default("2025-09-
|
|
2678
|
-
updated: z.string().default("2025-09-
|
|
2677
|
+
created: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
2678
|
+
updated: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
2679
2679
|
guardrail_config: z.union([
|
|
2680
2680
|
z.lazy(() =>
|
|
2681
2681
|
UpdateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber$inboundSchema
|
|
@@ -2717,8 +2717,8 @@ export const UpdateEvalResponseBodyPython$outboundSchema: z.ZodType<
|
|
|
2717
2717
|
> = z.object({
|
|
2718
2718
|
id: z.string(),
|
|
2719
2719
|
description: z.string(),
|
|
2720
|
-
created: z.string().default("2025-09-
|
|
2721
|
-
updated: z.string().default("2025-09-
|
|
2720
|
+
created: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
2721
|
+
updated: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
2722
2722
|
guardrailConfig: z.union([
|
|
2723
2723
|
z.lazy(() =>
|
|
2724
2724
|
UpdateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber$outboundSchema
|
|
@@ -3139,8 +3139,8 @@ export const UpdateEvalResponseBodyHTTP$inboundSchema: z.ZodType<
|
|
|
3139
3139
|
> = z.object({
|
|
3140
3140
|
_id: z.string(),
|
|
3141
3141
|
description: z.string(),
|
|
3142
|
-
created: z.string().default("2025-09-
|
|
3143
|
-
updated: z.string().default("2025-09-
|
|
3142
|
+
created: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
3143
|
+
updated: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
3144
3144
|
guardrail_config: z.union([
|
|
3145
3145
|
z.lazy(() =>
|
|
3146
3146
|
UpdateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber$inboundSchema
|
|
@@ -3188,8 +3188,8 @@ export const UpdateEvalResponseBodyHTTP$outboundSchema: z.ZodType<
|
|
|
3188
3188
|
> = z.object({
|
|
3189
3189
|
id: z.string(),
|
|
3190
3190
|
description: z.string(),
|
|
3191
|
-
created: z.string().default("2025-09-
|
|
3192
|
-
updated: z.string().default("2025-09-
|
|
3191
|
+
created: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
3192
|
+
updated: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
3193
3193
|
guardrailConfig: z.union([
|
|
3194
3194
|
z.lazy(() =>
|
|
3195
3195
|
UpdateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber$outboundSchema
|
|
@@ -3579,8 +3579,8 @@ export const UpdateEvalResponseBodyJSON$inboundSchema: z.ZodType<
|
|
|
3579
3579
|
> = z.object({
|
|
3580
3580
|
_id: z.string(),
|
|
3581
3581
|
description: z.string(),
|
|
3582
|
-
created: z.string().default("2025-09-
|
|
3583
|
-
updated: z.string().default("2025-09-
|
|
3582
|
+
created: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
3583
|
+
updated: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
3584
3584
|
guardrail_config: z.union([
|
|
3585
3585
|
z.lazy(() => UpdateEvalGuardrailConfigEvalsResponse200Number$inboundSchema),
|
|
3586
3586
|
z.lazy(() =>
|
|
@@ -3620,8 +3620,8 @@ export const UpdateEvalResponseBodyJSON$outboundSchema: z.ZodType<
|
|
|
3620
3620
|
> = z.object({
|
|
3621
3621
|
id: z.string(),
|
|
3622
3622
|
description: z.string(),
|
|
3623
|
-
created: z.string().default("2025-09-
|
|
3624
|
-
updated: z.string().default("2025-09-
|
|
3623
|
+
created: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
3624
|
+
updated: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
3625
3625
|
guardrailConfig: z.union([
|
|
3626
3626
|
z.lazy(() =>
|
|
3627
3627
|
UpdateEvalGuardrailConfigEvalsResponse200Number$outboundSchema
|
|
@@ -3979,8 +3979,8 @@ export const UpdateEvalResponseBodyLLM$inboundSchema: z.ZodType<
|
|
|
3979
3979
|
> = z.object({
|
|
3980
3980
|
_id: z.string(),
|
|
3981
3981
|
description: z.string(),
|
|
3982
|
-
created: z.string().default("2025-09-
|
|
3983
|
-
updated: z.string().default("2025-09-
|
|
3982
|
+
created: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
3983
|
+
updated: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
3984
3984
|
guardrail_config: z.union([
|
|
3985
3985
|
z.lazy(() => UpdateEvalGuardrailConfigEvalsResponseNumber$inboundSchema),
|
|
3986
3986
|
z.lazy(() => UpdateEvalGuardrailConfigEvalsResponseBoolean$inboundSchema),
|
|
@@ -4020,8 +4020,8 @@ export const UpdateEvalResponseBodyLLM$outboundSchema: z.ZodType<
|
|
|
4020
4020
|
> = z.object({
|
|
4021
4021
|
id: z.string(),
|
|
4022
4022
|
description: z.string(),
|
|
4023
|
-
created: z.string().default("2025-09-
|
|
4024
|
-
updated: z.string().default("2025-09-
|
|
4023
|
+
created: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
4024
|
+
updated: z.string().default("2025-09-18T14:54:48.663Z"),
|
|
4025
4025
|
guardrailConfig: z.union([
|
|
4026
4026
|
z.lazy(() => UpdateEvalGuardrailConfigEvalsResponseNumber$outboundSchema),
|
|
4027
4027
|
z.lazy(() => UpdateEvalGuardrailConfigEvalsResponseBoolean$outboundSchema),
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import dotenv from "dotenv";
|
|
6
|
-
dotenv.config();
|
|
7
|
-
/**
|
|
8
|
-
* Example usage of the @orq-ai/node SDK
|
|
9
|
-
*
|
|
10
|
-
* To run this example from the examples directory:
|
|
11
|
-
* npm run build && npx tsx postV2AgentsInternal.example.ts
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { Orq } from "@orq-ai/node";
|
|
15
|
-
|
|
16
|
-
const orq = new Orq({
|
|
17
|
-
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
async function main() {
|
|
21
|
-
await orq.postV2AgentsInternal({
|
|
22
|
-
path: "Default",
|
|
23
|
-
key: "<key>",
|
|
24
|
-
description: "qua hm over irk",
|
|
25
|
-
instructions: "<value>",
|
|
26
|
-
model: "Model S",
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
main().catch(console.error);
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
import { OrqCore } from "../core.js";
|
|
7
|
-
import { encodeJSON } from "../lib/encodings.js";
|
|
8
|
-
import * as M from "../lib/matchers.js";
|
|
9
|
-
import { compactMap } from "../lib/primitives.js";
|
|
10
|
-
import { safeParse } from "../lib/schemas.js";
|
|
11
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
-
import { pathToFunc } from "../lib/url.js";
|
|
14
|
-
import {
|
|
15
|
-
ConnectionError,
|
|
16
|
-
InvalidRequestError,
|
|
17
|
-
RequestAbortedError,
|
|
18
|
-
RequestTimeoutError,
|
|
19
|
-
UnexpectedClientError,
|
|
20
|
-
} from "../models/errors/httpclienterrors.js";
|
|
21
|
-
import { OrqError } from "../models/errors/orqerror.js";
|
|
22
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
-
import * as operations from "../models/operations/index.js";
|
|
25
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
-
import { Result } from "../types/fp.js";
|
|
27
|
-
|
|
28
|
-
export function postV2AgentsInternal(
|
|
29
|
-
client: OrqCore,
|
|
30
|
-
request?: operations.PostV2AgentsInternalRequestBody | undefined,
|
|
31
|
-
options?: RequestOptions,
|
|
32
|
-
): APIPromise<
|
|
33
|
-
Result<
|
|
34
|
-
void,
|
|
35
|
-
| OrqError
|
|
36
|
-
| ResponseValidationError
|
|
37
|
-
| ConnectionError
|
|
38
|
-
| RequestAbortedError
|
|
39
|
-
| RequestTimeoutError
|
|
40
|
-
| InvalidRequestError
|
|
41
|
-
| UnexpectedClientError
|
|
42
|
-
| SDKValidationError
|
|
43
|
-
>
|
|
44
|
-
> {
|
|
45
|
-
return new APIPromise($do(
|
|
46
|
-
client,
|
|
47
|
-
request,
|
|
48
|
-
options,
|
|
49
|
-
));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async function $do(
|
|
53
|
-
client: OrqCore,
|
|
54
|
-
request?: operations.PostV2AgentsInternalRequestBody | undefined,
|
|
55
|
-
options?: RequestOptions,
|
|
56
|
-
): Promise<
|
|
57
|
-
[
|
|
58
|
-
Result<
|
|
59
|
-
void,
|
|
60
|
-
| OrqError
|
|
61
|
-
| ResponseValidationError
|
|
62
|
-
| ConnectionError
|
|
63
|
-
| RequestAbortedError
|
|
64
|
-
| RequestTimeoutError
|
|
65
|
-
| InvalidRequestError
|
|
66
|
-
| UnexpectedClientError
|
|
67
|
-
| SDKValidationError
|
|
68
|
-
>,
|
|
69
|
-
APICall,
|
|
70
|
-
]
|
|
71
|
-
> {
|
|
72
|
-
const parsed = safeParse(
|
|
73
|
-
request,
|
|
74
|
-
(value) =>
|
|
75
|
-
operations.PostV2AgentsInternalRequestBody$outboundSchema.optional()
|
|
76
|
-
.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 = payload === undefined
|
|
84
|
-
? null
|
|
85
|
-
: encodeJSON("body", payload, { explode: true });
|
|
86
|
-
|
|
87
|
-
const path = pathToFunc("/v2/agents/internal")();
|
|
88
|
-
|
|
89
|
-
const headers = new Headers(compactMap({
|
|
90
|
-
"Content-Type": "application/json",
|
|
91
|
-
Accept: "*/*",
|
|
92
|
-
}));
|
|
93
|
-
|
|
94
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
95
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
96
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
97
|
-
|
|
98
|
-
const context = {
|
|
99
|
-
options: client._options,
|
|
100
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
101
|
-
operationID: "post_/v2/agents/internal",
|
|
102
|
-
oAuth2Scopes: [],
|
|
103
|
-
|
|
104
|
-
resolvedSecurity: requestSecurity,
|
|
105
|
-
|
|
106
|
-
securitySource: client._options.apiKey,
|
|
107
|
-
retryConfig: options?.retries
|
|
108
|
-
|| client._options.retryConfig
|
|
109
|
-
|| { strategy: "none" },
|
|
110
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const requestRes = client._createRequest(context, {
|
|
114
|
-
security: requestSecurity,
|
|
115
|
-
method: "POST",
|
|
116
|
-
baseURL: options?.serverURL,
|
|
117
|
-
path: path,
|
|
118
|
-
headers: headers,
|
|
119
|
-
body: body,
|
|
120
|
-
userAgent: client._options.userAgent,
|
|
121
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
122
|
-
}, options);
|
|
123
|
-
if (!requestRes.ok) {
|
|
124
|
-
return [requestRes, { status: "invalid" }];
|
|
125
|
-
}
|
|
126
|
-
const req = requestRes.value;
|
|
127
|
-
|
|
128
|
-
const doResult = await client._do(req, {
|
|
129
|
-
context,
|
|
130
|
-
errorCodes: ["4XX", "5XX"],
|
|
131
|
-
retryConfig: context.retryConfig,
|
|
132
|
-
retryCodes: context.retryCodes,
|
|
133
|
-
});
|
|
134
|
-
if (!doResult.ok) {
|
|
135
|
-
return [doResult, { status: "request-error", request: req }];
|
|
136
|
-
}
|
|
137
|
-
const response = doResult.value;
|
|
138
|
-
|
|
139
|
-
const [result] = await M.match<
|
|
140
|
-
void,
|
|
141
|
-
| OrqError
|
|
142
|
-
| ResponseValidationError
|
|
143
|
-
| ConnectionError
|
|
144
|
-
| RequestAbortedError
|
|
145
|
-
| RequestTimeoutError
|
|
146
|
-
| InvalidRequestError
|
|
147
|
-
| UnexpectedClientError
|
|
148
|
-
| SDKValidationError
|
|
149
|
-
>(
|
|
150
|
-
M.nil(201, z.void()),
|
|
151
|
-
M.fail("4XX"),
|
|
152
|
-
M.fail("5XX"),
|
|
153
|
-
)(response, req);
|
|
154
|
-
if (!result.ok) {
|
|
155
|
-
return [result, { status: "complete", request: req, response }];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return [result, { status: "complete", request: req, response }];
|
|
159
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { postV2AgentsInternal } from "../../funcs/postV2AgentsInternal.js";
|
|
6
|
-
import * as operations from "../../models/operations/index.js";
|
|
7
|
-
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
-
|
|
9
|
-
const args = {
|
|
10
|
-
request: operations.PostV2AgentsInternalRequestBody$inboundSchema.optional(),
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const tool$postV2AgentsInternal: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "post-v2-agents-internal",
|
|
15
|
-
description: ``,
|
|
16
|
-
args,
|
|
17
|
-
tool: async (client, args, ctx) => {
|
|
18
|
-
const [result, apiCall] = await postV2AgentsInternal(
|
|
19
|
-
client,
|
|
20
|
-
args.request,
|
|
21
|
-
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
-
).$inspect();
|
|
23
|
-
|
|
24
|
-
if (!result.ok) {
|
|
25
|
-
return {
|
|
26
|
-
content: [{ type: "text", text: result.error.message }],
|
|
27
|
-
isError: true,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return formatResult(void 0, apiCall);
|
|
32
|
-
},
|
|
33
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
-
|
|
11
|
-
export type PostV2AgentsInternalRequestBody = {
|
|
12
|
-
/**
|
|
13
|
-
* The path where the entity is stored in the project structure. The first element of the path always represents the project name. Any subsequent path element after the project will be created as a folder in the project if it does not exists.
|
|
14
|
-
*/
|
|
15
|
-
path: string;
|
|
16
|
-
key: string;
|
|
17
|
-
description: string;
|
|
18
|
-
instructions: string;
|
|
19
|
-
model: string;
|
|
20
|
-
/**
|
|
21
|
-
* Optional array of fallback model IDs to use when the primary model fails
|
|
22
|
-
*/
|
|
23
|
-
fallbackModels?: Array<string> | undefined;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/** @internal */
|
|
27
|
-
export const PostV2AgentsInternalRequestBody$inboundSchema: z.ZodType<
|
|
28
|
-
PostV2AgentsInternalRequestBody,
|
|
29
|
-
z.ZodTypeDef,
|
|
30
|
-
unknown
|
|
31
|
-
> = z.object({
|
|
32
|
-
path: z.string(),
|
|
33
|
-
key: z.string(),
|
|
34
|
-
description: z.string(),
|
|
35
|
-
instructions: z.string(),
|
|
36
|
-
model: z.string(),
|
|
37
|
-
fallback_models: z.array(z.string()).optional(),
|
|
38
|
-
}).transform((v) => {
|
|
39
|
-
return remap$(v, {
|
|
40
|
-
"fallback_models": "fallbackModels",
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
/** @internal */
|
|
45
|
-
export type PostV2AgentsInternalRequestBody$Outbound = {
|
|
46
|
-
path: string;
|
|
47
|
-
key: string;
|
|
48
|
-
description: string;
|
|
49
|
-
instructions: string;
|
|
50
|
-
model: string;
|
|
51
|
-
fallback_models?: Array<string> | undefined;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/** @internal */
|
|
55
|
-
export const PostV2AgentsInternalRequestBody$outboundSchema: z.ZodType<
|
|
56
|
-
PostV2AgentsInternalRequestBody$Outbound,
|
|
57
|
-
z.ZodTypeDef,
|
|
58
|
-
PostV2AgentsInternalRequestBody
|
|
59
|
-
> = z.object({
|
|
60
|
-
path: z.string(),
|
|
61
|
-
key: z.string(),
|
|
62
|
-
description: z.string(),
|
|
63
|
-
instructions: z.string(),
|
|
64
|
-
model: z.string(),
|
|
65
|
-
fallbackModels: z.array(z.string()).optional(),
|
|
66
|
-
}).transform((v) => {
|
|
67
|
-
return remap$(v, {
|
|
68
|
-
fallbackModels: "fallback_models",
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @internal
|
|
74
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
75
|
-
*/
|
|
76
|
-
export namespace PostV2AgentsInternalRequestBody$ {
|
|
77
|
-
/** @deprecated use `PostV2AgentsInternalRequestBody$inboundSchema` instead. */
|
|
78
|
-
export const inboundSchema = PostV2AgentsInternalRequestBody$inboundSchema;
|
|
79
|
-
/** @deprecated use `PostV2AgentsInternalRequestBody$outboundSchema` instead. */
|
|
80
|
-
export const outboundSchema = PostV2AgentsInternalRequestBody$outboundSchema;
|
|
81
|
-
/** @deprecated use `PostV2AgentsInternalRequestBody$Outbound` instead. */
|
|
82
|
-
export type Outbound = PostV2AgentsInternalRequestBody$Outbound;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function postV2AgentsInternalRequestBodyToJSON(
|
|
86
|
-
postV2AgentsInternalRequestBody: PostV2AgentsInternalRequestBody,
|
|
87
|
-
): string {
|
|
88
|
-
return JSON.stringify(
|
|
89
|
-
PostV2AgentsInternalRequestBody$outboundSchema.parse(
|
|
90
|
-
postV2AgentsInternalRequestBody,
|
|
91
|
-
),
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export function postV2AgentsInternalRequestBodyFromJSON(
|
|
96
|
-
jsonString: string,
|
|
97
|
-
): SafeParseResult<PostV2AgentsInternalRequestBody, SDKValidationError> {
|
|
98
|
-
return safeParse(
|
|
99
|
-
jsonString,
|
|
100
|
-
(x) => PostV2AgentsInternalRequestBody$inboundSchema.parse(JSON.parse(x)),
|
|
101
|
-
`Failed to parse 'PostV2AgentsInternalRequestBody' from JSON`,
|
|
102
|
-
);
|
|
103
|
-
}
|