@orq-ai/node 4.4.12 → 4.4.14
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/partdoneevent.js +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/operations/createcontact.js +1 -1
- 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/createidentity.js +1 -1
- package/models/operations/createtool.js +6 -6
- package/models/operations/fileget.js +1 -1
- package/models/operations/filelist.js +1 -1
- package/models/operations/fileupload.js +1 -1
- package/models/operations/getalltools.js +6 -6
- package/models/operations/getevals.js +16 -16
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/listidentities.js +1 -1
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrieveidentity.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/updateidentity.js +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +1 -1
- package/packages/orq-rc/src/funcs/agentsList.ts +5 -0
- package/packages/orq-rc/src/funcs/agentsPostV2AgentsA2a.ts +178 -0
- package/packages/orq-rc/src/funcs/agentsPostV2AgentsKeyCardRefresh.ts +187 -0
- package/packages/orq-rc/src/funcs/agentsResponsesGet.ts +182 -0
- package/packages/orq-rc/src/funcs/agentsUpdate.ts +2 -2
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/models/components/createagentresponse.ts +6 -0
- package/packages/orq-rc/src/models/components/extendedmessage.ts +146 -0
- package/packages/orq-rc/src/models/components/getagentresponse.ts +348 -0
- package/packages/orq-rc/src/models/components/index.ts +3 -0
- package/packages/orq-rc/src/models/components/partdoneevent.ts +1 -1
- package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
- package/packages/orq-rc/src/models/components/responsedoneevent.ts +6 -0
- package/packages/orq-rc/src/models/components/responsestartedevent.ts +6 -0
- package/packages/orq-rc/src/models/components/telemetry.ts +48 -0
- package/packages/orq-rc/src/models/errors/index.ts +2 -0
- package/packages/orq-rc/src/models/errors/postv2agentsa2a.ts +96 -0
- package/packages/orq-rc/src/models/errors/postv2agentskeycardrefresh.ts +97 -0
- package/packages/orq-rc/src/models/operations/createagentrequest.ts +755 -1212
- package/packages/orq-rc/src/models/operations/createagentresponserequest.ts +35 -1
- package/packages/orq-rc/src/models/operations/createannotation.ts +5 -1
- package/packages/orq-rc/src/models/operations/createcontact.ts +1 -1
- package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
- package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
- package/packages/orq-rc/src/models/operations/createidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/createknowledge.ts +19 -17
- package/packages/orq-rc/src/models/operations/createprompt.ts +55 -66
- package/packages/orq-rc/src/models/operations/createtool.ts +103 -91
- package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +38 -0
- package/packages/orq-rc/src/models/operations/deploymentstream.ts +38 -0
- package/packages/orq-rc/src/models/operations/fileget.ts +1 -1
- package/packages/orq-rc/src/models/operations/filelist.ts +1 -1
- package/packages/orq-rc/src/models/operations/fileupload.ts +1 -1
- package/packages/orq-rc/src/models/operations/getagentresponse.ts +46 -0
- package/packages/orq-rc/src/models/operations/getalltools.ts +93 -87
- package/packages/orq-rc/src/models/operations/getevals.ts +16 -16
- package/packages/orq-rc/src/models/operations/index.ts +3 -0
- package/packages/orq-rc/src/models/operations/invokeagent.ts +45 -1
- package/packages/orq-rc/src/models/operations/listagents.ts +751 -787
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
- package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
- package/packages/orq-rc/src/models/operations/listidentities.ts +1 -1
- package/packages/orq-rc/src/models/operations/listknowledgebases.ts +72 -64
- package/packages/orq-rc/src/models/operations/postv2agentsa2a.ts +252 -0
- package/packages/orq-rc/src/models/operations/postv2agentskeycardrefresh.ts +100 -0
- package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +962 -857
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrieveidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
- package/packages/orq-rc/src/models/operations/runagent.ts +69 -493
- package/packages/orq-rc/src/models/operations/streamagent.ts +40 -1
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +36 -493
- package/packages/orq-rc/src/models/operations/updateagent.ts +966 -1313
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
- package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
- package/packages/orq-rc/src/models/operations/updateidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
- package/packages/orq-rc/src/sdk/agents.ts +39 -1
- package/packages/orq-rc/src/sdk/responses.ts +19 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/partdoneevent.ts +1 -1
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/operations/createcontact.ts +1 -1
- 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/createidentity.ts +1 -1
- package/src/models/operations/createtool.ts +6 -6
- package/src/models/operations/fileget.ts +1 -1
- package/src/models/operations/filelist.ts +1 -1
- package/src/models/operations/fileupload.ts +1 -1
- package/src/models/operations/getalltools.ts +6 -6
- package/src/models/operations/getevals.ts +16 -16
- 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/listidentities.ts +1 -1
- 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/retrieveidentity.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/updateidentity.ts +1 -1
- package/src/models/operations/updatetool.ts +7 -7
|
@@ -0,0 +1,348 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
AgentResponseMessage,
|
|
13
|
+
AgentResponseMessage$inboundSchema,
|
|
14
|
+
} from "./agentresponsemessage.js";
|
|
15
|
+
import { Telemetry, Telemetry$inboundSchema } from "./telemetry.js";
|
|
16
|
+
|
|
17
|
+
export type GetAgentResponsePromptTokensDetails = {
|
|
18
|
+
cachedTokens?: number | null | undefined;
|
|
19
|
+
cacheCreationTokens?: number | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The number of audio input tokens consumed by the request.
|
|
22
|
+
*/
|
|
23
|
+
audioTokens?: number | null | undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type GetAgentResponseCompletionTokensDetails = {
|
|
27
|
+
reasoningTokens?: number | null | undefined;
|
|
28
|
+
acceptedPredictionTokens?: number | null | undefined;
|
|
29
|
+
rejectedPredictionTokens?: number | null | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The number of audio output tokens produced by the response.
|
|
32
|
+
*/
|
|
33
|
+
audioTokens?: number | null | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Token usage from the agent execution
|
|
38
|
+
*/
|
|
39
|
+
export type GetAgentResponseUsage = {
|
|
40
|
+
/**
|
|
41
|
+
* Number of tokens in the generated completion.
|
|
42
|
+
*/
|
|
43
|
+
completionTokens?: number | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Number of tokens in the prompt.
|
|
46
|
+
*/
|
|
47
|
+
promptTokens?: number | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Total number of tokens used in the request (prompt + completion).
|
|
50
|
+
*/
|
|
51
|
+
totalTokens?: number | undefined;
|
|
52
|
+
promptTokensDetails?: GetAgentResponsePromptTokensDetails | null | undefined;
|
|
53
|
+
completionTokensDetails?:
|
|
54
|
+
| GetAgentResponseCompletionTokensDetails
|
|
55
|
+
| null
|
|
56
|
+
| undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The reason why the agent stopped generating
|
|
61
|
+
*/
|
|
62
|
+
export const GetAgentResponseFinishReason = {
|
|
63
|
+
Stop: "stop",
|
|
64
|
+
Length: "length",
|
|
65
|
+
ToolCalls: "tool_calls",
|
|
66
|
+
ContentFilter: "content_filter",
|
|
67
|
+
FunctionCall: "function_call",
|
|
68
|
+
MaxIterations: "max_iterations",
|
|
69
|
+
MaxTime: "max_time",
|
|
70
|
+
} as const;
|
|
71
|
+
/**
|
|
72
|
+
* The reason why the agent stopped generating
|
|
73
|
+
*/
|
|
74
|
+
export type GetAgentResponseFinishReason = ClosedEnum<
|
|
75
|
+
typeof GetAgentResponseFinishReason
|
|
76
|
+
>;
|
|
77
|
+
|
|
78
|
+
export const GetAgentResponseType = {
|
|
79
|
+
Function: "function",
|
|
80
|
+
} as const;
|
|
81
|
+
export type GetAgentResponseType = ClosedEnum<typeof GetAgentResponseType>;
|
|
82
|
+
|
|
83
|
+
export type GetAgentResponseFunction = {
|
|
84
|
+
name?: string | undefined;
|
|
85
|
+
arguments?: string | undefined;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type GetAgentResponsePendingToolCalls = {
|
|
89
|
+
id: string;
|
|
90
|
+
type: GetAgentResponseType;
|
|
91
|
+
function: GetAgentResponseFunction;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Current status of the agent response
|
|
96
|
+
*/
|
|
97
|
+
export const Status = {
|
|
98
|
+
InProgress: "in_progress",
|
|
99
|
+
Completed: "completed",
|
|
100
|
+
Failed: "failed",
|
|
101
|
+
} as const;
|
|
102
|
+
/**
|
|
103
|
+
* Current status of the agent response
|
|
104
|
+
*/
|
|
105
|
+
export type Status = ClosedEnum<typeof Status>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Response type from the get-response endpoint. Includes a status field indicating the current state of the agent execution.
|
|
109
|
+
*/
|
|
110
|
+
export type GetAgentResponse = {
|
|
111
|
+
/**
|
|
112
|
+
* The unique response ID
|
|
113
|
+
*/
|
|
114
|
+
id: string;
|
|
115
|
+
/**
|
|
116
|
+
* The agent execution task ID
|
|
117
|
+
*/
|
|
118
|
+
taskId: string;
|
|
119
|
+
/**
|
|
120
|
+
* Array of messages from the agent execution
|
|
121
|
+
*/
|
|
122
|
+
output: Array<AgentResponseMessage>;
|
|
123
|
+
/**
|
|
124
|
+
* ISO timestamp of response creation
|
|
125
|
+
*/
|
|
126
|
+
createdAt: string;
|
|
127
|
+
/**
|
|
128
|
+
* Model used in provider/model format
|
|
129
|
+
*/
|
|
130
|
+
model: string;
|
|
131
|
+
/**
|
|
132
|
+
* Token usage from the agent execution
|
|
133
|
+
*/
|
|
134
|
+
usage?: GetAgentResponseUsage | null | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* The reason why the agent stopped generating
|
|
137
|
+
*/
|
|
138
|
+
finishReason?: GetAgentResponseFinishReason | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Tool calls awaiting user response (when finish_reason is function_call)
|
|
141
|
+
*/
|
|
142
|
+
pendingToolCalls?: Array<GetAgentResponsePendingToolCalls> | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* Telemetry information for correlating the response with traces
|
|
145
|
+
*/
|
|
146
|
+
telemetry?: Telemetry | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Current status of the agent response
|
|
149
|
+
*/
|
|
150
|
+
status: Status;
|
|
151
|
+
/**
|
|
152
|
+
* Error message when status is failed
|
|
153
|
+
*/
|
|
154
|
+
error?: string | undefined;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/** @internal */
|
|
158
|
+
export const GetAgentResponsePromptTokensDetails$inboundSchema: z.ZodType<
|
|
159
|
+
GetAgentResponsePromptTokensDetails,
|
|
160
|
+
z.ZodTypeDef,
|
|
161
|
+
unknown
|
|
162
|
+
> = z.object({
|
|
163
|
+
cached_tokens: z.nullable(z.number().int()).optional(),
|
|
164
|
+
cache_creation_tokens: z.nullable(z.number().int()).optional(),
|
|
165
|
+
audio_tokens: z.nullable(z.number().int()).optional(),
|
|
166
|
+
}).transform((v) => {
|
|
167
|
+
return remap$(v, {
|
|
168
|
+
"cached_tokens": "cachedTokens",
|
|
169
|
+
"cache_creation_tokens": "cacheCreationTokens",
|
|
170
|
+
"audio_tokens": "audioTokens",
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
export function getAgentResponsePromptTokensDetailsFromJSON(
|
|
175
|
+
jsonString: string,
|
|
176
|
+
): SafeParseResult<GetAgentResponsePromptTokensDetails, SDKValidationError> {
|
|
177
|
+
return safeParse(
|
|
178
|
+
jsonString,
|
|
179
|
+
(x) =>
|
|
180
|
+
GetAgentResponsePromptTokensDetails$inboundSchema.parse(JSON.parse(x)),
|
|
181
|
+
`Failed to parse 'GetAgentResponsePromptTokensDetails' from JSON`,
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** @internal */
|
|
186
|
+
export const GetAgentResponseCompletionTokensDetails$inboundSchema: z.ZodType<
|
|
187
|
+
GetAgentResponseCompletionTokensDetails,
|
|
188
|
+
z.ZodTypeDef,
|
|
189
|
+
unknown
|
|
190
|
+
> = z.object({
|
|
191
|
+
reasoning_tokens: z.nullable(z.number()).optional(),
|
|
192
|
+
accepted_prediction_tokens: z.nullable(z.number()).optional(),
|
|
193
|
+
rejected_prediction_tokens: z.nullable(z.number()).optional(),
|
|
194
|
+
audio_tokens: z.nullable(z.number().int()).optional(),
|
|
195
|
+
}).transform((v) => {
|
|
196
|
+
return remap$(v, {
|
|
197
|
+
"reasoning_tokens": "reasoningTokens",
|
|
198
|
+
"accepted_prediction_tokens": "acceptedPredictionTokens",
|
|
199
|
+
"rejected_prediction_tokens": "rejectedPredictionTokens",
|
|
200
|
+
"audio_tokens": "audioTokens",
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
export function getAgentResponseCompletionTokensDetailsFromJSON(
|
|
205
|
+
jsonString: string,
|
|
206
|
+
): SafeParseResult<
|
|
207
|
+
GetAgentResponseCompletionTokensDetails,
|
|
208
|
+
SDKValidationError
|
|
209
|
+
> {
|
|
210
|
+
return safeParse(
|
|
211
|
+
jsonString,
|
|
212
|
+
(x) =>
|
|
213
|
+
GetAgentResponseCompletionTokensDetails$inboundSchema.parse(
|
|
214
|
+
JSON.parse(x),
|
|
215
|
+
),
|
|
216
|
+
`Failed to parse 'GetAgentResponseCompletionTokensDetails' from JSON`,
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** @internal */
|
|
221
|
+
export const GetAgentResponseUsage$inboundSchema: z.ZodType<
|
|
222
|
+
GetAgentResponseUsage,
|
|
223
|
+
z.ZodTypeDef,
|
|
224
|
+
unknown
|
|
225
|
+
> = z.object({
|
|
226
|
+
completion_tokens: z.number().optional(),
|
|
227
|
+
prompt_tokens: z.number().optional(),
|
|
228
|
+
total_tokens: z.number().optional(),
|
|
229
|
+
prompt_tokens_details: z.nullable(
|
|
230
|
+
z.lazy(() => GetAgentResponsePromptTokensDetails$inboundSchema),
|
|
231
|
+
).optional(),
|
|
232
|
+
completion_tokens_details: z.nullable(
|
|
233
|
+
z.lazy(() => GetAgentResponseCompletionTokensDetails$inboundSchema),
|
|
234
|
+
).optional(),
|
|
235
|
+
}).transform((v) => {
|
|
236
|
+
return remap$(v, {
|
|
237
|
+
"completion_tokens": "completionTokens",
|
|
238
|
+
"prompt_tokens": "promptTokens",
|
|
239
|
+
"total_tokens": "totalTokens",
|
|
240
|
+
"prompt_tokens_details": "promptTokensDetails",
|
|
241
|
+
"completion_tokens_details": "completionTokensDetails",
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
export function getAgentResponseUsageFromJSON(
|
|
246
|
+
jsonString: string,
|
|
247
|
+
): SafeParseResult<GetAgentResponseUsage, SDKValidationError> {
|
|
248
|
+
return safeParse(
|
|
249
|
+
jsonString,
|
|
250
|
+
(x) => GetAgentResponseUsage$inboundSchema.parse(JSON.parse(x)),
|
|
251
|
+
`Failed to parse 'GetAgentResponseUsage' from JSON`,
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** @internal */
|
|
256
|
+
export const GetAgentResponseFinishReason$inboundSchema: z.ZodNativeEnum<
|
|
257
|
+
typeof GetAgentResponseFinishReason
|
|
258
|
+
> = z.nativeEnum(GetAgentResponseFinishReason);
|
|
259
|
+
|
|
260
|
+
/** @internal */
|
|
261
|
+
export const GetAgentResponseType$inboundSchema: z.ZodNativeEnum<
|
|
262
|
+
typeof GetAgentResponseType
|
|
263
|
+
> = z.nativeEnum(GetAgentResponseType);
|
|
264
|
+
|
|
265
|
+
/** @internal */
|
|
266
|
+
export const GetAgentResponseFunction$inboundSchema: z.ZodType<
|
|
267
|
+
GetAgentResponseFunction,
|
|
268
|
+
z.ZodTypeDef,
|
|
269
|
+
unknown
|
|
270
|
+
> = z.object({
|
|
271
|
+
name: z.string().optional(),
|
|
272
|
+
arguments: z.string().optional(),
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
export function getAgentResponseFunctionFromJSON(
|
|
276
|
+
jsonString: string,
|
|
277
|
+
): SafeParseResult<GetAgentResponseFunction, SDKValidationError> {
|
|
278
|
+
return safeParse(
|
|
279
|
+
jsonString,
|
|
280
|
+
(x) => GetAgentResponseFunction$inboundSchema.parse(JSON.parse(x)),
|
|
281
|
+
`Failed to parse 'GetAgentResponseFunction' from JSON`,
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** @internal */
|
|
286
|
+
export const GetAgentResponsePendingToolCalls$inboundSchema: z.ZodType<
|
|
287
|
+
GetAgentResponsePendingToolCalls,
|
|
288
|
+
z.ZodTypeDef,
|
|
289
|
+
unknown
|
|
290
|
+
> = z.object({
|
|
291
|
+
id: z.string(),
|
|
292
|
+
type: GetAgentResponseType$inboundSchema,
|
|
293
|
+
function: z.lazy(() => GetAgentResponseFunction$inboundSchema),
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
export function getAgentResponsePendingToolCallsFromJSON(
|
|
297
|
+
jsonString: string,
|
|
298
|
+
): SafeParseResult<GetAgentResponsePendingToolCalls, SDKValidationError> {
|
|
299
|
+
return safeParse(
|
|
300
|
+
jsonString,
|
|
301
|
+
(x) => GetAgentResponsePendingToolCalls$inboundSchema.parse(JSON.parse(x)),
|
|
302
|
+
`Failed to parse 'GetAgentResponsePendingToolCalls' from JSON`,
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** @internal */
|
|
307
|
+
export const Status$inboundSchema: z.ZodNativeEnum<typeof Status> = z
|
|
308
|
+
.nativeEnum(Status);
|
|
309
|
+
|
|
310
|
+
/** @internal */
|
|
311
|
+
export const GetAgentResponse$inboundSchema: z.ZodType<
|
|
312
|
+
GetAgentResponse,
|
|
313
|
+
z.ZodTypeDef,
|
|
314
|
+
unknown
|
|
315
|
+
> = z.object({
|
|
316
|
+
_id: z.string(),
|
|
317
|
+
task_id: z.string(),
|
|
318
|
+
output: z.array(AgentResponseMessage$inboundSchema),
|
|
319
|
+
created_at: z.string(),
|
|
320
|
+
model: z.string(),
|
|
321
|
+
usage: z.nullable(z.lazy(() => GetAgentResponseUsage$inboundSchema))
|
|
322
|
+
.optional(),
|
|
323
|
+
finish_reason: GetAgentResponseFinishReason$inboundSchema.optional(),
|
|
324
|
+
pending_tool_calls: z.array(
|
|
325
|
+
z.lazy(() => GetAgentResponsePendingToolCalls$inboundSchema),
|
|
326
|
+
).optional(),
|
|
327
|
+
telemetry: Telemetry$inboundSchema.optional(),
|
|
328
|
+
status: Status$inboundSchema,
|
|
329
|
+
error: z.string().optional(),
|
|
330
|
+
}).transform((v) => {
|
|
331
|
+
return remap$(v, {
|
|
332
|
+
"_id": "id",
|
|
333
|
+
"task_id": "taskId",
|
|
334
|
+
"created_at": "createdAt",
|
|
335
|
+
"finish_reason": "finishReason",
|
|
336
|
+
"pending_tool_calls": "pendingToolCalls",
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
export function getAgentResponseFromJSON(
|
|
341
|
+
jsonString: string,
|
|
342
|
+
): SafeParseResult<GetAgentResponse, SDKValidationError> {
|
|
343
|
+
return safeParse(
|
|
344
|
+
jsonString,
|
|
345
|
+
(x) => GetAgentResponse$inboundSchema.parse(JSON.parse(x)),
|
|
346
|
+
`Failed to parse 'GetAgentResponse' from JSON`,
|
|
347
|
+
);
|
|
348
|
+
}
|
|
@@ -20,8 +20,10 @@ export * from "./errorstreamingevent.js";
|
|
|
20
20
|
export * from "./executionnamedstreamingevent.js";
|
|
21
21
|
export * from "./executionreviewedstreamingevent.js";
|
|
22
22
|
export * from "./executionreviewrequiredstreamingevent.js";
|
|
23
|
+
export * from "./extendedmessage.js";
|
|
23
24
|
export * from "./filecontentpartschema.js";
|
|
24
25
|
export * from "./filepart.js";
|
|
26
|
+
export * from "./getagentresponse.js";
|
|
25
27
|
export * from "./imagecontentpartschema.js";
|
|
26
28
|
export * from "./invokedeploymentrequest.js";
|
|
27
29
|
export * from "./partdelta.js";
|
|
@@ -39,6 +41,7 @@ export * from "./responsestartedevent.js";
|
|
|
39
41
|
export * from "./responsestreamingevent.js";
|
|
40
42
|
export * from "./reviewoutcome.js";
|
|
41
43
|
export * from "./security.js";
|
|
44
|
+
export * from "./telemetry.js";
|
|
42
45
|
export * from "./textcontentpartschema.js";
|
|
43
46
|
export * from "./textpart.js";
|
|
44
47
|
export * from "./thinkingconfigdisabledschema.js";
|
|
@@ -76,7 +76,7 @@ export const PartReasoningPart$inboundSchema: z.ZodType<
|
|
|
76
76
|
z.ZodTypeDef,
|
|
77
77
|
unknown
|
|
78
78
|
> = z.object({
|
|
79
|
-
_id: z.string().default("
|
|
79
|
+
_id: z.string().default("reasoning_01kjz6j2j4jm79rvv8nmq2wm7m"),
|
|
80
80
|
metadata: z.record(z.any()).optional(),
|
|
81
81
|
kind: PartKind$inboundSchema,
|
|
82
82
|
reasoning: z.string(),
|
|
@@ -40,7 +40,7 @@ export const ReasoningPart$inboundSchema: z.ZodType<
|
|
|
40
40
|
z.ZodTypeDef,
|
|
41
41
|
unknown
|
|
42
42
|
> = z.object({
|
|
43
|
-
_id: z.string().default("
|
|
43
|
+
_id: z.string().default("reasoning_01kjz6j2hwc2e1ea5npjnhgvmy"),
|
|
44
44
|
metadata: z.record(z.any()).optional(),
|
|
45
45
|
kind: z.literal("reasoning"),
|
|
46
46
|
reasoning: z.string(),
|
|
@@ -8,6 +8,7 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import { Telemetry, Telemetry$inboundSchema } from "./telemetry.js";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* The reason why the agent stopped generating
|
|
@@ -110,6 +111,10 @@ export type ResponseDoneEventData = {
|
|
|
110
111
|
* Tool calls awaiting user response (when finishReason is function_call)
|
|
111
112
|
*/
|
|
112
113
|
pendingToolCalls?: Array<ResponseDoneEventPendingToolCalls> | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Telemetry information for correlating the response with traces
|
|
116
|
+
*/
|
|
117
|
+
telemetry?: Telemetry | undefined;
|
|
113
118
|
};
|
|
114
119
|
|
|
115
120
|
/**
|
|
@@ -284,6 +289,7 @@ export const ResponseDoneEventData$inboundSchema: z.ZodType<
|
|
|
284
289
|
pendingToolCalls: z.array(
|
|
285
290
|
z.lazy(() => ResponseDoneEventPendingToolCalls$inboundSchema),
|
|
286
291
|
).optional(),
|
|
292
|
+
telemetry: Telemetry$inboundSchema.optional(),
|
|
287
293
|
});
|
|
288
294
|
|
|
289
295
|
export function responseDoneEventDataFromJSON(
|
|
@@ -6,6 +6,7 @@ import * as z from "zod/v3";
|
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import { Telemetry, Telemetry$inboundSchema } from "./telemetry.js";
|
|
9
10
|
|
|
10
11
|
export type Data = {
|
|
11
12
|
/**
|
|
@@ -34,6 +35,10 @@ export type Data = {
|
|
|
34
35
|
* Server-generated ID for the assistant message. Use this ID for frontend state consistency.
|
|
35
36
|
*/
|
|
36
37
|
assistantMessageId?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Telemetry information for correlating the response with traces
|
|
40
|
+
*/
|
|
41
|
+
telemetry?: Telemetry | undefined;
|
|
37
42
|
};
|
|
38
43
|
|
|
39
44
|
/**
|
|
@@ -57,6 +62,7 @@ export const Data$inboundSchema: z.ZodType<Data, z.ZodTypeDef, unknown> = z
|
|
|
57
62
|
workflowRunId: z.string(),
|
|
58
63
|
userMessageId: z.string().optional(),
|
|
59
64
|
assistantMessageId: z.string().optional(),
|
|
65
|
+
telemetry: Telemetry$inboundSchema.optional(),
|
|
60
66
|
});
|
|
61
67
|
|
|
62
68
|
export function dataFromJSON(
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
/**
|
|
12
|
+
* Telemetry information for correlating the response with traces
|
|
13
|
+
*/
|
|
14
|
+
export type Telemetry = {
|
|
15
|
+
/**
|
|
16
|
+
* The root trace ID for the agent execution
|
|
17
|
+
*/
|
|
18
|
+
traceId: string;
|
|
19
|
+
/**
|
|
20
|
+
* The span ID of the agent execution within the trace
|
|
21
|
+
*/
|
|
22
|
+
spanId: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const Telemetry$inboundSchema: z.ZodType<
|
|
27
|
+
Telemetry,
|
|
28
|
+
z.ZodTypeDef,
|
|
29
|
+
unknown
|
|
30
|
+
> = z.object({
|
|
31
|
+
trace_id: z.string(),
|
|
32
|
+
span_id: z.string(),
|
|
33
|
+
}).transform((v) => {
|
|
34
|
+
return remap$(v, {
|
|
35
|
+
"trace_id": "traceId",
|
|
36
|
+
"span_id": "spanId",
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export function telemetryFromJSON(
|
|
41
|
+
jsonString: string,
|
|
42
|
+
): SafeParseResult<Telemetry, SDKValidationError> {
|
|
43
|
+
return safeParse(
|
|
44
|
+
jsonString,
|
|
45
|
+
(x) => Telemetry$inboundSchema.parse(JSON.parse(x)),
|
|
46
|
+
`Failed to parse 'Telemetry' from JSON`,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -20,6 +20,8 @@ export * from "./honoapierror.js";
|
|
|
20
20
|
export * from "./httpclienterrors.js";
|
|
21
21
|
export * from "./invokeeval.js";
|
|
22
22
|
export * from "./orqerror.js";
|
|
23
|
+
export * from "./postv2agentsa2a.js";
|
|
24
|
+
export * from "./postv2agentskeycardrefresh.js";
|
|
23
25
|
export * from "./responsevalidationerror.js";
|
|
24
26
|
export * from "./retrieveagentrequest.js";
|
|
25
27
|
export * from "./retrieveidentity.js";
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { OrqError } from "./orqerror.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Agent with this key already exists
|
|
10
|
+
*/
|
|
11
|
+
export type PostV2AgentsA2aAgentsResponseBodyData = {
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Agent with this key already exists
|
|
17
|
+
*/
|
|
18
|
+
export class PostV2AgentsA2aAgentsResponseBody extends OrqError {
|
|
19
|
+
/** The original data that was passed to this error instance. */
|
|
20
|
+
data$: PostV2AgentsA2aAgentsResponseBodyData;
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
err: PostV2AgentsA2aAgentsResponseBodyData,
|
|
24
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
25
|
+
) {
|
|
26
|
+
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
|
|
27
|
+
super(message, httpMeta);
|
|
28
|
+
this.data$ = err;
|
|
29
|
+
|
|
30
|
+
this.name = "PostV2AgentsA2aAgentsResponseBody";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Invalid request or agent card fetch failed
|
|
36
|
+
*/
|
|
37
|
+
export type PostV2AgentsA2aResponseBodyData = {
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Invalid request or agent card fetch failed
|
|
43
|
+
*/
|
|
44
|
+
export class PostV2AgentsA2aResponseBody extends OrqError {
|
|
45
|
+
/** The original data that was passed to this error instance. */
|
|
46
|
+
data$: PostV2AgentsA2aResponseBodyData;
|
|
47
|
+
|
|
48
|
+
constructor(
|
|
49
|
+
err: PostV2AgentsA2aResponseBodyData,
|
|
50
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
51
|
+
) {
|
|
52
|
+
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
|
|
53
|
+
super(message, httpMeta);
|
|
54
|
+
this.data$ = err;
|
|
55
|
+
|
|
56
|
+
this.name = "PostV2AgentsA2aResponseBody";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const PostV2AgentsA2aAgentsResponseBody$inboundSchema: z.ZodType<
|
|
62
|
+
PostV2AgentsA2aAgentsResponseBody,
|
|
63
|
+
z.ZodTypeDef,
|
|
64
|
+
unknown
|
|
65
|
+
> = z.object({
|
|
66
|
+
message: z.string(),
|
|
67
|
+
request$: z.instanceof(Request),
|
|
68
|
+
response$: z.instanceof(Response),
|
|
69
|
+
body$: z.string(),
|
|
70
|
+
})
|
|
71
|
+
.transform((v) => {
|
|
72
|
+
return new PostV2AgentsA2aAgentsResponseBody(v, {
|
|
73
|
+
request: v.request$,
|
|
74
|
+
response: v.response$,
|
|
75
|
+
body: v.body$,
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const PostV2AgentsA2aResponseBody$inboundSchema: z.ZodType<
|
|
81
|
+
PostV2AgentsA2aResponseBody,
|
|
82
|
+
z.ZodTypeDef,
|
|
83
|
+
unknown
|
|
84
|
+
> = z.object({
|
|
85
|
+
message: z.string(),
|
|
86
|
+
request$: z.instanceof(Request),
|
|
87
|
+
response$: z.instanceof(Response),
|
|
88
|
+
body$: z.string(),
|
|
89
|
+
})
|
|
90
|
+
.transform((v) => {
|
|
91
|
+
return new PostV2AgentsA2aResponseBody(v, {
|
|
92
|
+
request: v.request$,
|
|
93
|
+
response: v.response$,
|
|
94
|
+
body: v.body$,
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { OrqError } from "./orqerror.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Agent not found
|
|
10
|
+
*/
|
|
11
|
+
export type PostV2AgentsKeyCardRefreshAgentsResponseBodyData = {
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Agent not found
|
|
17
|
+
*/
|
|
18
|
+
export class PostV2AgentsKeyCardRefreshAgentsResponseBody extends OrqError {
|
|
19
|
+
/** The original data that was passed to this error instance. */
|
|
20
|
+
data$: PostV2AgentsKeyCardRefreshAgentsResponseBodyData;
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
err: PostV2AgentsKeyCardRefreshAgentsResponseBodyData,
|
|
24
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
25
|
+
) {
|
|
26
|
+
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
|
|
27
|
+
super(message, httpMeta);
|
|
28
|
+
this.data$ = err;
|
|
29
|
+
|
|
30
|
+
this.name = "PostV2AgentsKeyCardRefreshAgentsResponseBody";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Invalid request - Agent is not an A2A agent or card fetch failed
|
|
36
|
+
*/
|
|
37
|
+
export type PostV2AgentsKeyCardRefreshResponseBodyData = {
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Invalid request - Agent is not an A2A agent or card fetch failed
|
|
43
|
+
*/
|
|
44
|
+
export class PostV2AgentsKeyCardRefreshResponseBody extends OrqError {
|
|
45
|
+
/** The original data that was passed to this error instance. */
|
|
46
|
+
data$: PostV2AgentsKeyCardRefreshResponseBodyData;
|
|
47
|
+
|
|
48
|
+
constructor(
|
|
49
|
+
err: PostV2AgentsKeyCardRefreshResponseBodyData,
|
|
50
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
51
|
+
) {
|
|
52
|
+
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
|
|
53
|
+
super(message, httpMeta);
|
|
54
|
+
this.data$ = err;
|
|
55
|
+
|
|
56
|
+
this.name = "PostV2AgentsKeyCardRefreshResponseBody";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const PostV2AgentsKeyCardRefreshAgentsResponseBody$inboundSchema:
|
|
62
|
+
z.ZodType<
|
|
63
|
+
PostV2AgentsKeyCardRefreshAgentsResponseBody,
|
|
64
|
+
z.ZodTypeDef,
|
|
65
|
+
unknown
|
|
66
|
+
> = z.object({
|
|
67
|
+
message: z.string(),
|
|
68
|
+
request$: z.instanceof(Request),
|
|
69
|
+
response$: z.instanceof(Response),
|
|
70
|
+
body$: z.string(),
|
|
71
|
+
})
|
|
72
|
+
.transform((v) => {
|
|
73
|
+
return new PostV2AgentsKeyCardRefreshAgentsResponseBody(v, {
|
|
74
|
+
request: v.request$,
|
|
75
|
+
response: v.response$,
|
|
76
|
+
body: v.body$,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
/** @internal */
|
|
81
|
+
export const PostV2AgentsKeyCardRefreshResponseBody$inboundSchema: z.ZodType<
|
|
82
|
+
PostV2AgentsKeyCardRefreshResponseBody,
|
|
83
|
+
z.ZodTypeDef,
|
|
84
|
+
unknown
|
|
85
|
+
> = z.object({
|
|
86
|
+
message: z.string(),
|
|
87
|
+
request$: z.instanceof(Request),
|
|
88
|
+
response$: z.instanceof(Response),
|
|
89
|
+
body$: z.string(),
|
|
90
|
+
})
|
|
91
|
+
.transform((v) => {
|
|
92
|
+
return new PostV2AgentsKeyCardRefreshResponseBody(v, {
|
|
93
|
+
request: v.request$,
|
|
94
|
+
response: v.response$,
|
|
95
|
+
body: v.body$,
|
|
96
|
+
});
|
|
97
|
+
});
|