@orq-ai/node 4.11.0-rc.5 → 4.11.0-rc.7
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/index.d.ts +23 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +23 -0
- package/models/components/index.js.map +1 -1
- package/models/components/publicresponseresource.d.ts +105 -0
- package/models/components/publicresponseresource.d.ts.map +1 -0
- package/models/components/publicresponseresource.js +138 -0
- package/models/components/publicresponseresource.js.map +1 -0
- package/models/components/reasoningpart.js +1 -1
- package/models/components/responsecodeinterpretercodedeltastreamevent.d.ts +61 -0
- package/models/components/responsecodeinterpretercodedeltastreamevent.d.ts.map +1 -0
- package/models/components/responsecodeinterpretercodedeltastreamevent.js +89 -0
- package/models/components/responsecodeinterpretercodedeltastreamevent.js.map +1 -0
- package/models/components/responsecodeinterpretercodedonestreamevent.d.ts +61 -0
- package/models/components/responsecodeinterpretercodedonestreamevent.d.ts.map +1 -0
- package/models/components/responsecodeinterpretercodedonestreamevent.js +89 -0
- package/models/components/responsecodeinterpretercodedonestreamevent.js.map +1 -0
- package/models/components/responsecontentpartstreamevent.d.ts +81 -0
- package/models/components/responsecontentpartstreamevent.d.ts.map +1 -0
- package/models/components/responsecontentpartstreamevent.js +100 -0
- package/models/components/responsecontentpartstreamevent.js.map +1 -0
- package/models/components/responseerrorstreamevent.d.ts +51 -0
- package/models/components/responseerrorstreamevent.d.ts.map +1 -0
- package/models/components/responseerrorstreamevent.js +85 -0
- package/models/components/responseerrorstreamevent.js.map +1 -0
- package/models/components/responsefunctioncallargumentsdeltastreamevent.d.ts +65 -0
- package/models/components/responsefunctioncallargumentsdeltastreamevent.d.ts.map +1 -0
- package/models/components/responsefunctioncallargumentsdeltastreamevent.js +90 -0
- package/models/components/responsefunctioncallargumentsdeltastreamevent.js.map +1 -0
- package/models/components/responsefunctioncallargumentsdonestreamevent.d.ts +61 -0
- package/models/components/responsefunctioncallargumentsdonestreamevent.d.ts.map +1 -0
- package/models/components/responsefunctioncallargumentsdonestreamevent.js +89 -0
- package/models/components/responsefunctioncallargumentsdonestreamevent.js.map +1 -0
- package/models/components/responsehostedtoolcallstreamevent.d.ts +97 -0
- package/models/components/responsehostedtoolcallstreamevent.d.ts.map +1 -0
- package/models/components/responsehostedtoolcallstreamevent.js +123 -0
- package/models/components/responsehostedtoolcallstreamevent.js.map +1 -0
- package/models/components/responseimagegenerationpartialimagestreamevent.d.ts +65 -0
- package/models/components/responseimagegenerationpartialimagestreamevent.d.ts.map +1 -0
- package/models/components/responseimagegenerationpartialimagestreamevent.js +92 -0
- package/models/components/responseimagegenerationpartialimagestreamevent.js.map +1 -0
- package/models/components/responselifecyclestreamevent.d.ts +73 -0
- package/models/components/responselifecyclestreamevent.d.ts.map +1 -0
- package/models/components/responselifecyclestreamevent.js +103 -0
- package/models/components/responselifecyclestreamevent.js.map +1 -0
- package/models/components/responsemcpcallargumentsdeltastreamevent.d.ts +61 -0
- package/models/components/responsemcpcallargumentsdeltastreamevent.d.ts.map +1 -0
- package/models/components/responsemcpcallargumentsdeltastreamevent.js +89 -0
- package/models/components/responsemcpcallargumentsdeltastreamevent.js.map +1 -0
- package/models/components/responsemcpcallargumentsdonestreamevent.d.ts +61 -0
- package/models/components/responsemcpcallargumentsdonestreamevent.d.ts.map +1 -0
- package/models/components/responsemcpcallargumentsdonestreamevent.js +89 -0
- package/models/components/responsemcpcallargumentsdonestreamevent.js.map +1 -0
- package/models/components/responseoutputitemstreamevent.d.ts +73 -0
- package/models/components/responseoutputitemstreamevent.d.ts.map +1 -0
- package/models/components/responseoutputitemstreamevent.js +96 -0
- package/models/components/responseoutputitemstreamevent.js.map +1 -0
- package/models/components/responseoutputtextannotationaddedstreamevent.d.ts +71 -0
- package/models/components/responseoutputtextannotationaddedstreamevent.d.ts.map +1 -0
- package/models/components/responseoutputtextannotationaddedstreamevent.js +93 -0
- package/models/components/responseoutputtextannotationaddedstreamevent.js.map +1 -0
- package/models/components/responseoutputtextdeltastreamevent.d.ts +75 -0
- package/models/components/responseoutputtextdeltastreamevent.d.ts.map +1 -0
- package/models/components/responseoutputtextdeltastreamevent.js +92 -0
- package/models/components/responseoutputtextdeltastreamevent.js.map +1 -0
- package/models/components/responseoutputtextdonestreamevent.d.ts +71 -0
- package/models/components/responseoutputtextdonestreamevent.d.ts.map +1 -0
- package/models/components/responseoutputtextdonestreamevent.js +91 -0
- package/models/components/responseoutputtextdonestreamevent.js.map +1 -0
- package/models/components/responsereasoningdeltastreamevent.d.ts +83 -0
- package/models/components/responsereasoningdeltastreamevent.d.ts.map +1 -0
- package/models/components/responsereasoningdeltastreamevent.js +101 -0
- package/models/components/responsereasoningdeltastreamevent.js.map +1 -0
- package/models/components/responsereasoningdonestreamevent.d.ts +79 -0
- package/models/components/responsereasoningdonestreamevent.d.ts.map +1 -0
- package/models/components/responsereasoningdonestreamevent.js +100 -0
- package/models/components/responsereasoningdonestreamevent.js.map +1 -0
- package/models/components/responsereasoningsummarypartstreamevent.d.ts +81 -0
- package/models/components/responsereasoningsummarypartstreamevent.d.ts.map +1 -0
- package/models/components/responsereasoningsummarypartstreamevent.js +102 -0
- package/models/components/responsereasoningsummarypartstreamevent.js.map +1 -0
- package/models/components/responsereasoningsummarytextdeltastreamevent.d.ts +69 -0
- package/models/components/responsereasoningsummarytextdeltastreamevent.d.ts.map +1 -0
- package/models/components/responsereasoningsummarytextdeltastreamevent.js +92 -0
- package/models/components/responsereasoningsummarytextdeltastreamevent.js.map +1 -0
- package/models/components/responsereasoningsummarytextdonestreamevent.d.ts +65 -0
- package/models/components/responsereasoningsummarytextdonestreamevent.d.ts.map +1 -0
- package/models/components/responsereasoningsummarytextdonestreamevent.js +91 -0
- package/models/components/responsereasoningsummarytextdonestreamevent.js.map +1 -0
- package/models/components/responserefusaldeltastreamevent.d.ts +65 -0
- package/models/components/responserefusaldeltastreamevent.d.ts.map +1 -0
- package/models/components/responserefusaldeltastreamevent.js +90 -0
- package/models/components/responserefusaldeltastreamevent.js.map +1 -0
- package/models/components/responserefusaldonestreamevent.d.ts +65 -0
- package/models/components/responserefusaldonestreamevent.d.ts.map +1 -0
- package/models/components/responserefusaldonestreamevent.js +90 -0
- package/models/components/responserefusaldonestreamevent.js.map +1 -0
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +4 -4
- package/models/operations/createdatasource.js +1 -1
- package/models/operations/createeval.js +16 -16
- package/models/operations/createrouterresponse.d.ts +127 -57
- package/models/operations/createrouterresponse.d.ts.map +1 -1
- package/models/operations/createrouterresponse.js +142 -61
- package/models/operations/createrouterresponse.js.map +1 -1
- package/models/operations/createtool.js +6 -6
- package/models/operations/getalltools.js +6 -6
- package/models/operations/getevals.js +16 -16
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +3 -3
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrievetool.js +6 -6
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updatedatapoint.js +4 -4
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatedatasource.js +1 -1
- package/models/operations/updateeval.js +16 -16
- package/models/operations/updatetool.js +7 -7
- package/package.json +5 -5
- package/sdk/feedback.d.ts +1 -1
- package/sdk/feedback.js +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +23 -0
- package/src/models/components/publicresponseresource.ts +196 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/components/responsecodeinterpretercodedeltastreamevent.ts +149 -0
- package/src/models/components/responsecodeinterpretercodedonestreamevent.ts +146 -0
- package/src/models/components/responsecontentpartstreamevent.ts +157 -0
- package/src/models/components/responseerrorstreamevent.ts +116 -0
- package/src/models/components/responsefunctioncallargumentsdeltastreamevent.ts +153 -0
- package/src/models/components/responsefunctioncallargumentsdonestreamevent.ts +148 -0
- package/src/models/components/responsehostedtoolcallstreamevent.ts +186 -0
- package/src/models/components/responseimagegenerationpartialimagestreamevent.ts +156 -0
- package/src/models/components/responselifecyclestreamevent.ts +145 -0
- package/src/models/components/responsemcpcallargumentsdeltastreamevent.ts +145 -0
- package/src/models/components/responsemcpcallargumentsdonestreamevent.ts +145 -0
- package/src/models/components/responseoutputitemstreamevent.ts +144 -0
- package/src/models/components/responseoutputtextannotationaddedstreamevent.ts +160 -0
- package/src/models/components/responseoutputtextdeltastreamevent.ts +149 -0
- package/src/models/components/responseoutputtextdonestreamevent.ts +143 -0
- package/src/models/components/responsereasoningdeltastreamevent.ts +164 -0
- package/src/models/components/responsereasoningdonestreamevent.ts +159 -0
- package/src/models/components/responsereasoningsummarypartstreamevent.ts +171 -0
- package/src/models/components/responsereasoningsummarytextdeltastreamevent.ts +159 -0
- package/src/models/components/responsereasoningsummarytextdonestreamevent.ts +154 -0
- package/src/models/components/responserefusaldeltastreamevent.ts +137 -0
- package/src/models/components/responserefusaldonestreamevent.ts +137 -0
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +4 -4
- package/src/models/operations/createdatasource.ts +1 -1
- package/src/models/operations/createeval.ts +16 -16
- package/src/models/operations/createrouterresponse.ts +468 -101
- package/src/models/operations/createtool.ts +6 -6
- package/src/models/operations/getalltools.ts +6 -6
- package/src/models/operations/getevals.ts +16 -16
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/listdatasources.ts +1 -1
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +4 -4
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievedatasource.ts +1 -1
- package/src/models/operations/retrievetool.ts +6 -6
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updatedatapoint.ts +4 -4
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatedatasource.ts +1 -1
- package/src/models/operations/updateeval.ts +16 -16
- package/src/models/operations/updatetool.ts +7 -7
- package/src/sdk/feedback.ts +1 -1
|
@@ -0,0 +1,157 @@
|
|
|
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
|
+
collectExtraKeys as collectExtraKeys$,
|
|
9
|
+
safeParse,
|
|
10
|
+
} from "../../lib/schemas.js";
|
|
11
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
12
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
13
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The event type. Matches the SSE `event` field.
|
|
17
|
+
*/
|
|
18
|
+
export const ResponseContentPartStreamEventType = {
|
|
19
|
+
ResponseContentPartAdded: "response.content_part.added",
|
|
20
|
+
ResponseContentPartDone: "response.content_part.done",
|
|
21
|
+
} as const;
|
|
22
|
+
/**
|
|
23
|
+
* The event type. Matches the SSE `event` field.
|
|
24
|
+
*/
|
|
25
|
+
export type ResponseContentPartStreamEventType = ClosedEnum<
|
|
26
|
+
typeof ResponseContentPartStreamEventType
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The event payload.
|
|
31
|
+
*/
|
|
32
|
+
export type ResponseContentPartStreamEventData = {
|
|
33
|
+
/**
|
|
34
|
+
* Index of the content part within the output item.
|
|
35
|
+
*/
|
|
36
|
+
contentIndex: number;
|
|
37
|
+
/**
|
|
38
|
+
* ID of the output item this event refers to.
|
|
39
|
+
*/
|
|
40
|
+
itemId: string;
|
|
41
|
+
/**
|
|
42
|
+
* Index of the output item in the response output array.
|
|
43
|
+
*/
|
|
44
|
+
outputIndex: number;
|
|
45
|
+
/**
|
|
46
|
+
* The content part.
|
|
47
|
+
*/
|
|
48
|
+
part: { [k: string]: any };
|
|
49
|
+
/**
|
|
50
|
+
* Monotonically increasing sequence number for ordering events.
|
|
51
|
+
*/
|
|
52
|
+
sequenceNumber: number;
|
|
53
|
+
/**
|
|
54
|
+
* The event type. Matches the SSE `event` field.
|
|
55
|
+
*/
|
|
56
|
+
type: ResponseContentPartStreamEventType;
|
|
57
|
+
additionalProperties?: { [k: string]: any } | undefined;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The SSE event name, equal to the payload's `type`.
|
|
62
|
+
*/
|
|
63
|
+
export const ResponseContentPartStreamEventEvent = {
|
|
64
|
+
ResponseContentPartAdded: "response.content_part.added",
|
|
65
|
+
ResponseContentPartDone: "response.content_part.done",
|
|
66
|
+
} as const;
|
|
67
|
+
/**
|
|
68
|
+
* The SSE event name, equal to the payload's `type`.
|
|
69
|
+
*/
|
|
70
|
+
export type ResponseContentPartStreamEventEvent = ClosedEnum<
|
|
71
|
+
typeof ResponseContentPartStreamEventEvent
|
|
72
|
+
>;
|
|
73
|
+
|
|
74
|
+
export type ResponseContentPartStreamEvent = {
|
|
75
|
+
/**
|
|
76
|
+
* The event payload.
|
|
77
|
+
*/
|
|
78
|
+
data: ResponseContentPartStreamEventData;
|
|
79
|
+
/**
|
|
80
|
+
* The SSE event name, equal to the payload's `type`.
|
|
81
|
+
*/
|
|
82
|
+
event: ResponseContentPartStreamEventEvent;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const ResponseContentPartStreamEventType$inboundSchema: z.ZodNativeEnum<
|
|
87
|
+
typeof ResponseContentPartStreamEventType
|
|
88
|
+
> = z.nativeEnum(ResponseContentPartStreamEventType);
|
|
89
|
+
|
|
90
|
+
/** @internal */
|
|
91
|
+
export const ResponseContentPartStreamEventData$inboundSchema: z.ZodType<
|
|
92
|
+
ResponseContentPartStreamEventData,
|
|
93
|
+
z.ZodTypeDef,
|
|
94
|
+
unknown
|
|
95
|
+
> = collectExtraKeys$(
|
|
96
|
+
z.object({
|
|
97
|
+
content_index: z.number().int(),
|
|
98
|
+
item_id: z.string(),
|
|
99
|
+
output_index: z.number().int(),
|
|
100
|
+
part: z.record(z.any()),
|
|
101
|
+
sequence_number: z.number().int(),
|
|
102
|
+
type: ResponseContentPartStreamEventType$inboundSchema,
|
|
103
|
+
}).catchall(z.any()),
|
|
104
|
+
"additionalProperties",
|
|
105
|
+
true,
|
|
106
|
+
).transform((v) => {
|
|
107
|
+
return remap$(v, {
|
|
108
|
+
"content_index": "contentIndex",
|
|
109
|
+
"item_id": "itemId",
|
|
110
|
+
"output_index": "outputIndex",
|
|
111
|
+
"sequence_number": "sequenceNumber",
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
export function responseContentPartStreamEventDataFromJSON(
|
|
116
|
+
jsonString: string,
|
|
117
|
+
): SafeParseResult<ResponseContentPartStreamEventData, SDKValidationError> {
|
|
118
|
+
return safeParse(
|
|
119
|
+
jsonString,
|
|
120
|
+
(x) =>
|
|
121
|
+
ResponseContentPartStreamEventData$inboundSchema.parse(JSON.parse(x)),
|
|
122
|
+
`Failed to parse 'ResponseContentPartStreamEventData' from JSON`,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** @internal */
|
|
127
|
+
export const ResponseContentPartStreamEventEvent$inboundSchema: z.ZodNativeEnum<
|
|
128
|
+
typeof ResponseContentPartStreamEventEvent
|
|
129
|
+
> = z.nativeEnum(ResponseContentPartStreamEventEvent);
|
|
130
|
+
|
|
131
|
+
/** @internal */
|
|
132
|
+
export const ResponseContentPartStreamEvent$inboundSchema: z.ZodType<
|
|
133
|
+
ResponseContentPartStreamEvent,
|
|
134
|
+
z.ZodTypeDef,
|
|
135
|
+
unknown
|
|
136
|
+
> = z.object({
|
|
137
|
+
data: z.unknown().transform((v, ctx) => {
|
|
138
|
+
if (typeof v !== "string") return v;
|
|
139
|
+
try {
|
|
140
|
+
return JSON.parse(v);
|
|
141
|
+
} catch (err) {
|
|
142
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
143
|
+
return z.NEVER;
|
|
144
|
+
}
|
|
145
|
+
}).pipe(z.lazy(() => ResponseContentPartStreamEventData$inboundSchema)),
|
|
146
|
+
event: ResponseContentPartStreamEventEvent$inboundSchema,
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
export function responseContentPartStreamEventFromJSON(
|
|
150
|
+
jsonString: string,
|
|
151
|
+
): SafeParseResult<ResponseContentPartStreamEvent, SDKValidationError> {
|
|
152
|
+
return safeParse(
|
|
153
|
+
jsonString,
|
|
154
|
+
(x) => ResponseContentPartStreamEvent$inboundSchema.parse(JSON.parse(x)),
|
|
155
|
+
`Failed to parse 'ResponseContentPartStreamEvent' from JSON`,
|
|
156
|
+
);
|
|
157
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
collectExtraKeys as collectExtraKeys$,
|
|
9
|
+
safeParse,
|
|
10
|
+
} from "../../lib/schemas.js";
|
|
11
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
12
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
13
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
14
|
+
import { ResponseError, ResponseError$inboundSchema } from "./responseerror.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The event type. Matches the SSE `event` field.
|
|
18
|
+
*/
|
|
19
|
+
export const ResponseErrorStreamEventType = {
|
|
20
|
+
Error: "error",
|
|
21
|
+
} as const;
|
|
22
|
+
/**
|
|
23
|
+
* The event type. Matches the SSE `event` field.
|
|
24
|
+
*/
|
|
25
|
+
export type ResponseErrorStreamEventType = ClosedEnum<
|
|
26
|
+
typeof ResponseErrorStreamEventType
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The event payload.
|
|
31
|
+
*/
|
|
32
|
+
export type ResponseErrorStreamEventData = {
|
|
33
|
+
error: ResponseError;
|
|
34
|
+
/**
|
|
35
|
+
* Monotonically increasing sequence number for ordering events.
|
|
36
|
+
*/
|
|
37
|
+
sequenceNumber: number;
|
|
38
|
+
/**
|
|
39
|
+
* The event type. Matches the SSE `event` field.
|
|
40
|
+
*/
|
|
41
|
+
type: ResponseErrorStreamEventType;
|
|
42
|
+
additionalProperties?: { [k: string]: any } | undefined;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type ResponseErrorStreamEvent = {
|
|
46
|
+
/**
|
|
47
|
+
* The event payload.
|
|
48
|
+
*/
|
|
49
|
+
data: ResponseErrorStreamEventData;
|
|
50
|
+
/**
|
|
51
|
+
* The SSE event name, equal to the payload's `type`.
|
|
52
|
+
*/
|
|
53
|
+
event: "error";
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export const ResponseErrorStreamEventType$inboundSchema: z.ZodNativeEnum<
|
|
58
|
+
typeof ResponseErrorStreamEventType
|
|
59
|
+
> = z.nativeEnum(ResponseErrorStreamEventType);
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const ResponseErrorStreamEventData$inboundSchema: z.ZodType<
|
|
63
|
+
ResponseErrorStreamEventData,
|
|
64
|
+
z.ZodTypeDef,
|
|
65
|
+
unknown
|
|
66
|
+
> = collectExtraKeys$(
|
|
67
|
+
z.object({
|
|
68
|
+
error: ResponseError$inboundSchema,
|
|
69
|
+
sequence_number: z.number().int(),
|
|
70
|
+
type: ResponseErrorStreamEventType$inboundSchema,
|
|
71
|
+
}).catchall(z.any()),
|
|
72
|
+
"additionalProperties",
|
|
73
|
+
true,
|
|
74
|
+
).transform((v) => {
|
|
75
|
+
return remap$(v, {
|
|
76
|
+
"sequence_number": "sequenceNumber",
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export function responseErrorStreamEventDataFromJSON(
|
|
81
|
+
jsonString: string,
|
|
82
|
+
): SafeParseResult<ResponseErrorStreamEventData, SDKValidationError> {
|
|
83
|
+
return safeParse(
|
|
84
|
+
jsonString,
|
|
85
|
+
(x) => ResponseErrorStreamEventData$inboundSchema.parse(JSON.parse(x)),
|
|
86
|
+
`Failed to parse 'ResponseErrorStreamEventData' from JSON`,
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** @internal */
|
|
91
|
+
export const ResponseErrorStreamEvent$inboundSchema: z.ZodType<
|
|
92
|
+
ResponseErrorStreamEvent,
|
|
93
|
+
z.ZodTypeDef,
|
|
94
|
+
unknown
|
|
95
|
+
> = z.object({
|
|
96
|
+
data: z.unknown().transform((v, ctx) => {
|
|
97
|
+
if (typeof v !== "string") return v;
|
|
98
|
+
try {
|
|
99
|
+
return JSON.parse(v);
|
|
100
|
+
} catch (err) {
|
|
101
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
102
|
+
return z.NEVER;
|
|
103
|
+
}
|
|
104
|
+
}).pipe(z.lazy(() => ResponseErrorStreamEventData$inboundSchema)),
|
|
105
|
+
event: z.literal("error"),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export function responseErrorStreamEventFromJSON(
|
|
109
|
+
jsonString: string,
|
|
110
|
+
): SafeParseResult<ResponseErrorStreamEvent, SDKValidationError> {
|
|
111
|
+
return safeParse(
|
|
112
|
+
jsonString,
|
|
113
|
+
(x) => ResponseErrorStreamEvent$inboundSchema.parse(JSON.parse(x)),
|
|
114
|
+
`Failed to parse 'ResponseErrorStreamEvent' from JSON`,
|
|
115
|
+
);
|
|
116
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
collectExtraKeys as collectExtraKeys$,
|
|
9
|
+
safeParse,
|
|
10
|
+
} from "../../lib/schemas.js";
|
|
11
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
12
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
13
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The event type. Matches the SSE `event` field.
|
|
17
|
+
*/
|
|
18
|
+
export const ResponseFunctionCallArgumentsDeltaStreamEventType = {
|
|
19
|
+
ResponseFunctionCallArgumentsDelta: "response.function_call_arguments.delta",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* The event type. Matches the SSE `event` field.
|
|
23
|
+
*/
|
|
24
|
+
export type ResponseFunctionCallArgumentsDeltaStreamEventType = ClosedEnum<
|
|
25
|
+
typeof ResponseFunctionCallArgumentsDeltaStreamEventType
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The event payload.
|
|
30
|
+
*/
|
|
31
|
+
export type ResponseFunctionCallArgumentsDeltaStreamEventData = {
|
|
32
|
+
/**
|
|
33
|
+
* Incremental text or argument chunk.
|
|
34
|
+
*/
|
|
35
|
+
delta: string;
|
|
36
|
+
/**
|
|
37
|
+
* ID of the output item this event refers to.
|
|
38
|
+
*/
|
|
39
|
+
itemId: string;
|
|
40
|
+
/**
|
|
41
|
+
* Obfuscation padding accompanying the delta, when present.
|
|
42
|
+
*/
|
|
43
|
+
obfuscation?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Index of the output item in the response output array.
|
|
46
|
+
*/
|
|
47
|
+
outputIndex: number;
|
|
48
|
+
/**
|
|
49
|
+
* Monotonically increasing sequence number for ordering events.
|
|
50
|
+
*/
|
|
51
|
+
sequenceNumber: number;
|
|
52
|
+
/**
|
|
53
|
+
* The event type. Matches the SSE `event` field.
|
|
54
|
+
*/
|
|
55
|
+
type: ResponseFunctionCallArgumentsDeltaStreamEventType;
|
|
56
|
+
additionalProperties?: { [k: string]: any } | undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type ResponseFunctionCallArgumentsDeltaStreamEvent = {
|
|
60
|
+
/**
|
|
61
|
+
* The event payload.
|
|
62
|
+
*/
|
|
63
|
+
data: ResponseFunctionCallArgumentsDeltaStreamEventData;
|
|
64
|
+
/**
|
|
65
|
+
* The SSE event name, equal to the payload's `type`.
|
|
66
|
+
*/
|
|
67
|
+
event: "response.function_call_arguments.delta";
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const ResponseFunctionCallArgumentsDeltaStreamEventType$inboundSchema:
|
|
72
|
+
z.ZodNativeEnum<typeof ResponseFunctionCallArgumentsDeltaStreamEventType> = z
|
|
73
|
+
.nativeEnum(ResponseFunctionCallArgumentsDeltaStreamEventType);
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const ResponseFunctionCallArgumentsDeltaStreamEventData$inboundSchema:
|
|
77
|
+
z.ZodType<
|
|
78
|
+
ResponseFunctionCallArgumentsDeltaStreamEventData,
|
|
79
|
+
z.ZodTypeDef,
|
|
80
|
+
unknown
|
|
81
|
+
> = collectExtraKeys$(
|
|
82
|
+
z.object({
|
|
83
|
+
delta: z.string(),
|
|
84
|
+
item_id: z.string(),
|
|
85
|
+
obfuscation: z.string().optional(),
|
|
86
|
+
output_index: z.number().int(),
|
|
87
|
+
sequence_number: z.number().int(),
|
|
88
|
+
type: ResponseFunctionCallArgumentsDeltaStreamEventType$inboundSchema,
|
|
89
|
+
}).catchall(z.any()),
|
|
90
|
+
"additionalProperties",
|
|
91
|
+
true,
|
|
92
|
+
).transform((v) => {
|
|
93
|
+
return remap$(v, {
|
|
94
|
+
"item_id": "itemId",
|
|
95
|
+
"output_index": "outputIndex",
|
|
96
|
+
"sequence_number": "sequenceNumber",
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export function responseFunctionCallArgumentsDeltaStreamEventDataFromJSON(
|
|
101
|
+
jsonString: string,
|
|
102
|
+
): SafeParseResult<
|
|
103
|
+
ResponseFunctionCallArgumentsDeltaStreamEventData,
|
|
104
|
+
SDKValidationError
|
|
105
|
+
> {
|
|
106
|
+
return safeParse(
|
|
107
|
+
jsonString,
|
|
108
|
+
(x) =>
|
|
109
|
+
ResponseFunctionCallArgumentsDeltaStreamEventData$inboundSchema.parse(
|
|
110
|
+
JSON.parse(x),
|
|
111
|
+
),
|
|
112
|
+
`Failed to parse 'ResponseFunctionCallArgumentsDeltaStreamEventData' from JSON`,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** @internal */
|
|
117
|
+
export const ResponseFunctionCallArgumentsDeltaStreamEvent$inboundSchema:
|
|
118
|
+
z.ZodType<
|
|
119
|
+
ResponseFunctionCallArgumentsDeltaStreamEvent,
|
|
120
|
+
z.ZodTypeDef,
|
|
121
|
+
unknown
|
|
122
|
+
> = z.object({
|
|
123
|
+
data: z.unknown().transform((v, ctx) => {
|
|
124
|
+
if (typeof v !== "string") return v;
|
|
125
|
+
try {
|
|
126
|
+
return JSON.parse(v);
|
|
127
|
+
} catch (err) {
|
|
128
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
129
|
+
return z.NEVER;
|
|
130
|
+
}
|
|
131
|
+
}).pipe(
|
|
132
|
+
z.lazy(() =>
|
|
133
|
+
ResponseFunctionCallArgumentsDeltaStreamEventData$inboundSchema
|
|
134
|
+
),
|
|
135
|
+
),
|
|
136
|
+
event: z.literal("response.function_call_arguments.delta"),
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
export function responseFunctionCallArgumentsDeltaStreamEventFromJSON(
|
|
140
|
+
jsonString: string,
|
|
141
|
+
): SafeParseResult<
|
|
142
|
+
ResponseFunctionCallArgumentsDeltaStreamEvent,
|
|
143
|
+
SDKValidationError
|
|
144
|
+
> {
|
|
145
|
+
return safeParse(
|
|
146
|
+
jsonString,
|
|
147
|
+
(x) =>
|
|
148
|
+
ResponseFunctionCallArgumentsDeltaStreamEvent$inboundSchema.parse(
|
|
149
|
+
JSON.parse(x),
|
|
150
|
+
),
|
|
151
|
+
`Failed to parse 'ResponseFunctionCallArgumentsDeltaStreamEvent' from JSON`,
|
|
152
|
+
);
|
|
153
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
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
|
+
collectExtraKeys as collectExtraKeys$,
|
|
9
|
+
safeParse,
|
|
10
|
+
} from "../../lib/schemas.js";
|
|
11
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
12
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
13
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The event type. Matches the SSE `event` field.
|
|
17
|
+
*/
|
|
18
|
+
export const ResponseFunctionCallArgumentsDoneStreamEventType = {
|
|
19
|
+
ResponseFunctionCallArgumentsDone: "response.function_call_arguments.done",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* The event type. Matches the SSE `event` field.
|
|
23
|
+
*/
|
|
24
|
+
export type ResponseFunctionCallArgumentsDoneStreamEventType = ClosedEnum<
|
|
25
|
+
typeof ResponseFunctionCallArgumentsDoneStreamEventType
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The event payload.
|
|
30
|
+
*/
|
|
31
|
+
export type ResponseFunctionCallArgumentsDoneStreamEventData = {
|
|
32
|
+
/**
|
|
33
|
+
* The completed function-call arguments JSON.
|
|
34
|
+
*/
|
|
35
|
+
arguments: string;
|
|
36
|
+
/**
|
|
37
|
+
* ID of the output item this event refers to.
|
|
38
|
+
*/
|
|
39
|
+
itemId: string;
|
|
40
|
+
/**
|
|
41
|
+
* Index of the output item in the response output array.
|
|
42
|
+
*/
|
|
43
|
+
outputIndex: number;
|
|
44
|
+
/**
|
|
45
|
+
* Monotonically increasing sequence number for ordering events.
|
|
46
|
+
*/
|
|
47
|
+
sequenceNumber: number;
|
|
48
|
+
/**
|
|
49
|
+
* The event type. Matches the SSE `event` field.
|
|
50
|
+
*/
|
|
51
|
+
type: ResponseFunctionCallArgumentsDoneStreamEventType;
|
|
52
|
+
additionalProperties?: { [k: string]: any } | undefined;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type ResponseFunctionCallArgumentsDoneStreamEvent = {
|
|
56
|
+
/**
|
|
57
|
+
* The event payload.
|
|
58
|
+
*/
|
|
59
|
+
data: ResponseFunctionCallArgumentsDoneStreamEventData;
|
|
60
|
+
/**
|
|
61
|
+
* The SSE event name, equal to the payload's `type`.
|
|
62
|
+
*/
|
|
63
|
+
event: "response.function_call_arguments.done";
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const ResponseFunctionCallArgumentsDoneStreamEventType$inboundSchema:
|
|
68
|
+
z.ZodNativeEnum<typeof ResponseFunctionCallArgumentsDoneStreamEventType> = z
|
|
69
|
+
.nativeEnum(ResponseFunctionCallArgumentsDoneStreamEventType);
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const ResponseFunctionCallArgumentsDoneStreamEventData$inboundSchema:
|
|
73
|
+
z.ZodType<
|
|
74
|
+
ResponseFunctionCallArgumentsDoneStreamEventData,
|
|
75
|
+
z.ZodTypeDef,
|
|
76
|
+
unknown
|
|
77
|
+
> = collectExtraKeys$(
|
|
78
|
+
z.object({
|
|
79
|
+
arguments: z.string(),
|
|
80
|
+
item_id: z.string(),
|
|
81
|
+
output_index: z.number().int(),
|
|
82
|
+
sequence_number: z.number().int(),
|
|
83
|
+
type: ResponseFunctionCallArgumentsDoneStreamEventType$inboundSchema,
|
|
84
|
+
}).catchall(z.any()),
|
|
85
|
+
"additionalProperties",
|
|
86
|
+
true,
|
|
87
|
+
).transform((v) => {
|
|
88
|
+
return remap$(v, {
|
|
89
|
+
"item_id": "itemId",
|
|
90
|
+
"output_index": "outputIndex",
|
|
91
|
+
"sequence_number": "sequenceNumber",
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export function responseFunctionCallArgumentsDoneStreamEventDataFromJSON(
|
|
96
|
+
jsonString: string,
|
|
97
|
+
): SafeParseResult<
|
|
98
|
+
ResponseFunctionCallArgumentsDoneStreamEventData,
|
|
99
|
+
SDKValidationError
|
|
100
|
+
> {
|
|
101
|
+
return safeParse(
|
|
102
|
+
jsonString,
|
|
103
|
+
(x) =>
|
|
104
|
+
ResponseFunctionCallArgumentsDoneStreamEventData$inboundSchema.parse(
|
|
105
|
+
JSON.parse(x),
|
|
106
|
+
),
|
|
107
|
+
`Failed to parse 'ResponseFunctionCallArgumentsDoneStreamEventData' from JSON`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const ResponseFunctionCallArgumentsDoneStreamEvent$inboundSchema:
|
|
113
|
+
z.ZodType<
|
|
114
|
+
ResponseFunctionCallArgumentsDoneStreamEvent,
|
|
115
|
+
z.ZodTypeDef,
|
|
116
|
+
unknown
|
|
117
|
+
> = z.object({
|
|
118
|
+
data: z.unknown().transform((v, ctx) => {
|
|
119
|
+
if (typeof v !== "string") return v;
|
|
120
|
+
try {
|
|
121
|
+
return JSON.parse(v);
|
|
122
|
+
} catch (err) {
|
|
123
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
124
|
+
return z.NEVER;
|
|
125
|
+
}
|
|
126
|
+
}).pipe(
|
|
127
|
+
z.lazy(() =>
|
|
128
|
+
ResponseFunctionCallArgumentsDoneStreamEventData$inboundSchema
|
|
129
|
+
),
|
|
130
|
+
),
|
|
131
|
+
event: z.literal("response.function_call_arguments.done"),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export function responseFunctionCallArgumentsDoneStreamEventFromJSON(
|
|
135
|
+
jsonString: string,
|
|
136
|
+
): SafeParseResult<
|
|
137
|
+
ResponseFunctionCallArgumentsDoneStreamEvent,
|
|
138
|
+
SDKValidationError
|
|
139
|
+
> {
|
|
140
|
+
return safeParse(
|
|
141
|
+
jsonString,
|
|
142
|
+
(x) =>
|
|
143
|
+
ResponseFunctionCallArgumentsDoneStreamEvent$inboundSchema.parse(
|
|
144
|
+
JSON.parse(x),
|
|
145
|
+
),
|
|
146
|
+
`Failed to parse 'ResponseFunctionCallArgumentsDoneStreamEvent' from JSON`,
|
|
147
|
+
);
|
|
148
|
+
}
|