@orq-ai/node 4.14.6 → 4.14.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/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/evaluatorresponsefunction.js +2 -2
- package/models/components/evaluatorresponsehttp.js +2 -2
- package/models/components/evaluatorresponsejsonschema.js +2 -2
- package/models/components/evaluatorresponsellm.js +2 -2
- package/models/components/evaluatorresponsepython.js +2 -2
- package/models/components/evaluatorresponseragas.js +2 -2
- package/models/components/evaluatorresponsetypescript.js +2 -2
- package/models/components/reasoningpart.js +1 -1
- package/models/operations/createannotationqueue.js +1 -1
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +5 -5
- package/models/operations/createtool.js +4 -4
- package/models/operations/getalltools.js +4 -4
- package/models/operations/geteval.js +16 -16
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/listannotationqueues.js +1 -1
- package/models/operations/listdatasetdatapoints.js +5 -5
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +4 -4
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrieveannotationqueue.js +1 -1
- package/models/operations/retrievedatapoint.js +5 -5
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievetool.js +4 -4
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updateannotationqueue.js +1 -1
- package/models/operations/updatedatapoint.js +5 -5
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatetool.js +4 -4
- package/package.json +1 -1
- package/packages/orq-rc/src/funcs/knowledgePreviewChunks.ts +179 -0
- package/packages/orq-rc/src/funcs/logsListFacets.ts +8 -17
- package/packages/orq-rc/src/funcs/reportingQuery.ts +1 -1
- package/packages/orq-rc/src/funcs/tracesAggregate.ts +1 -1
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/models/components/chunkingconfiguration.ts +432 -4
- package/packages/orq-rc/src/models/components/datasourcesservicepreviewchunksrequest.ts +48 -0
- package/packages/orq-rc/src/models/components/datasourcesservicepreviewchunksresponse.ts +44 -0
- package/packages/orq-rc/src/models/components/getuploadfileurlresponse.ts +5 -0
- package/packages/orq-rc/src/models/components/index.ts +5 -0
- package/packages/orq-rc/src/models/{operations/listlogfacets.ts → components/listlogfacetsrequest.ts} +15 -0
- package/packages/orq-rc/src/models/components/previewchunk.ts +38 -0
- package/packages/orq-rc/src/models/components/previewchunksmetadata.ts +51 -0
- package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
- package/packages/orq-rc/src/models/components/upsertchunk.ts +11 -0
- package/packages/orq-rc/src/models/components/value.ts +4 -0
- package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +5 -5
- package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
- package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
- package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
- package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/packages/orq-rc/src/models/operations/index.ts +1 -1
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +5 -5
- package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
- package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +4 -4
- package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
- package/packages/orq-rc/src/models/operations/previewdatasourcechunks.ts +47 -0
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +5 -5
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
- package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +5 -5
- package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
- package/packages/orq-rc/src/sdk/knowledge.ts +18 -0
- package/packages/orq-rc/src/sdk/logs.ts +2 -2
- package/packages/orq-rc/src/sdk/reporting.ts +1 -1
- package/packages/orq-rc/src/sdk/traces.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/evaluatorresponsefunction.ts +2 -2
- package/src/models/components/evaluatorresponsehttp.ts +2 -2
- package/src/models/components/evaluatorresponsejsonschema.ts +2 -2
- package/src/models/components/evaluatorresponsellm.ts +2 -2
- package/src/models/components/evaluatorresponsepython.ts +2 -2
- package/src/models/components/evaluatorresponseragas.ts +2 -2
- package/src/models/components/evaluatorresponsetypescript.ts +2 -2
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/operations/createannotationqueue.ts +1 -1
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +5 -5
- package/src/models/operations/createtool.ts +4 -4
- package/src/models/operations/getalltools.ts +4 -4
- package/src/models/operations/geteval.ts +16 -16
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/listannotationqueues.ts +1 -1
- package/src/models/operations/listdatasetdatapoints.ts +5 -5
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +4 -4
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrieveannotationqueue.ts +1 -1
- package/src/models/operations/retrievedatapoint.ts +5 -5
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievetool.ts +4 -4
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updateannotationqueue.ts +1 -1
- package/src/models/operations/updatedatapoint.ts +5 -5
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatetool.ts +4 -4
|
@@ -164,7 +164,7 @@ function retrieveToolResponseBodyCodeToolFromJSON(jsonString) {
|
|
|
164
164
|
}
|
|
165
165
|
/** @internal */
|
|
166
166
|
exports.RetrieveToolResponseBodyCodeExecutionTool$inboundSchema = z.object({
|
|
167
|
-
_id: z.string().default("
|
|
167
|
+
_id: z.string().default("tool_01M1MH7V8RWAC5TM67YB38EMYH"),
|
|
168
168
|
path: z.string(),
|
|
169
169
|
key: z.string(),
|
|
170
170
|
display_name: z.string().optional(),
|
|
@@ -253,7 +253,7 @@ function retrieveToolResponseBodyHttpFromJSON(jsonString) {
|
|
|
253
253
|
}
|
|
254
254
|
/** @internal */
|
|
255
255
|
exports.RetrieveToolResponseBodyHTTPTool$inboundSchema = z.object({
|
|
256
|
-
_id: z.string().default("
|
|
256
|
+
_id: z.string().default("tool_01M1MH7V8QWCFPNH379FW1FRZK"),
|
|
257
257
|
path: z.string(),
|
|
258
258
|
key: z.string(),
|
|
259
259
|
display_name: z.string().optional(),
|
|
@@ -303,7 +303,7 @@ function retrieveToolResponseBodyJsonSchemaFromJSON(jsonString) {
|
|
|
303
303
|
}
|
|
304
304
|
/** @internal */
|
|
305
305
|
exports.RetrieveToolResponseBodyJSONSchemaTool$inboundSchema = z.object({
|
|
306
|
-
_id: z.string().default("
|
|
306
|
+
_id: z.string().default("tool_01M1MH7V8PEZ69R6BQWACWB9QF"),
|
|
307
307
|
path: z.string(),
|
|
308
308
|
key: z.string(),
|
|
309
309
|
display_name: z.string().optional(),
|
|
@@ -357,7 +357,7 @@ function retrieveToolResponseBodyFunctionFromJSON(jsonString) {
|
|
|
357
357
|
}
|
|
358
358
|
/** @internal */
|
|
359
359
|
exports.RetrieveToolResponseBodyFunctionTool$inboundSchema = z.object({
|
|
360
|
-
_id: z.string().default("
|
|
360
|
+
_id: z.string().default("tool_01M1MH7V8N7EBRH0RYSEXRTVSR"),
|
|
361
361
|
path: z.string(),
|
|
362
362
|
key: z.string(),
|
|
363
363
|
display_name: z.string().optional(),
|
|
@@ -1106,7 +1106,7 @@ function agentToolInputRunSchemaToJSON(agentToolInputRunSchema) {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
/** @internal */
|
|
1108
1108
|
exports.Tools$outboundSchema = z.object({
|
|
1109
|
-
id: z.string().default("
|
|
1109
|
+
id: z.string().default("01M1MH7V3EF7G7G8ASBTB40ZDW"),
|
|
1110
1110
|
name: z.string(),
|
|
1111
1111
|
description: z.string().optional(),
|
|
1112
1112
|
schema: z.lazy(() => exports.AgentToolInputRunSchema$outboundSchema),
|
|
@@ -1072,7 +1072,7 @@ function streamRunAgentAgentToolInputRunAgentsSchemaToJSON(streamRunAgentAgentTo
|
|
|
1072
1072
|
}
|
|
1073
1073
|
/** @internal */
|
|
1074
1074
|
exports.AgentToolInputRunTools$outboundSchema = z.object({
|
|
1075
|
-
id: z.string().default("
|
|
1075
|
+
id: z.string().default("01M1MH7V4G294XVFWKHSJEFGR4"),
|
|
1076
1076
|
name: z.string(),
|
|
1077
1077
|
description: z.string().optional(),
|
|
1078
1078
|
schema: z.lazy(() => exports.StreamRunAgentAgentToolInputRunAgentsSchema$outboundSchema),
|
|
@@ -98,7 +98,7 @@ exports.UpdateAnnotationQueueResponseBody$inboundSchema = z.object({
|
|
|
98
98
|
updated_by_id: z.nullable(z.string()).optional(),
|
|
99
99
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
100
100
|
.optional(),
|
|
101
|
-
updated: z.string().datetime({ offset: true }).default("2026-
|
|
101
|
+
updated: z.string().datetime({ offset: true }).default("2026-09-03T21:01:38.428Z").transform(v => new Date(v)),
|
|
102
102
|
}).transform((v) => {
|
|
103
103
|
return (0, primitives_js_1.remap)(v, {
|
|
104
104
|
"_id": "id",
|
|
@@ -866,7 +866,7 @@ exports.UpdateDatapointEvaluations4$inboundSchema = z.object({
|
|
|
866
866
|
parent_annotation_id: z.string().optional(),
|
|
867
867
|
explanation: z.string().optional(),
|
|
868
868
|
reviewed_by_id: z.string(),
|
|
869
|
-
reviewed_at: z.string().datetime({ offset: true }).default("2026-
|
|
869
|
+
reviewed_at: z.string().datetime({ offset: true }).default("2026-09-03T21:01:48.754Z").transform(v => new Date(v)),
|
|
870
870
|
type: z.literal("string_array"),
|
|
871
871
|
values: z.array(z.string()),
|
|
872
872
|
}).transform((v) => {
|
|
@@ -917,7 +917,7 @@ exports.UpdateDatapointEvaluations3$inboundSchema = z.object({
|
|
|
917
917
|
parent_annotation_id: z.string().optional(),
|
|
918
918
|
explanation: z.string().optional(),
|
|
919
919
|
reviewed_by_id: z.string(),
|
|
920
|
-
reviewed_at: z.string().datetime({ offset: true }).default("2026-
|
|
920
|
+
reviewed_at: z.string().datetime({ offset: true }).default("2026-09-03T21:01:48.754Z").transform(v => new Date(v)),
|
|
921
921
|
type: z.literal("boolean"),
|
|
922
922
|
value: z.boolean(),
|
|
923
923
|
}).transform((v) => {
|
|
@@ -968,7 +968,7 @@ exports.UpdateDatapointEvaluations2$inboundSchema = z.object({
|
|
|
968
968
|
parent_annotation_id: z.string().optional(),
|
|
969
969
|
explanation: z.string().optional(),
|
|
970
970
|
reviewed_by_id: z.string(),
|
|
971
|
-
reviewed_at: z.string().datetime({ offset: true }).default("2026-
|
|
971
|
+
reviewed_at: z.string().datetime({ offset: true }).default("2026-09-03T21:01:48.753Z").transform(v => new Date(v)),
|
|
972
972
|
type: z.literal("number"),
|
|
973
973
|
value: z.number(),
|
|
974
974
|
}).transform((v) => {
|
|
@@ -1018,7 +1018,7 @@ exports.UpdateDatapointEvaluations1$inboundSchema = z.object({
|
|
|
1018
1018
|
parent_annotation_id: z.string().optional(),
|
|
1019
1019
|
explanation: z.string().optional(),
|
|
1020
1020
|
reviewed_by_id: z.string(),
|
|
1021
|
-
reviewed_at: z.string().datetime({ offset: true }).default("2026-
|
|
1021
|
+
reviewed_at: z.string().datetime({ offset: true }).default("2026-09-03T21:01:48.753Z").transform(v => new Date(v)),
|
|
1022
1022
|
type: z.literal("string"),
|
|
1023
1023
|
value: z.string(),
|
|
1024
1024
|
}).transform((v) => {
|
|
@@ -1069,7 +1069,7 @@ exports.UpdateDatapointResponseBody$inboundSchema = z.object({
|
|
|
1069
1069
|
updated_by_id: z.nullable(z.string()).optional(),
|
|
1070
1070
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
1071
1071
|
.optional(),
|
|
1072
|
-
updated: z.string().datetime({ offset: true }).default("2026-
|
|
1072
|
+
updated: z.string().datetime({ offset: true }).default("2026-09-03T21:01:38.428Z").transform(v => new Date(v)),
|
|
1073
1073
|
}).transform((v) => {
|
|
1074
1074
|
return (0, primitives_js_1.remap)(v, {
|
|
1075
1075
|
"_id": "id",
|
|
@@ -95,7 +95,7 @@ exports.UpdateDatasetResponseBody$inboundSchema = z.object({
|
|
|
95
95
|
updated_by_id: z.nullable(z.string()).optional(),
|
|
96
96
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
97
97
|
.optional(),
|
|
98
|
-
updated: z.string().datetime({ offset: true }).default("2026-
|
|
98
|
+
updated: z.string().datetime({ offset: true }).default("2026-09-03T21:01:38.428Z").transform(v => new Date(v)),
|
|
99
99
|
}).transform((v) => {
|
|
100
100
|
return (0, primitives_js_1.remap)(v, {
|
|
101
101
|
"_id": "id",
|
|
@@ -536,7 +536,7 @@ function updateToolResponseBodyCodeToolFromJSON(jsonString) {
|
|
|
536
536
|
}
|
|
537
537
|
/** @internal */
|
|
538
538
|
exports.UpdateToolResponseBodyCodeExecutionTool$inboundSchema = z.object({
|
|
539
|
-
_id: z.string().default("
|
|
539
|
+
_id: z.string().default("tool_01M1MH7V88RKEMZ8T192Y3C1B1"),
|
|
540
540
|
path: z.string(),
|
|
541
541
|
key: z.string(),
|
|
542
542
|
display_name: z.string().optional(),
|
|
@@ -625,7 +625,7 @@ function updateToolResponseBodyHttpFromJSON(jsonString) {
|
|
|
625
625
|
}
|
|
626
626
|
/** @internal */
|
|
627
627
|
exports.UpdateToolResponseBodyHTTPTool$inboundSchema = z.object({
|
|
628
|
-
_id: z.string().default("
|
|
628
|
+
_id: z.string().default("tool_01M1MH7V83X26EJK13HYR2DZZK"),
|
|
629
629
|
path: z.string(),
|
|
630
630
|
key: z.string(),
|
|
631
631
|
display_name: z.string().optional(),
|
|
@@ -675,7 +675,7 @@ function updateToolResponseBodyJsonSchemaFromJSON(jsonString) {
|
|
|
675
675
|
}
|
|
676
676
|
/** @internal */
|
|
677
677
|
exports.UpdateToolResponseBodyJSONSchemaTool$inboundSchema = z.object({
|
|
678
|
-
_id: z.string().default("
|
|
678
|
+
_id: z.string().default("tool_01M1MH7V82F5Q2E03HC9R6B8VP"),
|
|
679
679
|
path: z.string(),
|
|
680
680
|
key: z.string(),
|
|
681
681
|
display_name: z.string().optional(),
|
|
@@ -729,7 +729,7 @@ function updateToolResponseBodyFunctionFromJSON(jsonString) {
|
|
|
729
729
|
}
|
|
730
730
|
/** @internal */
|
|
731
731
|
exports.UpdateToolResponseBodyFunctionTool$inboundSchema = z.object({
|
|
732
|
-
_id: z.string().default("
|
|
732
|
+
_id: z.string().default("tool_01M1MH7V81JV1WQGS6PB8YW8XP"),
|
|
733
733
|
path: z.string(),
|
|
734
734
|
key: z.string(),
|
|
735
735
|
display_name: z.string().optional(),
|
package/package.json
CHANGED
|
@@ -0,0 +1,179 @@
|
|
|
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 { matchStatusCode } from "../lib/http.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 * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Preview datasource chunks
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Parses an uploaded file and returns the chunks it would produce for the given chunking options without creating a datasource.
|
|
34
|
+
*/
|
|
35
|
+
export function knowledgePreviewChunks(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request: operations.PreviewDatasourceChunksRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
components.DatasourcesServicePreviewChunksResponse,
|
|
42
|
+
| OrqError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
>
|
|
51
|
+
> {
|
|
52
|
+
return new APIPromise($do(
|
|
53
|
+
client,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: OrqCore,
|
|
61
|
+
request: operations.PreviewDatasourceChunksRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
components.DatasourcesServicePreviewChunksResponse,
|
|
67
|
+
| OrqError
|
|
68
|
+
| ResponseValidationError
|
|
69
|
+
| ConnectionError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| InvalidRequestError
|
|
73
|
+
| UnexpectedClientError
|
|
74
|
+
| SDKValidationError
|
|
75
|
+
>,
|
|
76
|
+
APICall,
|
|
77
|
+
]
|
|
78
|
+
> {
|
|
79
|
+
const parsed = safeParse(
|
|
80
|
+
request,
|
|
81
|
+
(value) =>
|
|
82
|
+
operations.PreviewDatasourceChunksRequest$outboundSchema.parse(value),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = encodeJSON(
|
|
90
|
+
"body",
|
|
91
|
+
payload.DatasourcesServicePreviewChunksRequest,
|
|
92
|
+
{ explode: true },
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const pathParams = {
|
|
96
|
+
knowledge_id: encodeSimple("knowledge_id", payload.knowledge_id, {
|
|
97
|
+
explode: false,
|
|
98
|
+
charEncoding: "percent",
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
const path = pathToFunc(
|
|
102
|
+
"/v2/knowledge/{knowledge_id}/datasources/preview-chunks",
|
|
103
|
+
)(pathParams);
|
|
104
|
+
|
|
105
|
+
const headers = new Headers(compactMap({
|
|
106
|
+
"Content-Type": "application/json",
|
|
107
|
+
Accept: "application/json",
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
111
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
112
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
113
|
+
|
|
114
|
+
const context = {
|
|
115
|
+
options: client._options,
|
|
116
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
117
|
+
operationID: "PreviewDatasourceChunks",
|
|
118
|
+
oAuth2Scopes: null,
|
|
119
|
+
|
|
120
|
+
resolvedSecurity: requestSecurity,
|
|
121
|
+
|
|
122
|
+
securitySource: client._options.apiKey,
|
|
123
|
+
retryConfig: options?.retries
|
|
124
|
+
|| client._options.retryConfig
|
|
125
|
+
|| { strategy: "none" },
|
|
126
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const requestRes = client._createRequest(context, {
|
|
130
|
+
security: requestSecurity,
|
|
131
|
+
method: "POST",
|
|
132
|
+
baseURL: options?.serverURL,
|
|
133
|
+
path: path,
|
|
134
|
+
headers: headers,
|
|
135
|
+
body: body,
|
|
136
|
+
userAgent: client._options.userAgent,
|
|
137
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
138
|
+
}, options);
|
|
139
|
+
if (!requestRes.ok) {
|
|
140
|
+
return [requestRes, { status: "invalid" }];
|
|
141
|
+
}
|
|
142
|
+
const req = requestRes.value;
|
|
143
|
+
|
|
144
|
+
const doResult = await client._do(req, {
|
|
145
|
+
context,
|
|
146
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
147
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
148
|
+
retryConfig: context.retryConfig,
|
|
149
|
+
retryCodes: context.retryCodes,
|
|
150
|
+
});
|
|
151
|
+
if (!doResult.ok) {
|
|
152
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
|
+
}
|
|
154
|
+
const response = doResult.value;
|
|
155
|
+
|
|
156
|
+
const [result] = await M.match<
|
|
157
|
+
components.DatasourcesServicePreviewChunksResponse,
|
|
158
|
+
| OrqError
|
|
159
|
+
| ResponseValidationError
|
|
160
|
+
| ConnectionError
|
|
161
|
+
| RequestAbortedError
|
|
162
|
+
| RequestTimeoutError
|
|
163
|
+
| InvalidRequestError
|
|
164
|
+
| UnexpectedClientError
|
|
165
|
+
| SDKValidationError
|
|
166
|
+
>(
|
|
167
|
+
M.json(
|
|
168
|
+
200,
|
|
169
|
+
components.DatasourcesServicePreviewChunksResponse$inboundSchema,
|
|
170
|
+
),
|
|
171
|
+
M.fail("4XX"),
|
|
172
|
+
M.fail("5XX"),
|
|
173
|
+
)(response, req);
|
|
174
|
+
if (!result.ok) {
|
|
175
|
+
return [result, { status: "complete", request: req, response }];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return [result, { status: "complete", request: req, response }];
|
|
179
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { OrqCore } from "../core.js";
|
|
6
|
-
import {
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
8
8
|
import * as M from "../lib/matchers.js";
|
|
9
9
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
23
|
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
24
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
-
import * as operations from "../models/operations/index.js";
|
|
26
25
|
import { APICall, APIPromise } from "../types/async.js";
|
|
27
26
|
import { Result } from "../types/fp.js";
|
|
28
27
|
|
|
@@ -30,11 +29,11 @@ import { Result } from "../types/fp.js";
|
|
|
30
29
|
* List log facets
|
|
31
30
|
*
|
|
32
31
|
* @remarks
|
|
33
|
-
* Return the facet hierarchy: attribute families (native, attribute, resource, scope) with their keys, counts, and top values
|
|
32
|
+
* Return the facet hierarchy: attribute families (native, attribute, resource, scope) with their keys, counts, and top values. Accepts optional filters and free-text query to narrow the counted subset.
|
|
34
33
|
*/
|
|
35
34
|
export function logsListFacets(
|
|
36
35
|
client: OrqCore,
|
|
37
|
-
request
|
|
36
|
+
request: components.ListLogFacetsRequest,
|
|
38
37
|
options?: RequestOptions,
|
|
39
38
|
): APIPromise<
|
|
40
39
|
Result<
|
|
@@ -58,7 +57,7 @@ export function logsListFacets(
|
|
|
58
57
|
|
|
59
58
|
async function $do(
|
|
60
59
|
client: OrqCore,
|
|
61
|
-
request
|
|
60
|
+
request: components.ListLogFacetsRequest,
|
|
62
61
|
options?: RequestOptions,
|
|
63
62
|
): Promise<
|
|
64
63
|
[
|
|
@@ -78,26 +77,19 @@ async function $do(
|
|
|
78
77
|
> {
|
|
79
78
|
const parsed = safeParse(
|
|
80
79
|
request,
|
|
81
|
-
(value) =>
|
|
82
|
-
operations.ListLogFacetsRequest$outboundSchema.optional().parse(value),
|
|
80
|
+
(value) => components.ListLogFacetsRequest$outboundSchema.parse(value),
|
|
83
81
|
"Input validation failed",
|
|
84
82
|
);
|
|
85
83
|
if (!parsed.ok) {
|
|
86
84
|
return [parsed, { status: "invalid" }];
|
|
87
85
|
}
|
|
88
86
|
const payload = parsed.value;
|
|
89
|
-
const body =
|
|
87
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
90
88
|
|
|
91
89
|
const path = pathToFunc("/v3/logs/facets")();
|
|
92
90
|
|
|
93
|
-
const query = encodeFormQuery({
|
|
94
|
-
"from": payload?.from,
|
|
95
|
-
"key_limit": payload?.key_limit,
|
|
96
|
-
"to": payload?.to,
|
|
97
|
-
"value_limit": payload?.value_limit,
|
|
98
|
-
});
|
|
99
|
-
|
|
100
91
|
const headers = new Headers(compactMap({
|
|
92
|
+
"Content-Type": "application/json",
|
|
101
93
|
Accept: "application/json",
|
|
102
94
|
}));
|
|
103
95
|
|
|
@@ -122,11 +114,10 @@ async function $do(
|
|
|
122
114
|
|
|
123
115
|
const requestRes = client._createRequest(context, {
|
|
124
116
|
security: requestSecurity,
|
|
125
|
-
method: "
|
|
117
|
+
method: "POST",
|
|
126
118
|
baseURL: options?.serverURL,
|
|
127
119
|
path: path,
|
|
128
120
|
headers: headers,
|
|
129
|
-
query: query,
|
|
130
121
|
body: body,
|
|
131
122
|
userAgent: client._options.userAgent,
|
|
132
123
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
* Query reporting metrics
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Returns time-series, scalar, and top-list analytics for AI usage, cost, latency, evaluator results, and guardrail outcomes.
|
|
32
|
+
* Returns time-series, scalar, and top-list analytics for AI usage, cost, latency, evaluator results, and guardrail outcomes.
|
|
33
33
|
*/
|
|
34
34
|
export function reportingQuery(
|
|
35
35
|
client: OrqCore,
|
|
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
* Aggregate traces
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Aggregate trace metrics using the structured trace filter contract.
|
|
32
|
+
* Aggregate trace metrics using the structured trace filter contract.
|
|
33
33
|
*/
|
|
34
34
|
export function tracesAggregate(
|
|
35
35
|
client: OrqCore,
|
|
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
58
58
|
export const SDK_METADATA = {
|
|
59
59
|
language: "typescript",
|
|
60
60
|
openapiDocVersion: "2.0",
|
|
61
|
-
sdkVersion: "4.15.0-rc.
|
|
62
|
-
genVersion: "2.
|
|
63
|
-
userAgent: "speakeasy-sdk/typescript 4.15.0-rc.
|
|
61
|
+
sdkVersion: "4.15.0-rc.19",
|
|
62
|
+
genVersion: "2.935.1",
|
|
63
|
+
userAgent: "speakeasy-sdk/typescript 4.15.0-rc.19 2.935.1 2.0 @orq-ai/node",
|
|
64
64
|
} as const;
|