@orq-ai/node 4.1.0-rc.33 → 4.1.0-rc.35
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 +27 -23
- package/bin/mcp-server.js +6400 -6141
- package/bin/mcp-server.js.map +66 -58
- package/examples/package-lock.json +1 -1
- package/funcs/conversationsGenerateName.d.ts +18 -0
- package/funcs/conversationsGenerateName.d.ts.map +1 -0
- package/funcs/conversationsGenerateName.js +128 -0
- package/funcs/conversationsGenerateName.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +3 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/conversationsGenerateName.d.ts +10 -0
- package/mcp-server/tools/conversationsGenerateName.d.ts.map +1 -0
- package/mcp-server/tools/conversationsGenerateName.js +66 -0
- package/mcp-server/tools/conversationsGenerateName.js.map +1 -0
- package/models/components/agentresponsemessage.d.ts +56 -0
- package/models/components/agentresponsemessage.d.ts.map +1 -0
- package/models/components/agentresponsemessage.js +116 -0
- package/models/components/agentresponsemessage.js.map +1 -0
- package/models/components/agentstartedstreamingevent.d.ts +6 -6
- package/models/components/agentstartedstreamingevent.d.ts.map +1 -1
- package/models/components/agentstartedstreamingevent.js +11 -12
- package/models/components/agentstartedstreamingevent.js.map +1 -1
- package/models/components/conversationresponse.d.ts +39 -5
- package/models/components/conversationresponse.d.ts.map +1 -1
- package/models/components/conversationresponse.js +52 -8
- package/models/components/conversationresponse.js.map +1 -1
- package/models/components/createagentresponse.d.ts +124 -0
- package/models/components/createagentresponse.d.ts.map +1 -0
- package/models/components/createagentresponse.js +191 -0
- package/models/components/createagentresponse.js.map +1 -0
- package/models/components/index.d.ts +4 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +4 -0
- package/models/components/index.js.map +1 -1
- package/models/components/invokedeploymentrequest.d.ts +8 -8
- package/models/components/invokedeploymentrequest.d.ts.map +1 -1
- package/models/components/invokedeploymentrequest.js +13 -11
- package/models/components/invokedeploymentrequest.js.map +1 -1
- package/models/components/partdoneevent.js +2 -2
- package/models/components/reasoningpart.js +2 -2
- package/models/components/responsedoneevent.d.ts +24 -24
- package/models/components/responsedoneevent.d.ts.map +1 -1
- package/models/components/responsedoneevent.js +31 -32
- package/models/components/responsedoneevent.js.map +1 -1
- package/models/components/thinkingconfigdisabledschema.d.ts +23 -0
- package/models/components/thinkingconfigdisabledschema.d.ts.map +1 -0
- package/models/components/thinkingconfigdisabledschema.js +58 -0
- package/models/components/thinkingconfigdisabledschema.js.map +1 -0
- package/models/components/thinkingconfigenabledschema.d.ts +49 -0
- package/models/components/thinkingconfigenabledschema.d.ts.map +1 -0
- package/models/components/thinkingconfigenabledschema.js +84 -0
- package/models/components/thinkingconfigenabledschema.js.map +1 -0
- package/models/errors/generateconversationname.d.ts +55 -0
- package/models/errors/generateconversationname.d.ts.map +1 -0
- package/models/errors/generateconversationname.js +106 -0
- package/models/errors/generateconversationname.js.map +1 -0
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/operations/createagentrequest.d.ts +17 -204
- package/models/operations/createagentrequest.d.ts.map +1 -1
- package/models/operations/createagentrequest.js +75 -194
- package/models/operations/createagentrequest.js.map +1 -1
- package/models/operations/createagentresponserequest.d.ts +22 -166
- package/models/operations/createagentresponserequest.d.ts.map +1 -1
- package/models/operations/createagentresponserequest.js +32 -227
- package/models/operations/createagentresponserequest.js.map +1 -1
- package/models/operations/createbudget.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createconversation.d.ts +62 -8
- package/models/operations/createconversation.d.ts.map +1 -1
- package/models/operations/createconversation.js +94 -10
- package/models/operations/createconversation.js.map +1 -1
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +8 -8
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +28 -28
- package/models/operations/createprompt.d.ts +10 -10
- package/models/operations/createprompt.d.ts.map +1 -1
- package/models/operations/createprompt.js +13 -13
- package/models/operations/createprompt.js.map +1 -1
- package/models/operations/createtool.js +12 -12
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/generateconversationname.d.ts +136 -0
- package/models/operations/generateconversationname.d.ts.map +1 -0
- package/models/operations/generateconversationname.js +179 -0
- package/models/operations/generateconversationname.js.map +1 -0
- package/models/operations/getalltools.js +12 -12
- package/models/operations/getbudget.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/invokeagent.d.ts +6 -6
- package/models/operations/invokeagent.d.ts.map +1 -1
- package/models/operations/invokeagent.js +10 -9
- package/models/operations/invokeagent.js.map +1 -1
- package/models/operations/listagents.d.ts +9 -102
- package/models/operations/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js +38 -97
- package/models/operations/listagents.js.map +1 -1
- package/models/operations/listbudgets.js +2 -2
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +8 -8
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrieveagentrequest.d.ts +9 -102
- package/models/operations/retrieveagentrequest.d.ts.map +1 -1
- package/models/operations/retrieveagentrequest.js +38 -97
- package/models/operations/retrieveagentrequest.js.map +1 -1
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrieveconversation.d.ts +39 -5
- package/models/operations/retrieveconversation.d.ts.map +1 -1
- package/models/operations/retrieveconversation.js +53 -8
- package/models/operations/retrieveconversation.js.map +1 -1
- package/models/operations/retrievedatapoint.js +8 -8
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrievetool.js +12 -12
- package/models/operations/runagent.d.ts +8 -102
- package/models/operations/runagent.d.ts.map +1 -1
- package/models/operations/runagent.js +41 -104
- package/models/operations/runagent.js.map +1 -1
- package/models/operations/streamrunagent.d.ts +8 -102
- package/models/operations/streamrunagent.d.ts.map +1 -1
- package/models/operations/streamrunagent.js +41 -103
- package/models/operations/streamrunagent.js.map +1 -1
- package/models/operations/updateagent.d.ts +17 -204
- package/models/operations/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +75 -193
- package/models/operations/updateagent.js.map +1 -1
- package/models/operations/updatebudget.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updateconversation.d.ts +63 -6
- package/models/operations/updateconversation.d.ts.map +1 -1
- package/models/operations/updateconversation.js +93 -9
- package/models/operations/updateconversation.js.map +1 -1
- package/models/operations/updatedatapoint.js +8 -8
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +28 -28
- package/models/operations/updatetool.js +14 -14
- package/package.json +1 -1
- package/sdk/conversations.d.ts +7 -0
- package/sdk/conversations.d.ts.map +1 -1
- package/sdk/conversations.js +10 -0
- package/sdk/conversations.js.map +1 -1
- package/src/funcs/conversationsGenerateName.ts +194 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/conversationsGenerateName.ts +40 -0
- package/src/models/components/agentresponsemessage.ts +185 -0
- package/src/models/components/agentstartedstreamingevent.ts +30 -21
- package/src/models/components/conversationresponse.ts +100 -12
- package/src/models/components/createagentresponse.ts +340 -0
- package/src/models/components/index.ts +4 -0
- package/src/models/components/invokedeploymentrequest.ts +25 -17
- package/src/models/components/partdoneevent.ts +2 -2
- package/src/models/components/reasoningpart.ts +2 -2
- package/src/models/components/responsedoneevent.ts +93 -68
- package/src/models/components/thinkingconfigdisabledschema.ts +59 -0
- package/src/models/components/thinkingconfigenabledschema.ts +106 -0
- package/src/models/errors/generateconversationname.ts +132 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/operations/createagentrequest.ts +123 -369
- package/src/models/operations/createagentresponserequest.ts +71 -513
- package/src/models/operations/createbudget.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createconversation.ts +192 -17
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +8 -8
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +28 -28
- package/src/models/operations/createprompt.ts +23 -25
- package/src/models/operations/createtool.ts +12 -12
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/generateconversationname.ts +341 -0
- package/src/models/operations/getalltools.ts +12 -12
- package/src/models/operations/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/invokeagent.ts +19 -26
- package/src/models/operations/listagents.ts +63 -186
- package/src/models/operations/listbudgets.ts +2 -2
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrieveagentrequest.ts +61 -194
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrieveconversation.ts +107 -12
- package/src/models/operations/retrievedatapoint.ts +8 -8
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrievetool.ts +12 -12
- package/src/models/operations/runagent.ts +64 -194
- package/src/models/operations/streamrunagent.ts +62 -201
- package/src/models/operations/updateagent.ts +123 -379
- package/src/models/operations/updatebudget.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updateconversation.ts +192 -14
- package/src/models/operations/updatedatapoint.ts +8 -8
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +28 -28
- package/src/models/operations/updatetool.ts +14 -14
- package/src/sdk/conversations.ts +20 -0
|
@@ -55,7 +55,7 @@ export type AgentStartedStreamingEventRole = ClosedEnum<
|
|
|
55
55
|
typeof AgentStartedStreamingEventRole
|
|
56
56
|
>;
|
|
57
57
|
|
|
58
|
-
export type
|
|
58
|
+
export type AgentStartedStreamingEventParts =
|
|
59
59
|
| TextPart
|
|
60
60
|
| DataPart
|
|
61
61
|
| FilePart
|
|
@@ -246,16 +246,19 @@ export const AgentStartedStreamingEventRole$outboundSchema: z.ZodNativeEnum<
|
|
|
246
246
|
> = AgentStartedStreamingEventRole$inboundSchema;
|
|
247
247
|
|
|
248
248
|
/** @internal */
|
|
249
|
-
export const
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
249
|
+
export const AgentStartedStreamingEventParts$inboundSchema: z.ZodType<
|
|
250
|
+
AgentStartedStreamingEventParts,
|
|
251
|
+
z.ZodTypeDef,
|
|
252
|
+
unknown
|
|
253
|
+
> = z.union([
|
|
254
|
+
TextPart$inboundSchema,
|
|
255
|
+
DataPart$inboundSchema,
|
|
256
|
+
FilePart$inboundSchema,
|
|
257
|
+
ToolCallPart$inboundSchema,
|
|
258
|
+
ToolResultPart$inboundSchema,
|
|
259
|
+
]);
|
|
257
260
|
/** @internal */
|
|
258
|
-
export type
|
|
261
|
+
export type AgentStartedStreamingEventParts$Outbound =
|
|
259
262
|
| TextPart$Outbound
|
|
260
263
|
| DataPart$Outbound
|
|
261
264
|
| FilePart$Outbound
|
|
@@ -263,10 +266,10 @@ export type Parts$Outbound =
|
|
|
263
266
|
| ToolResultPart$Outbound;
|
|
264
267
|
|
|
265
268
|
/** @internal */
|
|
266
|
-
export const
|
|
267
|
-
|
|
269
|
+
export const AgentStartedStreamingEventParts$outboundSchema: z.ZodType<
|
|
270
|
+
AgentStartedStreamingEventParts$Outbound,
|
|
268
271
|
z.ZodTypeDef,
|
|
269
|
-
|
|
272
|
+
AgentStartedStreamingEventParts
|
|
270
273
|
> = z.union([
|
|
271
274
|
TextPart$outboundSchema,
|
|
272
275
|
DataPart$outboundSchema,
|
|
@@ -275,16 +278,22 @@ export const Parts$outboundSchema: z.ZodType<
|
|
|
275
278
|
ToolResultPart$outboundSchema,
|
|
276
279
|
]);
|
|
277
280
|
|
|
278
|
-
export function
|
|
279
|
-
|
|
281
|
+
export function agentStartedStreamingEventPartsToJSON(
|
|
282
|
+
agentStartedStreamingEventParts: AgentStartedStreamingEventParts,
|
|
283
|
+
): string {
|
|
284
|
+
return JSON.stringify(
|
|
285
|
+
AgentStartedStreamingEventParts$outboundSchema.parse(
|
|
286
|
+
agentStartedStreamingEventParts,
|
|
287
|
+
),
|
|
288
|
+
);
|
|
280
289
|
}
|
|
281
|
-
export function
|
|
290
|
+
export function agentStartedStreamingEventPartsFromJSON(
|
|
282
291
|
jsonString: string,
|
|
283
|
-
): SafeParseResult<
|
|
292
|
+
): SafeParseResult<AgentStartedStreamingEventParts, SDKValidationError> {
|
|
284
293
|
return safeParse(
|
|
285
294
|
jsonString,
|
|
286
|
-
(x) =>
|
|
287
|
-
`Failed to parse '
|
|
295
|
+
(x) => AgentStartedStreamingEventParts$inboundSchema.parse(JSON.parse(x)),
|
|
296
|
+
`Failed to parse 'AgentStartedStreamingEventParts' from JSON`,
|
|
288
297
|
);
|
|
289
298
|
}
|
|
290
299
|
|
|
@@ -610,7 +619,7 @@ export const Settings$inboundSchema: z.ZodType<
|
|
|
610
619
|
unknown
|
|
611
620
|
> = z.object({
|
|
612
621
|
max_iterations: z.number().int().default(100),
|
|
613
|
-
max_execution_time: z.number().int().default(
|
|
622
|
+
max_execution_time: z.number().int().default(600),
|
|
614
623
|
tool_approval_required: ToolApprovalRequired$inboundSchema.default(
|
|
615
624
|
"respect_tool",
|
|
616
625
|
),
|
|
@@ -641,7 +650,7 @@ export const Settings$outboundSchema: z.ZodType<
|
|
|
641
650
|
Settings
|
|
642
651
|
> = z.object({
|
|
643
652
|
maxIterations: z.number().int().default(100),
|
|
644
|
-
maxExecutionTime: z.number().int().default(
|
|
653
|
+
maxExecutionTime: z.number().int().default(600),
|
|
645
654
|
toolApprovalRequired: ToolApprovalRequired$outboundSchema.default(
|
|
646
655
|
"respect_tool",
|
|
647
656
|
),
|
|
@@ -22,11 +22,29 @@ export type ConversationResponseKind = ClosedEnum<
|
|
|
22
22
|
typeof ConversationResponseKind
|
|
23
23
|
>;
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Optional metadata associated with the conversation.
|
|
27
|
+
*/
|
|
28
|
+
export type Metadata = {
|
|
29
|
+
/**
|
|
30
|
+
* Indicates whether the conversation title is currently being generated by AI.
|
|
31
|
+
*/
|
|
32
|
+
generatingTitle?: boolean | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Identifier of the parent entity (agent, deployment, etc.) this conversation belongs to. Used for filtering conversations by entity.
|
|
35
|
+
*/
|
|
36
|
+
entityId?: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
|
|
25
39
|
export type ConversationResponse = {
|
|
26
40
|
/**
|
|
27
41
|
* Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the conversation, prefixed with "conv_"
|
|
28
42
|
*/
|
|
29
43
|
id?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Identifier of the parent entity (agent, deployment, etc.) this conversation belongs to.
|
|
46
|
+
*/
|
|
47
|
+
entityId: string;
|
|
30
48
|
/**
|
|
31
49
|
* Type discriminator indicating this is a conversation
|
|
32
50
|
*/
|
|
@@ -51,6 +69,10 @@ export type ConversationResponse = {
|
|
|
51
69
|
* Optional identifier of the user or agent that last updated the conversation
|
|
52
70
|
*/
|
|
53
71
|
updatedById?: string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Optional metadata associated with the conversation.
|
|
74
|
+
*/
|
|
75
|
+
metadata?: Metadata | undefined;
|
|
54
76
|
};
|
|
55
77
|
|
|
56
78
|
/** @internal */
|
|
@@ -62,33 +84,91 @@ export const ConversationResponseKind$outboundSchema: z.ZodNativeEnum<
|
|
|
62
84
|
typeof ConversationResponseKind
|
|
63
85
|
> = ConversationResponseKind$inboundSchema;
|
|
64
86
|
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const Metadata$inboundSchema: z.ZodType<
|
|
89
|
+
Metadata,
|
|
90
|
+
z.ZodTypeDef,
|
|
91
|
+
unknown
|
|
92
|
+
> = z.object({
|
|
93
|
+
generating_title: z.boolean().optional(),
|
|
94
|
+
entity_id: z.string().optional(),
|
|
95
|
+
}).transform((v) => {
|
|
96
|
+
return remap$(v, {
|
|
97
|
+
"generating_title": "generatingTitle",
|
|
98
|
+
"entity_id": "entityId",
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
/** @internal */
|
|
102
|
+
export type Metadata$Outbound = {
|
|
103
|
+
generating_title?: boolean | undefined;
|
|
104
|
+
entity_id?: string | undefined;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/** @internal */
|
|
108
|
+
export const Metadata$outboundSchema: z.ZodType<
|
|
109
|
+
Metadata$Outbound,
|
|
110
|
+
z.ZodTypeDef,
|
|
111
|
+
Metadata
|
|
112
|
+
> = z.object({
|
|
113
|
+
generatingTitle: z.boolean().optional(),
|
|
114
|
+
entityId: z.string().optional(),
|
|
115
|
+
}).transform((v) => {
|
|
116
|
+
return remap$(v, {
|
|
117
|
+
generatingTitle: "generating_title",
|
|
118
|
+
entityId: "entity_id",
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export function metadataToJSON(metadata: Metadata): string {
|
|
123
|
+
return JSON.stringify(Metadata$outboundSchema.parse(metadata));
|
|
124
|
+
}
|
|
125
|
+
export function metadataFromJSON(
|
|
126
|
+
jsonString: string,
|
|
127
|
+
): SafeParseResult<Metadata, SDKValidationError> {
|
|
128
|
+
return safeParse(
|
|
129
|
+
jsonString,
|
|
130
|
+
(x) => Metadata$inboundSchema.parse(JSON.parse(x)),
|
|
131
|
+
`Failed to parse 'Metadata' from JSON`,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
65
135
|
/** @internal */
|
|
66
136
|
export const ConversationResponse$inboundSchema: z.ZodType<
|
|
67
137
|
ConversationResponse,
|
|
68
138
|
z.ZodTypeDef,
|
|
69
139
|
unknown
|
|
70
140
|
> = z.object({
|
|
71
|
-
_id: z.string().default("
|
|
141
|
+
_id: z.string().default("conv_01kc3ce289afsc6egz69qexm0b"),
|
|
142
|
+
entity_id: z.string(),
|
|
72
143
|
kind: ConversationResponseKind$inboundSchema,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
144
|
+
display_name: z.string(),
|
|
145
|
+
created_at: z.number(),
|
|
146
|
+
updated_at: z.number(),
|
|
147
|
+
created_by_id: z.string().optional(),
|
|
148
|
+
updated_by_id: z.string().optional(),
|
|
149
|
+
metadata: z.lazy(() => Metadata$inboundSchema).optional(),
|
|
78
150
|
}).transform((v) => {
|
|
79
151
|
return remap$(v, {
|
|
80
152
|
"_id": "id",
|
|
153
|
+
"entity_id": "entityId",
|
|
154
|
+
"display_name": "displayName",
|
|
155
|
+
"created_at": "createdAt",
|
|
156
|
+
"updated_at": "updatedAt",
|
|
157
|
+
"created_by_id": "createdById",
|
|
158
|
+
"updated_by_id": "updatedById",
|
|
81
159
|
});
|
|
82
160
|
});
|
|
83
161
|
/** @internal */
|
|
84
162
|
export type ConversationResponse$Outbound = {
|
|
85
163
|
_id: string;
|
|
164
|
+
entity_id: string;
|
|
86
165
|
kind: string;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
166
|
+
display_name: string;
|
|
167
|
+
created_at: number;
|
|
168
|
+
updated_at: number;
|
|
169
|
+
created_by_id?: string | undefined;
|
|
170
|
+
updated_by_id?: string | undefined;
|
|
171
|
+
metadata?: Metadata$Outbound | undefined;
|
|
92
172
|
};
|
|
93
173
|
|
|
94
174
|
/** @internal */
|
|
@@ -97,16 +177,24 @@ export const ConversationResponse$outboundSchema: z.ZodType<
|
|
|
97
177
|
z.ZodTypeDef,
|
|
98
178
|
ConversationResponse
|
|
99
179
|
> = z.object({
|
|
100
|
-
id: z.string().default("
|
|
180
|
+
id: z.string().default("conv_01kc3ce289afsc6egz69qexm0b"),
|
|
181
|
+
entityId: z.string(),
|
|
101
182
|
kind: ConversationResponseKind$outboundSchema,
|
|
102
183
|
displayName: z.string(),
|
|
103
184
|
createdAt: z.number(),
|
|
104
185
|
updatedAt: z.number(),
|
|
105
186
|
createdById: z.string().optional(),
|
|
106
187
|
updatedById: z.string().optional(),
|
|
188
|
+
metadata: z.lazy(() => Metadata$outboundSchema).optional(),
|
|
107
189
|
}).transform((v) => {
|
|
108
190
|
return remap$(v, {
|
|
109
191
|
id: "_id",
|
|
192
|
+
entityId: "entity_id",
|
|
193
|
+
displayName: "display_name",
|
|
194
|
+
createdAt: "created_at",
|
|
195
|
+
updatedAt: "updated_at",
|
|
196
|
+
createdById: "created_by_id",
|
|
197
|
+
updatedById: "updated_by_id",
|
|
110
198
|
});
|
|
111
199
|
});
|
|
112
200
|
|
|
@@ -0,0 +1,340 @@
|
|
|
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 {
|
|
11
|
+
AgentResponseMessage,
|
|
12
|
+
AgentResponseMessage$inboundSchema,
|
|
13
|
+
AgentResponseMessage$Outbound,
|
|
14
|
+
AgentResponseMessage$outboundSchema,
|
|
15
|
+
} from "./agentresponsemessage.js";
|
|
16
|
+
|
|
17
|
+
export type PromptTokensDetails = {
|
|
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 CompletionTokensDetails = {
|
|
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 Usage = {
|
|
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?: PromptTokensDetails | null | undefined;
|
|
53
|
+
completionTokensDetails?: CompletionTokensDetails | null | undefined;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Response type from the create-response endpoint.
|
|
58
|
+
*/
|
|
59
|
+
export type CreateAgentResponse = {
|
|
60
|
+
/**
|
|
61
|
+
* The unique response ID
|
|
62
|
+
*/
|
|
63
|
+
id: string;
|
|
64
|
+
/**
|
|
65
|
+
* The agent execution task ID
|
|
66
|
+
*/
|
|
67
|
+
taskId: string;
|
|
68
|
+
/**
|
|
69
|
+
* Array of messages from the agent execution
|
|
70
|
+
*/
|
|
71
|
+
output: Array<AgentResponseMessage>;
|
|
72
|
+
/**
|
|
73
|
+
* ISO timestamp of response creation
|
|
74
|
+
*/
|
|
75
|
+
createdAt: string;
|
|
76
|
+
/**
|
|
77
|
+
* Model used in provider/model format
|
|
78
|
+
*/
|
|
79
|
+
model: string;
|
|
80
|
+
/**
|
|
81
|
+
* Token usage from the agent execution
|
|
82
|
+
*/
|
|
83
|
+
usage?: Usage | null | undefined;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const PromptTokensDetails$inboundSchema: z.ZodType<
|
|
88
|
+
PromptTokensDetails,
|
|
89
|
+
z.ZodTypeDef,
|
|
90
|
+
unknown
|
|
91
|
+
> = z.object({
|
|
92
|
+
cached_tokens: z.nullable(z.number().int()).optional(),
|
|
93
|
+
cache_creation_tokens: z.nullable(z.number().int()).optional(),
|
|
94
|
+
audio_tokens: z.nullable(z.number().int()).optional(),
|
|
95
|
+
}).transform((v) => {
|
|
96
|
+
return remap$(v, {
|
|
97
|
+
"cached_tokens": "cachedTokens",
|
|
98
|
+
"cache_creation_tokens": "cacheCreationTokens",
|
|
99
|
+
"audio_tokens": "audioTokens",
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
/** @internal */
|
|
103
|
+
export type PromptTokensDetails$Outbound = {
|
|
104
|
+
cached_tokens?: number | null | undefined;
|
|
105
|
+
cache_creation_tokens?: number | null | undefined;
|
|
106
|
+
audio_tokens?: number | null | undefined;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** @internal */
|
|
110
|
+
export const PromptTokensDetails$outboundSchema: z.ZodType<
|
|
111
|
+
PromptTokensDetails$Outbound,
|
|
112
|
+
z.ZodTypeDef,
|
|
113
|
+
PromptTokensDetails
|
|
114
|
+
> = z.object({
|
|
115
|
+
cachedTokens: z.nullable(z.number().int()).optional(),
|
|
116
|
+
cacheCreationTokens: z.nullable(z.number().int()).optional(),
|
|
117
|
+
audioTokens: z.nullable(z.number().int()).optional(),
|
|
118
|
+
}).transform((v) => {
|
|
119
|
+
return remap$(v, {
|
|
120
|
+
cachedTokens: "cached_tokens",
|
|
121
|
+
cacheCreationTokens: "cache_creation_tokens",
|
|
122
|
+
audioTokens: "audio_tokens",
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
export function promptTokensDetailsToJSON(
|
|
127
|
+
promptTokensDetails: PromptTokensDetails,
|
|
128
|
+
): string {
|
|
129
|
+
return JSON.stringify(
|
|
130
|
+
PromptTokensDetails$outboundSchema.parse(promptTokensDetails),
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
export function promptTokensDetailsFromJSON(
|
|
134
|
+
jsonString: string,
|
|
135
|
+
): SafeParseResult<PromptTokensDetails, SDKValidationError> {
|
|
136
|
+
return safeParse(
|
|
137
|
+
jsonString,
|
|
138
|
+
(x) => PromptTokensDetails$inboundSchema.parse(JSON.parse(x)),
|
|
139
|
+
`Failed to parse 'PromptTokensDetails' from JSON`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** @internal */
|
|
144
|
+
export const CompletionTokensDetails$inboundSchema: z.ZodType<
|
|
145
|
+
CompletionTokensDetails,
|
|
146
|
+
z.ZodTypeDef,
|
|
147
|
+
unknown
|
|
148
|
+
> = z.object({
|
|
149
|
+
reasoning_tokens: z.nullable(z.number()).optional(),
|
|
150
|
+
accepted_prediction_tokens: z.nullable(z.number()).optional(),
|
|
151
|
+
rejected_prediction_tokens: z.nullable(z.number()).optional(),
|
|
152
|
+
audio_tokens: z.nullable(z.number().int()).optional(),
|
|
153
|
+
}).transform((v) => {
|
|
154
|
+
return remap$(v, {
|
|
155
|
+
"reasoning_tokens": "reasoningTokens",
|
|
156
|
+
"accepted_prediction_tokens": "acceptedPredictionTokens",
|
|
157
|
+
"rejected_prediction_tokens": "rejectedPredictionTokens",
|
|
158
|
+
"audio_tokens": "audioTokens",
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
/** @internal */
|
|
162
|
+
export type CompletionTokensDetails$Outbound = {
|
|
163
|
+
reasoning_tokens?: number | null | undefined;
|
|
164
|
+
accepted_prediction_tokens?: number | null | undefined;
|
|
165
|
+
rejected_prediction_tokens?: number | null | undefined;
|
|
166
|
+
audio_tokens?: number | null | undefined;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/** @internal */
|
|
170
|
+
export const CompletionTokensDetails$outboundSchema: z.ZodType<
|
|
171
|
+
CompletionTokensDetails$Outbound,
|
|
172
|
+
z.ZodTypeDef,
|
|
173
|
+
CompletionTokensDetails
|
|
174
|
+
> = z.object({
|
|
175
|
+
reasoningTokens: z.nullable(z.number()).optional(),
|
|
176
|
+
acceptedPredictionTokens: z.nullable(z.number()).optional(),
|
|
177
|
+
rejectedPredictionTokens: z.nullable(z.number()).optional(),
|
|
178
|
+
audioTokens: z.nullable(z.number().int()).optional(),
|
|
179
|
+
}).transform((v) => {
|
|
180
|
+
return remap$(v, {
|
|
181
|
+
reasoningTokens: "reasoning_tokens",
|
|
182
|
+
acceptedPredictionTokens: "accepted_prediction_tokens",
|
|
183
|
+
rejectedPredictionTokens: "rejected_prediction_tokens",
|
|
184
|
+
audioTokens: "audio_tokens",
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
export function completionTokensDetailsToJSON(
|
|
189
|
+
completionTokensDetails: CompletionTokensDetails,
|
|
190
|
+
): string {
|
|
191
|
+
return JSON.stringify(
|
|
192
|
+
CompletionTokensDetails$outboundSchema.parse(completionTokensDetails),
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
export function completionTokensDetailsFromJSON(
|
|
196
|
+
jsonString: string,
|
|
197
|
+
): SafeParseResult<CompletionTokensDetails, SDKValidationError> {
|
|
198
|
+
return safeParse(
|
|
199
|
+
jsonString,
|
|
200
|
+
(x) => CompletionTokensDetails$inboundSchema.parse(JSON.parse(x)),
|
|
201
|
+
`Failed to parse 'CompletionTokensDetails' from JSON`,
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** @internal */
|
|
206
|
+
export const Usage$inboundSchema: z.ZodType<Usage, z.ZodTypeDef, unknown> = z
|
|
207
|
+
.object({
|
|
208
|
+
completion_tokens: z.number().optional(),
|
|
209
|
+
prompt_tokens: z.number().optional(),
|
|
210
|
+
total_tokens: z.number().optional(),
|
|
211
|
+
prompt_tokens_details: z.nullable(
|
|
212
|
+
z.lazy(() => PromptTokensDetails$inboundSchema),
|
|
213
|
+
).optional(),
|
|
214
|
+
completion_tokens_details: z.nullable(
|
|
215
|
+
z.lazy(() => CompletionTokensDetails$inboundSchema),
|
|
216
|
+
).optional(),
|
|
217
|
+
}).transform((v) => {
|
|
218
|
+
return remap$(v, {
|
|
219
|
+
"completion_tokens": "completionTokens",
|
|
220
|
+
"prompt_tokens": "promptTokens",
|
|
221
|
+
"total_tokens": "totalTokens",
|
|
222
|
+
"prompt_tokens_details": "promptTokensDetails",
|
|
223
|
+
"completion_tokens_details": "completionTokensDetails",
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
/** @internal */
|
|
227
|
+
export type Usage$Outbound = {
|
|
228
|
+
completion_tokens?: number | undefined;
|
|
229
|
+
prompt_tokens?: number | undefined;
|
|
230
|
+
total_tokens?: number | undefined;
|
|
231
|
+
prompt_tokens_details?: PromptTokensDetails$Outbound | null | undefined;
|
|
232
|
+
completion_tokens_details?:
|
|
233
|
+
| CompletionTokensDetails$Outbound
|
|
234
|
+
| null
|
|
235
|
+
| undefined;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/** @internal */
|
|
239
|
+
export const Usage$outboundSchema: z.ZodType<
|
|
240
|
+
Usage$Outbound,
|
|
241
|
+
z.ZodTypeDef,
|
|
242
|
+
Usage
|
|
243
|
+
> = z.object({
|
|
244
|
+
completionTokens: z.number().optional(),
|
|
245
|
+
promptTokens: z.number().optional(),
|
|
246
|
+
totalTokens: z.number().optional(),
|
|
247
|
+
promptTokensDetails: z.nullable(
|
|
248
|
+
z.lazy(() => PromptTokensDetails$outboundSchema),
|
|
249
|
+
).optional(),
|
|
250
|
+
completionTokensDetails: z.nullable(
|
|
251
|
+
z.lazy(() => CompletionTokensDetails$outboundSchema),
|
|
252
|
+
).optional(),
|
|
253
|
+
}).transform((v) => {
|
|
254
|
+
return remap$(v, {
|
|
255
|
+
completionTokens: "completion_tokens",
|
|
256
|
+
promptTokens: "prompt_tokens",
|
|
257
|
+
totalTokens: "total_tokens",
|
|
258
|
+
promptTokensDetails: "prompt_tokens_details",
|
|
259
|
+
completionTokensDetails: "completion_tokens_details",
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
export function usageToJSON(usage: Usage): string {
|
|
264
|
+
return JSON.stringify(Usage$outboundSchema.parse(usage));
|
|
265
|
+
}
|
|
266
|
+
export function usageFromJSON(
|
|
267
|
+
jsonString: string,
|
|
268
|
+
): SafeParseResult<Usage, SDKValidationError> {
|
|
269
|
+
return safeParse(
|
|
270
|
+
jsonString,
|
|
271
|
+
(x) => Usage$inboundSchema.parse(JSON.parse(x)),
|
|
272
|
+
`Failed to parse 'Usage' from JSON`,
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/** @internal */
|
|
277
|
+
export const CreateAgentResponse$inboundSchema: z.ZodType<
|
|
278
|
+
CreateAgentResponse,
|
|
279
|
+
z.ZodTypeDef,
|
|
280
|
+
unknown
|
|
281
|
+
> = z.object({
|
|
282
|
+
_id: z.string(),
|
|
283
|
+
task_id: z.string(),
|
|
284
|
+
output: z.array(AgentResponseMessage$inboundSchema),
|
|
285
|
+
created_at: z.string(),
|
|
286
|
+
model: z.string(),
|
|
287
|
+
usage: z.nullable(z.lazy(() => Usage$inboundSchema)).optional(),
|
|
288
|
+
}).transform((v) => {
|
|
289
|
+
return remap$(v, {
|
|
290
|
+
"_id": "id",
|
|
291
|
+
"task_id": "taskId",
|
|
292
|
+
"created_at": "createdAt",
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
/** @internal */
|
|
296
|
+
export type CreateAgentResponse$Outbound = {
|
|
297
|
+
_id: string;
|
|
298
|
+
task_id: string;
|
|
299
|
+
output: Array<AgentResponseMessage$Outbound>;
|
|
300
|
+
created_at: string;
|
|
301
|
+
model: string;
|
|
302
|
+
usage?: Usage$Outbound | null | undefined;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
/** @internal */
|
|
306
|
+
export const CreateAgentResponse$outboundSchema: z.ZodType<
|
|
307
|
+
CreateAgentResponse$Outbound,
|
|
308
|
+
z.ZodTypeDef,
|
|
309
|
+
CreateAgentResponse
|
|
310
|
+
> = z.object({
|
|
311
|
+
id: z.string(),
|
|
312
|
+
taskId: z.string(),
|
|
313
|
+
output: z.array(AgentResponseMessage$outboundSchema),
|
|
314
|
+
createdAt: z.string(),
|
|
315
|
+
model: z.string(),
|
|
316
|
+
usage: z.nullable(z.lazy(() => Usage$outboundSchema)).optional(),
|
|
317
|
+
}).transform((v) => {
|
|
318
|
+
return remap$(v, {
|
|
319
|
+
id: "_id",
|
|
320
|
+
taskId: "task_id",
|
|
321
|
+
createdAt: "created_at",
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
export function createAgentResponseToJSON(
|
|
326
|
+
createAgentResponse: CreateAgentResponse,
|
|
327
|
+
): string {
|
|
328
|
+
return JSON.stringify(
|
|
329
|
+
CreateAgentResponse$outboundSchema.parse(createAgentResponse),
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
export function createAgentResponseFromJSON(
|
|
333
|
+
jsonString: string,
|
|
334
|
+
): SafeParseResult<CreateAgentResponse, SDKValidationError> {
|
|
335
|
+
return safeParse(
|
|
336
|
+
jsonString,
|
|
337
|
+
(x) => CreateAgentResponse$inboundSchema.parse(JSON.parse(x)),
|
|
338
|
+
`Failed to parse 'CreateAgentResponse' from JSON`,
|
|
339
|
+
);
|
|
340
|
+
}
|
|
@@ -9,10 +9,12 @@ export * from "./agentexecutionstartedstreamingevent.js";
|
|
|
9
9
|
export * from "./agenthandedoffstreamingevent.js";
|
|
10
10
|
export * from "./agentinactivestreamingevent.js";
|
|
11
11
|
export * from "./agentmessagecreatedstreamingevent.js";
|
|
12
|
+
export * from "./agentresponsemessage.js";
|
|
12
13
|
export * from "./agentstartedstreamingevent.js";
|
|
13
14
|
export * from "./agentthoughtstreamingevent.js";
|
|
14
15
|
export * from "./audiocontentpartschema.js";
|
|
15
16
|
export * from "./conversationresponse.js";
|
|
17
|
+
export * from "./createagentresponse.js";
|
|
16
18
|
export * from "./datapart.js";
|
|
17
19
|
export * from "./errorstreamingevent.js";
|
|
18
20
|
export * from "./executionnamedstreamingevent.js";
|
|
@@ -37,6 +39,8 @@ export * from "./reviewoutcome.js";
|
|
|
37
39
|
export * from "./security.js";
|
|
38
40
|
export * from "./textcontentpartschema.js";
|
|
39
41
|
export * from "./textpart.js";
|
|
42
|
+
export * from "./thinkingconfigdisabledschema.js";
|
|
43
|
+
export * from "./thinkingconfigenabledschema.js";
|
|
40
44
|
export * from "./timeoutstreamingevent.js";
|
|
41
45
|
export * from "./toolcallpart.js";
|
|
42
46
|
export * from "./tooldoneevent.js";
|