@orq-ai/node 4.15.0-rc.22 → 4.15.0-rc.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -28
- package/funcs/hubGet.d.ts +18 -0
- package/funcs/hubGet.d.ts.map +1 -0
- package/funcs/hubGet.js +121 -0
- package/funcs/hubGet.js.map +1 -0
- package/funcs/hubSearch.d.ts +18 -0
- package/funcs/hubSearch.d.ts.map +1 -0
- package/funcs/hubSearch.js +120 -0
- package/funcs/hubSearch.js.map +1 -0
- package/funcs/sessionsCreate.d.ts +17 -0
- package/funcs/sessionsCreate.d.ts.map +1 -0
- package/funcs/sessionsCreate.js +115 -0
- package/funcs/sessionsCreate.js.map +1 -0
- package/funcs/sessionsDelete.d.ts +17 -0
- package/funcs/sessionsDelete.d.ts.map +1 -0
- package/funcs/sessionsDelete.js +121 -0
- package/funcs/sessionsDelete.js.map +1 -0
- package/funcs/sessionsGet.d.ts +18 -0
- package/funcs/sessionsGet.d.ts.map +1 -0
- package/funcs/sessionsGet.js +121 -0
- package/funcs/sessionsGet.js.map +1 -0
- package/funcs/sessionsGetCount.d.ts +17 -0
- package/funcs/sessionsGetCount.d.ts.map +1 -0
- package/funcs/sessionsGetCount.js +115 -0
- package/funcs/sessionsGetCount.js.map +1 -0
- package/funcs/sessionsList.d.ts +17 -0
- package/funcs/sessionsList.d.ts.map +1 -0
- package/funcs/sessionsList.js +115 -0
- package/funcs/sessionsList.js.map +1 -0
- package/funcs/sessionsListTags.d.ts +16 -0
- package/funcs/sessionsListTags.d.ts.map +1 -0
- package/funcs/sessionsListTags.js +105 -0
- package/funcs/sessionsListTags.js.map +1 -0
- package/funcs/sessionsUpdate.d.ts +18 -0
- package/funcs/sessionsUpdate.d.ts.map +1 -0
- package/funcs/sessionsUpdate.js +124 -0
- package/funcs/sessionsUpdate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/agentresponserequest.d.ts +6 -6
- package/models/components/agentresponserequest.d.ts.map +1 -1
- package/models/components/agentresponserequest.js +6 -6
- package/models/components/agentresponserequest.js.map +1 -1
- package/models/components/createthreadrequest.d.ts +41 -0
- package/models/components/createthreadrequest.d.ts.map +1 -0
- package/models/components/createthreadrequest.js +75 -0
- package/models/components/createthreadrequest.js.map +1 -0
- package/models/components/gethubitemresponse.d.ts +11 -0
- package/models/components/gethubitemresponse.d.ts.map +1 -0
- package/models/components/gethubitemresponse.js +56 -0
- package/models/components/gethubitemresponse.js.map +1 -0
- package/models/components/getthreadcountrequest.d.ts +17 -0
- package/models/components/getthreadcountrequest.d.ts.map +1 -0
- package/models/components/getthreadcountrequest.js +52 -0
- package/models/components/getthreadcountrequest.js.map +1 -0
- package/models/components/getthreadcountresponse.d.ts +10 -0
- package/models/components/getthreadcountresponse.d.ts.map +1 -0
- package/models/components/getthreadcountresponse.js +50 -0
- package/models/components/getthreadcountresponse.js.map +1 -0
- package/models/components/hubitem.d.ts +71 -0
- package/models/components/hubitem.d.ts.map +1 -0
- package/models/components/hubitem.js +83 -0
- package/models/components/hubitem.js.map +1 -0
- package/models/components/hubitemsummary.d.ts +29 -0
- package/models/components/hubitemsummary.d.ts.map +1 -0
- package/models/components/hubitemsummary.js +60 -0
- package/models/components/hubitemsummary.js.map +1 -0
- package/models/components/hubsearchhit.d.ts +11 -0
- package/models/components/hubsearchhit.d.ts.map +1 -0
- package/models/components/hubsearchhit.js +51 -0
- package/models/components/hubsearchhit.js.map +1 -0
- package/models/components/index.d.ts +18 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +18 -0
- package/models/components/index.js.map +1 -1
- package/models/components/listthreadsrequest.d.ts +17 -0
- package/models/components/listthreadsrequest.d.ts.map +1 -0
- package/models/components/listthreadsrequest.js +52 -0
- package/models/components/listthreadsrequest.js.map +1 -0
- package/models/components/listthreadsresponse.d.ts +13 -0
- package/models/components/listthreadsresponse.d.ts.map +1 -0
- package/models/components/listthreadsresponse.js +58 -0
- package/models/components/listthreadsresponse.js.map +1 -0
- package/models/components/openaipromptcacheoptions.d.ts +37 -0
- package/models/components/openaipromptcacheoptions.d.ts.map +1 -0
- package/models/components/openaipromptcacheoptions.js +75 -0
- package/models/components/openaipromptcacheoptions.js.map +1 -0
- package/models/components/publicresponseresource.d.ts +2 -0
- package/models/components/publicresponseresource.d.ts.map +1 -1
- package/models/components/publicresponseresource.js +3 -0
- package/models/components/publicresponseresource.js.map +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/components/searchhubitemsresponse.d.ts +11 -0
- package/models/components/searchhubitemsresponse.d.ts.map +1 -0
- package/models/components/searchhubitemsresponse.js +51 -0
- package/models/components/searchhubitemsresponse.js.map +1 -0
- package/models/components/sessioninterval.d.ts +19 -0
- package/models/components/sessioninterval.d.ts.map +1 -0
- package/models/components/sessioninterval.js +56 -0
- package/models/components/sessioninterval.js.map +1 -0
- package/models/components/textcontentpartschema.d.ts +5 -5
- package/models/components/textcontentpartschema.d.ts.map +1 -1
- package/models/components/textcontentpartschema.js +6 -6
- package/models/components/textcontentpartschema.js.map +1 -1
- package/models/components/thread.d.ts +54 -0
- package/models/components/thread.d.ts.map +1 -0
- package/models/components/thread.js +79 -0
- package/models/components/thread.js.map +1 -0
- package/models/components/threadbilling.d.ts +21 -0
- package/models/components/threadbilling.d.ts.map +1 -0
- package/models/components/threadbilling.js +75 -0
- package/models/components/threadbilling.js.map +1 -0
- package/models/components/threadfilters.d.ts +34 -0
- package/models/components/threadfilters.d.ts.map +1 -0
- package/models/components/threadfilters.js +65 -0
- package/models/components/threadfilters.js.map +1 -0
- package/models/components/threadkind.d.ts +13 -0
- package/models/components/threadkind.d.ts.map +1 -0
- package/models/components/threadkind.js +51 -0
- package/models/components/threadkind.js.map +1 -0
- package/models/components/threadusage.d.ts +21 -0
- package/models/components/threadusage.d.ts.map +1 -0
- package/models/components/threadusage.js +75 -0
- package/models/components/threadusage.js.map +1 -0
- package/models/components/updatethreadrequest.d.ts +51 -0
- package/models/components/updatethreadrequest.d.ts.map +1 -0
- package/models/components/updatethreadrequest.js +79 -0
- package/models/components/updatethreadrequest.js.map +1 -0
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +5 -5
- package/models/operations/createrouterresponse.d.ts +80 -8
- package/models/operations/createrouterresponse.d.ts.map +1 -1
- package/models/operations/createrouterresponse.js +48 -5
- package/models/operations/createrouterresponse.js.map +1 -1
- package/models/operations/createtool.js +4 -4
- package/models/operations/deletesession.d.ts +12 -0
- package/models/operations/deletesession.d.ts.map +1 -0
- package/models/operations/deletesession.js +54 -0
- package/models/operations/deletesession.js.map +1 -0
- package/models/operations/getalltools.js +4 -4
- package/models/operations/getsession.d.ts +12 -0
- package/models/operations/getsession.d.ts.map +1 -0
- package/models/operations/getsession.js +54 -0
- package/models/operations/getsession.js.map +1 -0
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/hubget.d.ts +12 -0
- package/models/operations/hubget.d.ts.map +1 -0
- package/models/operations/hubget.js +49 -0
- package/models/operations/hubget.js.map +1 -0
- package/models/operations/hubsearch.d.ts +14 -0
- package/models/operations/hubsearch.d.ts.map +1 -0
- package/models/operations/hubsearch.js +50 -0
- package/models/operations/hubsearch.js.map +1 -0
- package/models/operations/index.d.ts +5 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listdatasetdatapoints.js +5 -5
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/modelcreateopenailike.d.ts +4 -0
- package/models/operations/modelcreateopenailike.d.ts.map +1 -1
- package/models/operations/modelcreateopenailike.js +4 -0
- package/models/operations/modelcreateopenailike.js.map +1 -1
- package/models/operations/modelupdateopenailike.d.ts +4 -0
- package/models/operations/modelupdateopenailike.d.ts.map +1 -1
- package/models/operations/modelupdateopenailike.js +4 -0
- package/models/operations/modelupdateopenailike.js.map +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/postv2routerocr.d.ts +24 -0
- package/models/operations/postv2routerocr.d.ts.map +1 -1
- package/models/operations/postv2routerocr.js +12 -0
- package/models/operations/postv2routerocr.js.map +1 -1
- package/models/operations/retrievedatapoint.js +5 -5
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrieveresponse.d.ts +1 -0
- package/models/operations/retrieveresponse.d.ts.map +1 -1
- package/models/operations/retrieveresponse.js +2 -0
- package/models/operations/retrieveresponse.js.map +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/updatedatapoint.js +5 -5
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatesession.d.ts +15 -0
- package/models/operations/updatesession.d.ts.map +1 -0
- package/models/operations/updatesession.js +57 -0
- package/models/operations/updatesession.js.map +1 -0
- package/models/operations/updatetool.js +4 -4
- package/package.json +1 -1
- package/sdk/hub.d.ts +20 -0
- package/sdk/hub.d.ts.map +1 -0
- package/sdk/hub.js +32 -0
- package/sdk/hub.js.map +1 -0
- package/sdk/sdk.d.ts +6 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +8 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/sessions.d.ts +55 -0
- package/sdk/sessions.d.ts.map +1 -0
- package/sdk/sessions.js +82 -0
- package/sdk/sessions.js.map +1 -0
- package/src/funcs/hubGet.ts +168 -0
- package/src/funcs/hubSearch.ts +169 -0
- package/src/funcs/sessionsCreate.ts +162 -0
- package/src/funcs/sessionsDelete.ts +168 -0
- package/src/funcs/sessionsGet.ts +168 -0
- package/src/funcs/sessionsGetCount.ts +162 -0
- package/src/funcs/sessionsList.ts +162 -0
- package/src/funcs/sessionsListTags.ts +144 -0
- package/src/funcs/sessionsUpdate.ts +171 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/agentresponserequest.ts +14 -10
- package/src/models/components/createthreadrequest.ts +91 -0
- package/src/models/components/gethubitemresponse.ts +37 -0
- package/src/models/components/getthreadcountrequest.ts +42 -0
- package/src/models/components/getthreadcountresponse.ts +31 -0
- package/src/models/components/hubitem.ts +136 -0
- package/src/models/components/hubitemsummary.ts +60 -0
- package/src/models/components/hubsearchhit.ts +35 -0
- package/src/models/components/index.ts +18 -0
- package/src/models/components/listthreadsrequest.ts +42 -0
- package/src/models/components/listthreadsresponse.ts +41 -0
- package/src/models/components/openaipromptcacheoptions.ts +84 -0
- package/src/models/components/publicresponseresource.ts +7 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/components/searchhubitemsresponse.ts +32 -0
- package/src/models/components/sessioninterval.ts +26 -0
- package/src/models/components/textcontentpartschema.ts +13 -8
- package/src/models/components/thread.ts +101 -0
- package/src/models/components/threadbilling.ts +68 -0
- package/src/models/components/threadfilters.ts +66 -0
- package/src/models/components/threadkind.ts +20 -0
- package/src/models/components/threadusage.ts +68 -0
- package/src/models/components/updatethreadrequest.ts +105 -0
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +5 -5
- package/src/models/operations/createrouterresponse.ts +128 -9
- package/src/models/operations/createtool.ts +4 -4
- package/src/models/operations/deletesession.ts +36 -0
- package/src/models/operations/getalltools.ts +4 -4
- package/src/models/operations/getsession.ts +36 -0
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/hubget.ts +27 -0
- package/src/models/operations/hubsearch.ts +34 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/listdatasetdatapoints.ts +5 -5
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/modelcreateopenailike.ts +8 -0
- package/src/models/operations/modelupdateopenailike.ts +8 -0
- 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/postv2routerocr.ts +36 -0
- package/src/models/operations/retrievedatapoint.ts +5 -5
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrieveresponse.ts +5 -0
- 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/updatedatapoint.ts +5 -5
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatesession.ts +41 -0
- package/src/models/operations/updatetool.ts +4 -4
- package/src/sdk/hub.ts +46 -0
- package/src/sdk/sdk.ts +12 -0
- package/src/sdk/sessions.ts +134 -0
|
@@ -43,7 +43,7 @@ export type TextContentPartSchemaType = ClosedEnum<
|
|
|
43
43
|
*
|
|
44
44
|
* Defaults to `5m`. Only supported by `Anthropic` Claude models.
|
|
45
45
|
*/
|
|
46
|
-
export const
|
|
46
|
+
export const TextContentPartSchemaTtl = {
|
|
47
47
|
Fivem: "5m",
|
|
48
48
|
Oneh: "1h",
|
|
49
49
|
} as const;
|
|
@@ -57,7 +57,9 @@ export const Ttl = {
|
|
|
57
57
|
*
|
|
58
58
|
* Defaults to `5m`. Only supported by `Anthropic` Claude models.
|
|
59
59
|
*/
|
|
60
|
-
export type
|
|
60
|
+
export type TextContentPartSchemaTtl = ClosedEnum<
|
|
61
|
+
typeof TextContentPartSchemaTtl
|
|
62
|
+
>;
|
|
61
63
|
|
|
62
64
|
export type CacheControl = {
|
|
63
65
|
/**
|
|
@@ -74,7 +76,7 @@ export type CacheControl = {
|
|
|
74
76
|
*
|
|
75
77
|
* Defaults to `5m`. Only supported by `Anthropic` Claude models.
|
|
76
78
|
*/
|
|
77
|
-
ttl?:
|
|
79
|
+
ttl?: TextContentPartSchemaTtl | undefined;
|
|
78
80
|
};
|
|
79
81
|
|
|
80
82
|
/**
|
|
@@ -110,10 +112,13 @@ export const TextContentPartSchemaType$outboundSchema: z.ZodNativeEnum<
|
|
|
110
112
|
> = TextContentPartSchemaType$inboundSchema;
|
|
111
113
|
|
|
112
114
|
/** @internal */
|
|
113
|
-
export const
|
|
115
|
+
export const TextContentPartSchemaTtl$inboundSchema: z.ZodNativeEnum<
|
|
116
|
+
typeof TextContentPartSchemaTtl
|
|
117
|
+
> = z.nativeEnum(TextContentPartSchemaTtl);
|
|
114
118
|
/** @internal */
|
|
115
|
-
export const
|
|
116
|
-
|
|
119
|
+
export const TextContentPartSchemaTtl$outboundSchema: z.ZodNativeEnum<
|
|
120
|
+
typeof TextContentPartSchemaTtl
|
|
121
|
+
> = TextContentPartSchemaTtl$inboundSchema;
|
|
117
122
|
|
|
118
123
|
/** @internal */
|
|
119
124
|
export const CacheControl$inboundSchema: z.ZodType<
|
|
@@ -122,7 +127,7 @@ export const CacheControl$inboundSchema: z.ZodType<
|
|
|
122
127
|
unknown
|
|
123
128
|
> = z.object({
|
|
124
129
|
type: TextContentPartSchemaType$inboundSchema,
|
|
125
|
-
ttl:
|
|
130
|
+
ttl: TextContentPartSchemaTtl$inboundSchema.default("5m"),
|
|
126
131
|
});
|
|
127
132
|
/** @internal */
|
|
128
133
|
export type CacheControl$Outbound = {
|
|
@@ -137,7 +142,7 @@ export const CacheControl$outboundSchema: z.ZodType<
|
|
|
137
142
|
CacheControl
|
|
138
143
|
> = z.object({
|
|
139
144
|
type: TextContentPartSchemaType$outboundSchema,
|
|
140
|
-
ttl:
|
|
145
|
+
ttl: TextContentPartSchemaTtl$outboundSchema.default("5m"),
|
|
141
146
|
});
|
|
142
147
|
|
|
143
148
|
export function cacheControlToJSON(cacheControl: CacheControl): string {
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
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
|
+
import { ThreadBilling, ThreadBilling$inboundSchema } from "./threadbilling.js";
|
|
11
|
+
import { ThreadKind, ThreadKind$inboundSchema } from "./threadkind.js";
|
|
12
|
+
import { ThreadUsage, ThreadUsage$inboundSchema } from "./threadusage.js";
|
|
13
|
+
|
|
14
|
+
export type Thread = {
|
|
15
|
+
/**
|
|
16
|
+
* Internal thread record ID.
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
/**
|
|
20
|
+
* Client-provided thread identifier used to group related traces.
|
|
21
|
+
*/
|
|
22
|
+
externalId: string;
|
|
23
|
+
/**
|
|
24
|
+
* Total thread duration in milliseconds.
|
|
25
|
+
*/
|
|
26
|
+
duration: number;
|
|
27
|
+
/**
|
|
28
|
+
* Contact IDs associated with the thread.
|
|
29
|
+
*/
|
|
30
|
+
contactIds: Array<string>;
|
|
31
|
+
billing: ThreadBilling;
|
|
32
|
+
usage: ThreadUsage;
|
|
33
|
+
/**
|
|
34
|
+
* Number of traces associated with the thread.
|
|
35
|
+
*/
|
|
36
|
+
tracesCount: number;
|
|
37
|
+
/**
|
|
38
|
+
* Tags used to categorize the thread.
|
|
39
|
+
*/
|
|
40
|
+
tags: Array<string>;
|
|
41
|
+
projectId?: string | undefined;
|
|
42
|
+
startedAt?: Date | undefined;
|
|
43
|
+
updatedAt?: Date | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Display title. Does not replace external_id and is not used to group traces.
|
|
46
|
+
*/
|
|
47
|
+
title?: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Originating coding assistant or client, such as claude-code, cursor, or codex.
|
|
50
|
+
*/
|
|
51
|
+
client?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Canonical git repository for a coding-agent thread, such as github.com/org/repo.
|
|
54
|
+
*/
|
|
55
|
+
repo?: string | undefined;
|
|
56
|
+
kind?: ThreadKind | undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const Thread$inboundSchema: z.ZodType<Thread, z.ZodTypeDef, unknown> = z
|
|
61
|
+
.object({
|
|
62
|
+
_id: z.string(),
|
|
63
|
+
external_id: z.string(),
|
|
64
|
+
duration: z.number(),
|
|
65
|
+
contact_ids: z.array(z.string()),
|
|
66
|
+
billing: ThreadBilling$inboundSchema,
|
|
67
|
+
usage: ThreadUsage$inboundSchema,
|
|
68
|
+
traces_count: z.number().int(),
|
|
69
|
+
tags: z.array(z.string()),
|
|
70
|
+
project_id: z.string().optional(),
|
|
71
|
+
started_at: z.string().datetime({ offset: true }).transform(v =>
|
|
72
|
+
new Date(v)
|
|
73
|
+
).optional(),
|
|
74
|
+
updated_at: z.string().datetime({ offset: true }).transform(v =>
|
|
75
|
+
new Date(v)
|
|
76
|
+
).optional(),
|
|
77
|
+
title: z.string().optional(),
|
|
78
|
+
client: z.string().optional(),
|
|
79
|
+
repo: z.string().optional(),
|
|
80
|
+
kind: ThreadKind$inboundSchema.optional(),
|
|
81
|
+
}).transform((v) => {
|
|
82
|
+
return remap$(v, {
|
|
83
|
+
"_id": "id",
|
|
84
|
+
"external_id": "externalId",
|
|
85
|
+
"contact_ids": "contactIds",
|
|
86
|
+
"traces_count": "tracesCount",
|
|
87
|
+
"project_id": "projectId",
|
|
88
|
+
"started_at": "startedAt",
|
|
89
|
+
"updated_at": "updatedAt",
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export function threadFromJSON(
|
|
94
|
+
jsonString: string,
|
|
95
|
+
): SafeParseResult<Thread, SDKValidationError> {
|
|
96
|
+
return safeParse(
|
|
97
|
+
jsonString,
|
|
98
|
+
(x) => Thread$inboundSchema.parse(JSON.parse(x)),
|
|
99
|
+
`Failed to parse 'Thread' from JSON`,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
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 ThreadBilling = {
|
|
12
|
+
inputCost: number;
|
|
13
|
+
outputCost: number;
|
|
14
|
+
totalCost: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ThreadBilling$inboundSchema: z.ZodType<
|
|
19
|
+
ThreadBilling,
|
|
20
|
+
z.ZodTypeDef,
|
|
21
|
+
unknown
|
|
22
|
+
> = z.object({
|
|
23
|
+
input_cost: z.number(),
|
|
24
|
+
output_cost: z.number(),
|
|
25
|
+
total_cost: z.number(),
|
|
26
|
+
}).transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
"input_cost": "inputCost",
|
|
29
|
+
"output_cost": "outputCost",
|
|
30
|
+
"total_cost": "totalCost",
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type ThreadBilling$Outbound = {
|
|
35
|
+
input_cost: number;
|
|
36
|
+
output_cost: number;
|
|
37
|
+
total_cost: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ThreadBilling$outboundSchema: z.ZodType<
|
|
42
|
+
ThreadBilling$Outbound,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
ThreadBilling
|
|
45
|
+
> = z.object({
|
|
46
|
+
inputCost: z.number(),
|
|
47
|
+
outputCost: z.number(),
|
|
48
|
+
totalCost: z.number(),
|
|
49
|
+
}).transform((v) => {
|
|
50
|
+
return remap$(v, {
|
|
51
|
+
inputCost: "input_cost",
|
|
52
|
+
outputCost: "output_cost",
|
|
53
|
+
totalCost: "total_cost",
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export function threadBillingToJSON(threadBilling: ThreadBilling): string {
|
|
58
|
+
return JSON.stringify(ThreadBilling$outboundSchema.parse(threadBilling));
|
|
59
|
+
}
|
|
60
|
+
export function threadBillingFromJSON(
|
|
61
|
+
jsonString: string,
|
|
62
|
+
): SafeParseResult<ThreadBilling, SDKValidationError> {
|
|
63
|
+
return safeParse(
|
|
64
|
+
jsonString,
|
|
65
|
+
(x) => ThreadBilling$inboundSchema.parse(JSON.parse(x)),
|
|
66
|
+
`Failed to parse 'ThreadBilling' from JSON`,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
SessionInterval,
|
|
9
|
+
SessionInterval$outboundSchema,
|
|
10
|
+
} from "./sessioninterval.js";
|
|
11
|
+
import { ThreadKind, ThreadKind$outboundSchema } from "./threadkind.js";
|
|
12
|
+
|
|
13
|
+
export type ThreadFilters = {
|
|
14
|
+
interval: SessionInterval;
|
|
15
|
+
projectId?: string | undefined;
|
|
16
|
+
tags?: Array<string> | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Start of a custom activity window in unix milliseconds.
|
|
19
|
+
*/
|
|
20
|
+
startDate?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* End of a custom activity window in unix milliseconds.
|
|
23
|
+
*/
|
|
24
|
+
endDate?: string | undefined;
|
|
25
|
+
client?: string | undefined;
|
|
26
|
+
repo?: string | undefined;
|
|
27
|
+
kind?: ThreadKind | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type ThreadFilters$Outbound = {
|
|
32
|
+
interval: string;
|
|
33
|
+
project_id?: string | undefined;
|
|
34
|
+
tags?: Array<string> | undefined;
|
|
35
|
+
start_date?: string | undefined;
|
|
36
|
+
end_date?: string | undefined;
|
|
37
|
+
client?: string | undefined;
|
|
38
|
+
repo?: string | undefined;
|
|
39
|
+
kind?: string | undefined;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const ThreadFilters$outboundSchema: z.ZodType<
|
|
44
|
+
ThreadFilters$Outbound,
|
|
45
|
+
z.ZodTypeDef,
|
|
46
|
+
ThreadFilters
|
|
47
|
+
> = z.object({
|
|
48
|
+
interval: SessionInterval$outboundSchema,
|
|
49
|
+
projectId: z.string().optional(),
|
|
50
|
+
tags: z.array(z.string()).optional(),
|
|
51
|
+
startDate: z.string().optional(),
|
|
52
|
+
endDate: z.string().optional(),
|
|
53
|
+
client: z.string().optional(),
|
|
54
|
+
repo: z.string().optional(),
|
|
55
|
+
kind: ThreadKind$outboundSchema.optional(),
|
|
56
|
+
}).transform((v) => {
|
|
57
|
+
return remap$(v, {
|
|
58
|
+
projectId: "project_id",
|
|
59
|
+
startDate: "start_date",
|
|
60
|
+
endDate: "end_date",
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export function threadFiltersToJSON(threadFilters: ThreadFilters): string {
|
|
65
|
+
return JSON.stringify(ThreadFilters$outboundSchema.parse(threadFilters));
|
|
66
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const ThreadKind = {
|
|
9
|
+
ThreadKindUnspecified: "THREAD_KIND_UNSPECIFIED",
|
|
10
|
+
ThreadKindConversation: "THREAD_KIND_CONVERSATION",
|
|
11
|
+
ThreadKindCodingAgent: "THREAD_KIND_CODING_AGENT",
|
|
12
|
+
} as const;
|
|
13
|
+
export type ThreadKind = ClosedEnum<typeof ThreadKind>;
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const ThreadKind$inboundSchema: z.ZodNativeEnum<typeof ThreadKind> = z
|
|
17
|
+
.nativeEnum(ThreadKind);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const ThreadKind$outboundSchema: z.ZodNativeEnum<typeof ThreadKind> =
|
|
20
|
+
ThreadKind$inboundSchema;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
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 ThreadUsage = {
|
|
12
|
+
promptTokens: number;
|
|
13
|
+
completionTokens: number;
|
|
14
|
+
totalTokens: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ThreadUsage$inboundSchema: z.ZodType<
|
|
19
|
+
ThreadUsage,
|
|
20
|
+
z.ZodTypeDef,
|
|
21
|
+
unknown
|
|
22
|
+
> = z.object({
|
|
23
|
+
prompt_tokens: z.number().int(),
|
|
24
|
+
completion_tokens: z.number().int(),
|
|
25
|
+
total_tokens: z.number().int(),
|
|
26
|
+
}).transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
"prompt_tokens": "promptTokens",
|
|
29
|
+
"completion_tokens": "completionTokens",
|
|
30
|
+
"total_tokens": "totalTokens",
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type ThreadUsage$Outbound = {
|
|
35
|
+
prompt_tokens: number;
|
|
36
|
+
completion_tokens: number;
|
|
37
|
+
total_tokens: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ThreadUsage$outboundSchema: z.ZodType<
|
|
42
|
+
ThreadUsage$Outbound,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
ThreadUsage
|
|
45
|
+
> = z.object({
|
|
46
|
+
promptTokens: z.number().int(),
|
|
47
|
+
completionTokens: z.number().int(),
|
|
48
|
+
totalTokens: z.number().int(),
|
|
49
|
+
}).transform((v) => {
|
|
50
|
+
return remap$(v, {
|
|
51
|
+
promptTokens: "prompt_tokens",
|
|
52
|
+
completionTokens: "completion_tokens",
|
|
53
|
+
totalTokens: "total_tokens",
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export function threadUsageToJSON(threadUsage: ThreadUsage): string {
|
|
58
|
+
return JSON.stringify(ThreadUsage$outboundSchema.parse(threadUsage));
|
|
59
|
+
}
|
|
60
|
+
export function threadUsageFromJSON(
|
|
61
|
+
jsonString: string,
|
|
62
|
+
): SafeParseResult<ThreadUsage, SDKValidationError> {
|
|
63
|
+
return safeParse(
|
|
64
|
+
jsonString,
|
|
65
|
+
(x) => ThreadUsage$inboundSchema.parse(JSON.parse(x)),
|
|
66
|
+
`Failed to parse 'ThreadUsage' from JSON`,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
ThreadBilling,
|
|
9
|
+
ThreadBilling$Outbound,
|
|
10
|
+
ThreadBilling$outboundSchema,
|
|
11
|
+
} from "./threadbilling.js";
|
|
12
|
+
import { ThreadKind, ThreadKind$outboundSchema } from "./threadkind.js";
|
|
13
|
+
import {
|
|
14
|
+
ThreadUsage,
|
|
15
|
+
ThreadUsage$Outbound,
|
|
16
|
+
ThreadUsage$outboundSchema,
|
|
17
|
+
} from "./threadusage.js";
|
|
18
|
+
|
|
19
|
+
export type UpdateThreadRequest = {
|
|
20
|
+
externalId?: string | undefined;
|
|
21
|
+
duration?: number | undefined;
|
|
22
|
+
contactIds?: Array<string> | undefined;
|
|
23
|
+
billing?: ThreadBilling | undefined;
|
|
24
|
+
usage?: ThreadUsage | undefined;
|
|
25
|
+
tracesCount?: number | undefined;
|
|
26
|
+
tags?: Array<string> | undefined;
|
|
27
|
+
projectId?: string | undefined;
|
|
28
|
+
startedAt?: Date | undefined;
|
|
29
|
+
updatedAt?: Date | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Remove every contact id. Mutually exclusive with contact_ids.
|
|
32
|
+
*/
|
|
33
|
+
clearContactIds?: boolean | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Remove every tag. Mutually exclusive with tags.
|
|
36
|
+
*/
|
|
37
|
+
clearTags?: boolean | undefined;
|
|
38
|
+
title?: string | undefined;
|
|
39
|
+
client?: string | undefined;
|
|
40
|
+
repo?: string | undefined;
|
|
41
|
+
kind?: ThreadKind | undefined;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export type UpdateThreadRequest$Outbound = {
|
|
46
|
+
external_id?: string | undefined;
|
|
47
|
+
duration?: number | undefined;
|
|
48
|
+
contact_ids?: Array<string> | undefined;
|
|
49
|
+
billing?: ThreadBilling$Outbound | undefined;
|
|
50
|
+
usage?: ThreadUsage$Outbound | undefined;
|
|
51
|
+
traces_count?: number | undefined;
|
|
52
|
+
tags?: Array<string> | undefined;
|
|
53
|
+
project_id?: string | undefined;
|
|
54
|
+
started_at?: string | undefined;
|
|
55
|
+
updated_at?: string | undefined;
|
|
56
|
+
clear_contact_ids?: boolean | undefined;
|
|
57
|
+
clear_tags?: boolean | undefined;
|
|
58
|
+
title?: string | undefined;
|
|
59
|
+
client?: string | undefined;
|
|
60
|
+
repo?: string | undefined;
|
|
61
|
+
kind?: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export const UpdateThreadRequest$outboundSchema: z.ZodType<
|
|
66
|
+
UpdateThreadRequest$Outbound,
|
|
67
|
+
z.ZodTypeDef,
|
|
68
|
+
UpdateThreadRequest
|
|
69
|
+
> = z.object({
|
|
70
|
+
externalId: z.string().optional(),
|
|
71
|
+
duration: z.number().optional(),
|
|
72
|
+
contactIds: z.array(z.string()).optional(),
|
|
73
|
+
billing: ThreadBilling$outboundSchema.optional(),
|
|
74
|
+
usage: ThreadUsage$outboundSchema.optional(),
|
|
75
|
+
tracesCount: z.number().int().optional(),
|
|
76
|
+
tags: z.array(z.string()).optional(),
|
|
77
|
+
projectId: z.string().optional(),
|
|
78
|
+
startedAt: z.date().transform(v => v.toISOString()).optional(),
|
|
79
|
+
updatedAt: z.date().transform(v => v.toISOString()).optional(),
|
|
80
|
+
clearContactIds: z.boolean().optional(),
|
|
81
|
+
clearTags: z.boolean().optional(),
|
|
82
|
+
title: z.string().optional(),
|
|
83
|
+
client: z.string().optional(),
|
|
84
|
+
repo: z.string().optional(),
|
|
85
|
+
kind: ThreadKind$outboundSchema.optional(),
|
|
86
|
+
}).transform((v) => {
|
|
87
|
+
return remap$(v, {
|
|
88
|
+
externalId: "external_id",
|
|
89
|
+
contactIds: "contact_ids",
|
|
90
|
+
tracesCount: "traces_count",
|
|
91
|
+
projectId: "project_id",
|
|
92
|
+
startedAt: "started_at",
|
|
93
|
+
updatedAt: "updated_at",
|
|
94
|
+
clearContactIds: "clear_contact_ids",
|
|
95
|
+
clearTags: "clear_tags",
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
export function updateThreadRequestToJSON(
|
|
100
|
+
updateThreadRequest: UpdateThreadRequest,
|
|
101
|
+
): string {
|
|
102
|
+
return JSON.stringify(
|
|
103
|
+
UpdateThreadRequest$outboundSchema.parse(updateThreadRequest),
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -138,7 +138,7 @@ export const CreateDatasetResponseBody$inboundSchema: z.ZodType<
|
|
|
138
138
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
139
139
|
.optional(),
|
|
140
140
|
updated: z.string().datetime({ offset: true }).default(
|
|
141
|
-
"2026-09-
|
|
141
|
+
"2026-09-06T23:56:17.054Z",
|
|
142
142
|
).transform(v => new Date(v)),
|
|
143
143
|
}).transform((v) => {
|
|
144
144
|
return remap$(v, {
|
|
@@ -2739,7 +2739,7 @@ export const Evaluations4$inboundSchema: z.ZodType<
|
|
|
2739
2739
|
explanation: z.string().optional(),
|
|
2740
2740
|
reviewed_by_id: z.string(),
|
|
2741
2741
|
reviewed_at: z.string().datetime({ offset: true }).default(
|
|
2742
|
-
"2026-09-
|
|
2742
|
+
"2026-09-06T23:56:24.011Z",
|
|
2743
2743
|
).transform(v => new Date(v)),
|
|
2744
2744
|
type: z.literal("string_array"),
|
|
2745
2745
|
values: z.array(z.string()),
|
|
@@ -2829,7 +2829,7 @@ export const CreateDatasetItemEvaluations3$inboundSchema: z.ZodType<
|
|
|
2829
2829
|
explanation: z.string().optional(),
|
|
2830
2830
|
reviewed_by_id: z.string(),
|
|
2831
2831
|
reviewed_at: z.string().datetime({ offset: true }).default(
|
|
2832
|
-
"2026-09-
|
|
2832
|
+
"2026-09-06T23:56:24.011Z",
|
|
2833
2833
|
).transform(v => new Date(v)),
|
|
2834
2834
|
type: z.literal("boolean"),
|
|
2835
2835
|
value: z.boolean(),
|
|
@@ -2914,7 +2914,7 @@ export const Evaluations2$inboundSchema: z.ZodType<
|
|
|
2914
2914
|
explanation: z.string().optional(),
|
|
2915
2915
|
reviewed_by_id: z.string(),
|
|
2916
2916
|
reviewed_at: z.string().datetime({ offset: true }).default(
|
|
2917
|
-
"2026-09-
|
|
2917
|
+
"2026-09-06T23:56:24.010Z",
|
|
2918
2918
|
).transform(v => new Date(v)),
|
|
2919
2919
|
type: z.literal("number"),
|
|
2920
2920
|
value: z.number(),
|
|
@@ -3000,7 +3000,7 @@ export const Evaluations1$inboundSchema: z.ZodType<
|
|
|
3000
3000
|
explanation: z.string().optional(),
|
|
3001
3001
|
reviewed_by_id: z.string(),
|
|
3002
3002
|
reviewed_at: z.string().datetime({ offset: true }).default(
|
|
3003
|
-
"2026-09-
|
|
3003
|
+
"2026-09-06T23:56:24.010Z",
|
|
3004
3004
|
).transform(v => new Date(v)),
|
|
3005
3005
|
type: z.literal("string"),
|
|
3006
3006
|
value: z.string(),
|
|
@@ -3087,7 +3087,7 @@ export const ResponseBody$inboundSchema: z.ZodType<
|
|
|
3087
3087
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
3088
3088
|
.optional(),
|
|
3089
3089
|
updated: z.string().datetime({ offset: true }).default(
|
|
3090
|
-
"2026-09-
|
|
3090
|
+
"2026-09-06T23:56:17.054Z",
|
|
3091
3091
|
).transform(v => new Date(v)),
|
|
3092
3092
|
}).transform((v) => {
|
|
3093
3093
|
return remap$(v, {
|