@orq-ai/node 4.1.10 → 4.1.11
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/bin/mcp-server.js +222 -222
- package/bin/mcp-server.js.map +40 -40
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/sdks.js +2 -2
- package/lib/sdks.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/components/conversationresponse.js +2 -2
- package/models/components/partdoneevent.js +2 -2
- package/models/components/reasoningpart.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createconversation.js +2 -2
- 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/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.js +2 -2
- package/models/operations/getalltools.js +12 -12
- package/models/operations/getevals.js +28 -28
- 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/retrievecontact.js +2 -2
- package/models/operations/retrieveconversation.js +2 -2
- 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.js +2 -2
- package/models/operations/streamrunagent.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updateconversation.js +2 -2
- 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/packages/orq-rc/examples/package-lock.json +1 -1
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/agentsCreate.ts +2 -11
- package/packages/orq-rc/src/funcs/{evaluatorsGetV2EvaluatorsIdVersionsVersionId.ts → conversationsCreateConversationResponse.ts} +34 -38
- package/packages/orq-rc/src/funcs/conversationsList.ts +6 -1
- package/packages/orq-rc/src/funcs/conversationsRetrieve.ts +5 -4
- package/packages/orq-rc/src/funcs/memoryStoresCreateDocument.ts +6 -5
- package/packages/orq-rc/src/funcs/memoryStoresDeleteDocument.ts +6 -5
- package/packages/orq-rc/src/funcs/memoryStoresDeleteMemory.ts +6 -5
- package/packages/orq-rc/src/funcs/memoryStoresListDocuments.ts +6 -5
- package/packages/orq-rc/src/funcs/memoryStoresRetrieveDocument.ts +6 -5
- package/packages/orq-rc/src/funcs/memoryStoresRetrieveMemory.ts +6 -5
- package/packages/orq-rc/src/funcs/memoryStoresUpdateDocument.ts +6 -5
- package/packages/orq-rc/src/funcs/memoryStoresUpdateMemory.ts +6 -5
- package/packages/orq-rc/src/funcs/toolsCreate.ts +2 -11
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/lib/sdks.ts +2 -2
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +3 -3
- package/packages/orq-rc/src/mcp-server/tools/conversationsCreateConversationResponse.ts +39 -0
- package/packages/orq-rc/src/mcp-server/tools/conversationsList.ts +2 -0
- package/packages/orq-rc/src/models/components/agentinactivestreamingevent.ts +16 -1
- package/packages/orq-rc/src/models/components/agentmessagecreatedstreamingevent.ts +16 -1
- package/packages/orq-rc/src/models/components/agentresponsemessage.ts +16 -1
- package/packages/orq-rc/src/models/components/agentstartedstreamingevent.ts +16 -1
- package/packages/orq-rc/src/models/components/agentthoughtstreamingevent.ts +16 -1
- package/packages/orq-rc/src/models/components/conversationresponse.ts +26 -26
- package/packages/orq-rc/src/models/components/conversationwithmessagesresponse.ts +226 -0
- package/packages/orq-rc/src/models/components/errorpart.ts +58 -0
- package/packages/orq-rc/src/models/components/index.ts +4 -0
- package/packages/orq-rc/src/models/components/messageresponse.ts +217 -0
- package/packages/orq-rc/src/models/components/partdoneevent.ts +2 -2
- package/packages/orq-rc/src/models/components/publiccontact.ts +1 -1
- package/packages/orq-rc/src/models/components/reasoningpart.ts +2 -2
- package/packages/orq-rc/src/models/components/responsestartedevent.ts +14 -0
- package/packages/orq-rc/src/models/components/toolexecutionfailedstreamingevent.ts +1 -0
- package/packages/orq-rc/src/models/components/toolexecutionfinishedstreamingevent.ts +1 -0
- package/packages/orq-rc/src/models/components/toolexecutionstartedstreamingevent.ts +1 -0
- package/packages/orq-rc/src/models/components/usermessagerequest.ts +194 -0
- package/packages/orq-rc/src/models/errors/index.ts +0 -2
- package/packages/orq-rc/src/models/operations/createagentrequest.ts +40 -0
- package/packages/orq-rc/src/models/operations/createagentresponserequest.ts +122 -5
- package/packages/orq-rc/src/models/operations/createchatcompletion.ts +110 -7
- package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/createconversation.ts +59 -36
- package/packages/orq-rc/src/models/operations/createconversationresponse.ts +794 -0
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +48 -40
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +28 -28
- package/packages/orq-rc/src/models/operations/createimage.ts +105 -5
- package/packages/orq-rc/src/models/operations/creatememory.ts +3 -15
- package/packages/orq-rc/src/models/operations/creatememorydocument.ts +7 -7
- package/packages/orq-rc/src/models/operations/createtool.ts +12 -12
- package/packages/orq-rc/src/models/operations/deletememory.ts +6 -6
- package/packages/orq-rc/src/models/operations/deletememorydocument.ts +6 -6
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/generateconversationname.ts +27 -27
- package/packages/orq-rc/src/models/operations/getallmemories.ts +3 -8
- package/packages/orq-rc/src/models/operations/getallmemorydocuments.ts +6 -6
- package/packages/orq-rc/src/models/operations/getalltools.ts +12 -12
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/getv2evaluatorsidversions.ts +4 -4
- package/packages/orq-rc/src/models/operations/getv2toolstoolidversions.ts +4 -4
- package/packages/orq-rc/src/models/operations/getv2toolstoolidversionsversionid.ts +4 -4
- package/packages/orq-rc/src/models/operations/index.ts +1 -1
- package/packages/orq-rc/src/models/operations/invokeagent.ts +128 -5
- package/packages/orq-rc/src/models/operations/listagents.ts +20 -0
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listconversations.ts +10 -3
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +53 -53
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
- package/packages/orq-rc/src/models/operations/parse.ts +157 -2
- package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +22 -0
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrieveconversation.ts +0 -197
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +8 -8
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievememory.ts +9 -14
- package/packages/orq-rc/src/models/operations/retrievememorydocument.ts +6 -6
- package/packages/orq-rc/src/models/operations/retrievetool.ts +12 -12
- package/packages/orq-rc/src/models/operations/runagent.ts +130 -7
- package/packages/orq-rc/src/models/operations/streamagent.ts +120 -5
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +122 -7
- package/packages/orq-rc/src/models/operations/updateagent.ts +20 -0
- package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateconversation.ts +39 -33
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +8 -8
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateeval.ts +28 -28
- package/packages/orq-rc/src/models/operations/updatememory.ts +9 -32
- package/packages/orq-rc/src/models/operations/updatememorydocument.ts +6 -6
- package/packages/orq-rc/src/models/operations/updatetool.ts +14 -14
- package/packages/orq-rc/src/sdk/conversations.ts +23 -1
- package/packages/orq-rc/src/sdk/evaluators.ts +0 -18
- package/packages/orq-rc/src/sdk/internal.ts +28 -0
- package/packages/orq-rc/src/sdk/sdk.ts +6 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/conversationresponse.ts +2 -2
- package/src/models/components/partdoneevent.ts +2 -2
- package/src/models/components/reasoningpart.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createconversation.ts +2 -2
- 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/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 +2 -2
- package/src/models/operations/getalltools.ts +12 -12
- package/src/models/operations/getevals.ts +28 -28
- 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/retrievecontact.ts +2 -2
- package/src/models/operations/retrieveconversation.ts +2 -2
- 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 +2 -2
- package/src/models/operations/streamrunagent.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updateconversation.ts +2 -2
- 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/packages/orq-rc/src/mcp-server/tools/evaluatorsGetV2EvaluatorsIdVersionsVersionId.ts +0 -40
- package/packages/orq-rc/src/models/errors/createagentrequest.ts +0 -67
- package/packages/orq-rc/src/models/errors/getv2evaluatorsidversionsversionid.ts +0 -69
- package/packages/orq-rc/src/models/operations/getv2evaluatorsidversionsversionid.ts +0 -193
|
@@ -0,0 +1,226 @@
|
|
|
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
|
+
MessageResponse,
|
|
13
|
+
MessageResponse$inboundSchema,
|
|
14
|
+
MessageResponse$Outbound,
|
|
15
|
+
MessageResponse$outboundSchema,
|
|
16
|
+
} from "./messageresponse.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Resource type discriminator.
|
|
20
|
+
*/
|
|
21
|
+
export const ConversationWithMessagesResponseKind = {
|
|
22
|
+
Conversation: "conversation",
|
|
23
|
+
} as const;
|
|
24
|
+
/**
|
|
25
|
+
* Resource type discriminator.
|
|
26
|
+
*/
|
|
27
|
+
export type ConversationWithMessagesResponseKind = ClosedEnum<
|
|
28
|
+
typeof ConversationWithMessagesResponseKind
|
|
29
|
+
>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Additional conversation metadata.
|
|
33
|
+
*/
|
|
34
|
+
export type ConversationWithMessagesResponseMetadata = {
|
|
35
|
+
/**
|
|
36
|
+
* When `true`, indicates the conversation title is being auto-generated.
|
|
37
|
+
*/
|
|
38
|
+
generatingTitle?: boolean | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Parent entity identifier (e.g., agent or deployment). Set to `null` for standalone conversations.
|
|
41
|
+
*/
|
|
42
|
+
entityId?: string | null | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Model identifier for standalone conversations in `provider/model_id` format. Set to `null` for entity-bound conversations.
|
|
45
|
+
*/
|
|
46
|
+
model?: string | null | undefined;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type ConversationWithMessagesResponse = {
|
|
50
|
+
/**
|
|
51
|
+
* Unique conversation identifier with `conv_` prefix.
|
|
52
|
+
*/
|
|
53
|
+
id?: string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Resource type discriminator.
|
|
56
|
+
*/
|
|
57
|
+
kind: ConversationWithMessagesResponseKind;
|
|
58
|
+
/**
|
|
59
|
+
* Human-readable name for the conversation. Maximum 100 characters.
|
|
60
|
+
*/
|
|
61
|
+
displayName: string;
|
|
62
|
+
/**
|
|
63
|
+
* Unix timestamp in milliseconds when the conversation was created.
|
|
64
|
+
*/
|
|
65
|
+
createdAt: number;
|
|
66
|
+
/**
|
|
67
|
+
* Unix timestamp in milliseconds when the conversation was last modified.
|
|
68
|
+
*/
|
|
69
|
+
updatedAt: number;
|
|
70
|
+
/**
|
|
71
|
+
* Identifier of the user or system that created the conversation.
|
|
72
|
+
*/
|
|
73
|
+
createdById?: string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Identifier of the user or system that last modified the conversation.
|
|
76
|
+
*/
|
|
77
|
+
updatedById?: string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Additional conversation metadata.
|
|
80
|
+
*/
|
|
81
|
+
metadata?: ConversationWithMessagesResponseMetadata | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Conversation messages ordered chronologically (oldest first).
|
|
84
|
+
*/
|
|
85
|
+
messages: Array<MessageResponse>;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export const ConversationWithMessagesResponseKind$inboundSchema:
|
|
90
|
+
z.ZodNativeEnum<typeof ConversationWithMessagesResponseKind> = z.nativeEnum(
|
|
91
|
+
ConversationWithMessagesResponseKind,
|
|
92
|
+
);
|
|
93
|
+
/** @internal */
|
|
94
|
+
export const ConversationWithMessagesResponseKind$outboundSchema:
|
|
95
|
+
z.ZodNativeEnum<typeof ConversationWithMessagesResponseKind> =
|
|
96
|
+
ConversationWithMessagesResponseKind$inboundSchema;
|
|
97
|
+
|
|
98
|
+
/** @internal */
|
|
99
|
+
export const ConversationWithMessagesResponseMetadata$inboundSchema: z.ZodType<
|
|
100
|
+
ConversationWithMessagesResponseMetadata,
|
|
101
|
+
z.ZodTypeDef,
|
|
102
|
+
unknown
|
|
103
|
+
> = z.object({
|
|
104
|
+
generatingTitle: z.boolean().optional(),
|
|
105
|
+
entityId: z.nullable(z.string()).optional(),
|
|
106
|
+
model: z.nullable(z.string()).optional(),
|
|
107
|
+
});
|
|
108
|
+
/** @internal */
|
|
109
|
+
export type ConversationWithMessagesResponseMetadata$Outbound = {
|
|
110
|
+
generatingTitle?: boolean | undefined;
|
|
111
|
+
entityId?: string | null | undefined;
|
|
112
|
+
model?: string | null | undefined;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/** @internal */
|
|
116
|
+
export const ConversationWithMessagesResponseMetadata$outboundSchema: z.ZodType<
|
|
117
|
+
ConversationWithMessagesResponseMetadata$Outbound,
|
|
118
|
+
z.ZodTypeDef,
|
|
119
|
+
ConversationWithMessagesResponseMetadata
|
|
120
|
+
> = z.object({
|
|
121
|
+
generatingTitle: z.boolean().optional(),
|
|
122
|
+
entityId: z.nullable(z.string()).optional(),
|
|
123
|
+
model: z.nullable(z.string()).optional(),
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
export function conversationWithMessagesResponseMetadataToJSON(
|
|
127
|
+
conversationWithMessagesResponseMetadata:
|
|
128
|
+
ConversationWithMessagesResponseMetadata,
|
|
129
|
+
): string {
|
|
130
|
+
return JSON.stringify(
|
|
131
|
+
ConversationWithMessagesResponseMetadata$outboundSchema.parse(
|
|
132
|
+
conversationWithMessagesResponseMetadata,
|
|
133
|
+
),
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
export function conversationWithMessagesResponseMetadataFromJSON(
|
|
137
|
+
jsonString: string,
|
|
138
|
+
): SafeParseResult<
|
|
139
|
+
ConversationWithMessagesResponseMetadata,
|
|
140
|
+
SDKValidationError
|
|
141
|
+
> {
|
|
142
|
+
return safeParse(
|
|
143
|
+
jsonString,
|
|
144
|
+
(x) =>
|
|
145
|
+
ConversationWithMessagesResponseMetadata$inboundSchema.parse(
|
|
146
|
+
JSON.parse(x),
|
|
147
|
+
),
|
|
148
|
+
`Failed to parse 'ConversationWithMessagesResponseMetadata' from JSON`,
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** @internal */
|
|
153
|
+
export const ConversationWithMessagesResponse$inboundSchema: z.ZodType<
|
|
154
|
+
ConversationWithMessagesResponse,
|
|
155
|
+
z.ZodTypeDef,
|
|
156
|
+
unknown
|
|
157
|
+
> = z.object({
|
|
158
|
+
_id: z.string().default("conv_01keveeqcgvz7j1vpgpv7pye1v"),
|
|
159
|
+
kind: ConversationWithMessagesResponseKind$inboundSchema,
|
|
160
|
+
displayName: z.string(),
|
|
161
|
+
createdAt: z.number(),
|
|
162
|
+
updatedAt: z.number(),
|
|
163
|
+
createdById: z.string().optional(),
|
|
164
|
+
updatedById: z.string().optional(),
|
|
165
|
+
metadata: z.lazy(() => ConversationWithMessagesResponseMetadata$inboundSchema)
|
|
166
|
+
.optional(),
|
|
167
|
+
messages: z.array(MessageResponse$inboundSchema),
|
|
168
|
+
}).transform((v) => {
|
|
169
|
+
return remap$(v, {
|
|
170
|
+
"_id": "id",
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
/** @internal */
|
|
174
|
+
export type ConversationWithMessagesResponse$Outbound = {
|
|
175
|
+
_id: string;
|
|
176
|
+
kind: string;
|
|
177
|
+
displayName: string;
|
|
178
|
+
createdAt: number;
|
|
179
|
+
updatedAt: number;
|
|
180
|
+
createdById?: string | undefined;
|
|
181
|
+
updatedById?: string | undefined;
|
|
182
|
+
metadata?: ConversationWithMessagesResponseMetadata$Outbound | undefined;
|
|
183
|
+
messages: Array<MessageResponse$Outbound>;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
/** @internal */
|
|
187
|
+
export const ConversationWithMessagesResponse$outboundSchema: z.ZodType<
|
|
188
|
+
ConversationWithMessagesResponse$Outbound,
|
|
189
|
+
z.ZodTypeDef,
|
|
190
|
+
ConversationWithMessagesResponse
|
|
191
|
+
> = z.object({
|
|
192
|
+
id: z.string().default("conv_01keveeqcgvz7j1vpgpv7pye1v"),
|
|
193
|
+
kind: ConversationWithMessagesResponseKind$outboundSchema,
|
|
194
|
+
displayName: z.string(),
|
|
195
|
+
createdAt: z.number(),
|
|
196
|
+
updatedAt: z.number(),
|
|
197
|
+
createdById: z.string().optional(),
|
|
198
|
+
updatedById: z.string().optional(),
|
|
199
|
+
metadata: z.lazy(() =>
|
|
200
|
+
ConversationWithMessagesResponseMetadata$outboundSchema
|
|
201
|
+
).optional(),
|
|
202
|
+
messages: z.array(MessageResponse$outboundSchema),
|
|
203
|
+
}).transform((v) => {
|
|
204
|
+
return remap$(v, {
|
|
205
|
+
id: "_id",
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
export function conversationWithMessagesResponseToJSON(
|
|
210
|
+
conversationWithMessagesResponse: ConversationWithMessagesResponse,
|
|
211
|
+
): string {
|
|
212
|
+
return JSON.stringify(
|
|
213
|
+
ConversationWithMessagesResponse$outboundSchema.parse(
|
|
214
|
+
conversationWithMessagesResponse,
|
|
215
|
+
),
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
export function conversationWithMessagesResponseFromJSON(
|
|
219
|
+
jsonString: string,
|
|
220
|
+
): SafeParseResult<ConversationWithMessagesResponse, SDKValidationError> {
|
|
221
|
+
return safeParse(
|
|
222
|
+
jsonString,
|
|
223
|
+
(x) => ConversationWithMessagesResponse$inboundSchema.parse(JSON.parse(x)),
|
|
224
|
+
`Failed to parse 'ConversationWithMessagesResponse' from JSON`,
|
|
225
|
+
);
|
|
226
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Error content part. Generated by the system when an error occurs during agent execution.
|
|
12
|
+
*/
|
|
13
|
+
export type ErrorPart = {
|
|
14
|
+
kind: "error";
|
|
15
|
+
error: string;
|
|
16
|
+
code?: number | undefined;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const ErrorPart$inboundSchema: z.ZodType<
|
|
21
|
+
ErrorPart,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
unknown
|
|
24
|
+
> = z.object({
|
|
25
|
+
kind: z.literal("error"),
|
|
26
|
+
error: z.string(),
|
|
27
|
+
code: z.number().optional(),
|
|
28
|
+
});
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type ErrorPart$Outbound = {
|
|
31
|
+
kind: "error";
|
|
32
|
+
error: string;
|
|
33
|
+
code?: number | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const ErrorPart$outboundSchema: z.ZodType<
|
|
38
|
+
ErrorPart$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
ErrorPart
|
|
41
|
+
> = z.object({
|
|
42
|
+
kind: z.literal("error"),
|
|
43
|
+
error: z.string(),
|
|
44
|
+
code: z.number().optional(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export function errorPartToJSON(errorPart: ErrorPart): string {
|
|
48
|
+
return JSON.stringify(ErrorPart$outboundSchema.parse(errorPart));
|
|
49
|
+
}
|
|
50
|
+
export function errorPartFromJSON(
|
|
51
|
+
jsonString: string,
|
|
52
|
+
): SafeParseResult<ErrorPart, SDKValidationError> {
|
|
53
|
+
return safeParse(
|
|
54
|
+
jsonString,
|
|
55
|
+
(x) => ErrorPart$inboundSchema.parse(JSON.parse(x)),
|
|
56
|
+
`Failed to parse 'ErrorPart' from JSON`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -14,8 +14,10 @@ export * from "./agentstartedstreamingevent.js";
|
|
|
14
14
|
export * from "./agentthoughtstreamingevent.js";
|
|
15
15
|
export * from "./audiocontentpartschema.js";
|
|
16
16
|
export * from "./conversationresponse.js";
|
|
17
|
+
export * from "./conversationwithmessagesresponse.js";
|
|
17
18
|
export * from "./createagentresponse.js";
|
|
18
19
|
export * from "./datapart.js";
|
|
20
|
+
export * from "./errorpart.js";
|
|
19
21
|
export * from "./errorstreamingevent.js";
|
|
20
22
|
export * from "./executionnamedstreamingevent.js";
|
|
21
23
|
export * from "./executionreviewedstreamingevent.js";
|
|
@@ -24,6 +26,7 @@ export * from "./filecontentpartschema.js";
|
|
|
24
26
|
export * from "./filepart.js";
|
|
25
27
|
export * from "./imagecontentpartschema.js";
|
|
26
28
|
export * from "./invokedeploymentrequest.js";
|
|
29
|
+
export * from "./messageresponse.js";
|
|
27
30
|
export * from "./partdelta.js";
|
|
28
31
|
export * from "./partdeltaevent.js";
|
|
29
32
|
export * from "./partdoneevent.js";
|
|
@@ -53,3 +56,4 @@ export * from "./toolresultpart.js";
|
|
|
53
56
|
export * from "./toolreviewdoneevent.js";
|
|
54
57
|
export * from "./toolreviewrequestedevent.js";
|
|
55
58
|
export * from "./toolstartedevent.js";
|
|
59
|
+
export * from "./usermessagerequest.js";
|
|
@@ -0,0 +1,217 @@
|
|
|
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
|
+
ErrorPart,
|
|
13
|
+
ErrorPart$inboundSchema,
|
|
14
|
+
ErrorPart$Outbound,
|
|
15
|
+
ErrorPart$outboundSchema,
|
|
16
|
+
} from "./errorpart.js";
|
|
17
|
+
import {
|
|
18
|
+
FilePart,
|
|
19
|
+
FilePart$inboundSchema,
|
|
20
|
+
FilePart$Outbound,
|
|
21
|
+
FilePart$outboundSchema,
|
|
22
|
+
} from "./filepart.js";
|
|
23
|
+
import {
|
|
24
|
+
TextPart,
|
|
25
|
+
TextPart$inboundSchema,
|
|
26
|
+
TextPart$Outbound,
|
|
27
|
+
TextPart$outboundSchema,
|
|
28
|
+
} from "./textpart.js";
|
|
29
|
+
import {
|
|
30
|
+
ToolResultPart,
|
|
31
|
+
ToolResultPart$inboundSchema,
|
|
32
|
+
ToolResultPart$Outbound,
|
|
33
|
+
ToolResultPart$outboundSchema,
|
|
34
|
+
} from "./toolresultpart.js";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Message part that can be provided by users. Use "text" for regular messages, "file" for attachments, or "tool_result" when responding to tool call requests.
|
|
38
|
+
*/
|
|
39
|
+
export type PublicMessagePart =
|
|
40
|
+
| TextPart
|
|
41
|
+
| FilePart
|
|
42
|
+
| ToolResultPart
|
|
43
|
+
| ErrorPart;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Message author role. `user` for end-user messages, `assistant` for AI-generated responses.
|
|
47
|
+
*/
|
|
48
|
+
export const MessageResponseRole = {
|
|
49
|
+
User: "user",
|
|
50
|
+
Assistant: "assistant",
|
|
51
|
+
} as const;
|
|
52
|
+
/**
|
|
53
|
+
* Message author role. `user` for end-user messages, `assistant` for AI-generated responses.
|
|
54
|
+
*/
|
|
55
|
+
export type MessageResponseRole = ClosedEnum<typeof MessageResponseRole>;
|
|
56
|
+
|
|
57
|
+
export type MessageResponse = {
|
|
58
|
+
/**
|
|
59
|
+
* Unique message identifier with `msg_` prefix.
|
|
60
|
+
*/
|
|
61
|
+
id: string;
|
|
62
|
+
/**
|
|
63
|
+
* Conversation identifier this message belongs to.
|
|
64
|
+
*/
|
|
65
|
+
conversationId: string;
|
|
66
|
+
/**
|
|
67
|
+
* Unix timestamp in milliseconds when the message was created.
|
|
68
|
+
*/
|
|
69
|
+
createdAt: number;
|
|
70
|
+
/**
|
|
71
|
+
* Identifier of the message author. User ID for user messages, "system" for assistant messages.
|
|
72
|
+
*/
|
|
73
|
+
createdById: string;
|
|
74
|
+
/**
|
|
75
|
+
* Content parts composing the message. Supports multiple content types (text, images, files, tool results).
|
|
76
|
+
*/
|
|
77
|
+
parts: Array<TextPart | FilePart | ToolResultPart | ErrorPart>;
|
|
78
|
+
/**
|
|
79
|
+
* Message author role. `user` for end-user messages, `assistant` for AI-generated responses.
|
|
80
|
+
*/
|
|
81
|
+
role: MessageResponseRole;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const PublicMessagePart$inboundSchema: z.ZodType<
|
|
86
|
+
PublicMessagePart,
|
|
87
|
+
z.ZodTypeDef,
|
|
88
|
+
unknown
|
|
89
|
+
> = z.union([
|
|
90
|
+
TextPart$inboundSchema,
|
|
91
|
+
FilePart$inboundSchema,
|
|
92
|
+
ToolResultPart$inboundSchema,
|
|
93
|
+
ErrorPart$inboundSchema,
|
|
94
|
+
]);
|
|
95
|
+
/** @internal */
|
|
96
|
+
export type PublicMessagePart$Outbound =
|
|
97
|
+
| TextPart$Outbound
|
|
98
|
+
| FilePart$Outbound
|
|
99
|
+
| ToolResultPart$Outbound
|
|
100
|
+
| ErrorPart$Outbound;
|
|
101
|
+
|
|
102
|
+
/** @internal */
|
|
103
|
+
export const PublicMessagePart$outboundSchema: z.ZodType<
|
|
104
|
+
PublicMessagePart$Outbound,
|
|
105
|
+
z.ZodTypeDef,
|
|
106
|
+
PublicMessagePart
|
|
107
|
+
> = z.union([
|
|
108
|
+
TextPart$outboundSchema,
|
|
109
|
+
FilePart$outboundSchema,
|
|
110
|
+
ToolResultPart$outboundSchema,
|
|
111
|
+
ErrorPart$outboundSchema,
|
|
112
|
+
]);
|
|
113
|
+
|
|
114
|
+
export function publicMessagePartToJSON(
|
|
115
|
+
publicMessagePart: PublicMessagePart,
|
|
116
|
+
): string {
|
|
117
|
+
return JSON.stringify(
|
|
118
|
+
PublicMessagePart$outboundSchema.parse(publicMessagePart),
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
export function publicMessagePartFromJSON(
|
|
122
|
+
jsonString: string,
|
|
123
|
+
): SafeParseResult<PublicMessagePart, SDKValidationError> {
|
|
124
|
+
return safeParse(
|
|
125
|
+
jsonString,
|
|
126
|
+
(x) => PublicMessagePart$inboundSchema.parse(JSON.parse(x)),
|
|
127
|
+
`Failed to parse 'PublicMessagePart' from JSON`,
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** @internal */
|
|
132
|
+
export const MessageResponseRole$inboundSchema: z.ZodNativeEnum<
|
|
133
|
+
typeof MessageResponseRole
|
|
134
|
+
> = z.nativeEnum(MessageResponseRole);
|
|
135
|
+
/** @internal */
|
|
136
|
+
export const MessageResponseRole$outboundSchema: z.ZodNativeEnum<
|
|
137
|
+
typeof MessageResponseRole
|
|
138
|
+
> = MessageResponseRole$inboundSchema;
|
|
139
|
+
|
|
140
|
+
/** @internal */
|
|
141
|
+
export const MessageResponse$inboundSchema: z.ZodType<
|
|
142
|
+
MessageResponse,
|
|
143
|
+
z.ZodTypeDef,
|
|
144
|
+
unknown
|
|
145
|
+
> = z.object({
|
|
146
|
+
_id: z.string(),
|
|
147
|
+
conversationId: z.string(),
|
|
148
|
+
createdAt: z.number(),
|
|
149
|
+
createdById: z.string(),
|
|
150
|
+
parts: z.array(
|
|
151
|
+
z.union([
|
|
152
|
+
TextPart$inboundSchema,
|
|
153
|
+
FilePart$inboundSchema,
|
|
154
|
+
ToolResultPart$inboundSchema,
|
|
155
|
+
ErrorPart$inboundSchema,
|
|
156
|
+
]),
|
|
157
|
+
),
|
|
158
|
+
role: MessageResponseRole$inboundSchema,
|
|
159
|
+
}).transform((v) => {
|
|
160
|
+
return remap$(v, {
|
|
161
|
+
"_id": "id",
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
/** @internal */
|
|
165
|
+
export type MessageResponse$Outbound = {
|
|
166
|
+
_id: string;
|
|
167
|
+
conversationId: string;
|
|
168
|
+
createdAt: number;
|
|
169
|
+
createdById: string;
|
|
170
|
+
parts: Array<
|
|
171
|
+
| TextPart$Outbound
|
|
172
|
+
| FilePart$Outbound
|
|
173
|
+
| ToolResultPart$Outbound
|
|
174
|
+
| ErrorPart$Outbound
|
|
175
|
+
>;
|
|
176
|
+
role: string;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/** @internal */
|
|
180
|
+
export const MessageResponse$outboundSchema: z.ZodType<
|
|
181
|
+
MessageResponse$Outbound,
|
|
182
|
+
z.ZodTypeDef,
|
|
183
|
+
MessageResponse
|
|
184
|
+
> = z.object({
|
|
185
|
+
id: z.string(),
|
|
186
|
+
conversationId: z.string(),
|
|
187
|
+
createdAt: z.number(),
|
|
188
|
+
createdById: z.string(),
|
|
189
|
+
parts: z.array(
|
|
190
|
+
z.union([
|
|
191
|
+
TextPart$outboundSchema,
|
|
192
|
+
FilePart$outboundSchema,
|
|
193
|
+
ToolResultPart$outboundSchema,
|
|
194
|
+
ErrorPart$outboundSchema,
|
|
195
|
+
]),
|
|
196
|
+
),
|
|
197
|
+
role: MessageResponseRole$outboundSchema,
|
|
198
|
+
}).transform((v) => {
|
|
199
|
+
return remap$(v, {
|
|
200
|
+
id: "_id",
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
export function messageResponseToJSON(
|
|
205
|
+
messageResponse: MessageResponse,
|
|
206
|
+
): string {
|
|
207
|
+
return JSON.stringify(MessageResponse$outboundSchema.parse(messageResponse));
|
|
208
|
+
}
|
|
209
|
+
export function messageResponseFromJSON(
|
|
210
|
+
jsonString: string,
|
|
211
|
+
): SafeParseResult<MessageResponse, SDKValidationError> {
|
|
212
|
+
return safeParse(
|
|
213
|
+
jsonString,
|
|
214
|
+
(x) => MessageResponse$inboundSchema.parse(JSON.parse(x)),
|
|
215
|
+
`Failed to parse 'MessageResponse' from JSON`,
|
|
216
|
+
);
|
|
217
|
+
}
|
|
@@ -79,7 +79,7 @@ export const PartReasoningPart$inboundSchema: z.ZodType<
|
|
|
79
79
|
z.ZodTypeDef,
|
|
80
80
|
unknown
|
|
81
81
|
> = z.object({
|
|
82
|
-
_id: z.string().default("
|
|
82
|
+
_id: z.string().default("reasoning_01keveeq318s7h31wa3yyasv1h"),
|
|
83
83
|
metadata: z.record(z.any()).optional(),
|
|
84
84
|
kind: PartKind$inboundSchema,
|
|
85
85
|
reasoning: z.string(),
|
|
@@ -104,7 +104,7 @@ export const PartReasoningPart$outboundSchema: z.ZodType<
|
|
|
104
104
|
z.ZodTypeDef,
|
|
105
105
|
PartReasoningPart
|
|
106
106
|
> = z.object({
|
|
107
|
-
id: z.string().default("
|
|
107
|
+
id: z.string().default("reasoning_01keveeq318s7h31wa3yyasv1h"),
|
|
108
108
|
metadata: z.record(z.any()).optional(),
|
|
109
109
|
kind: PartKind$outboundSchema,
|
|
110
110
|
reasoning: z.string(),
|
|
@@ -9,7 +9,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Information about the
|
|
12
|
+
* Information about the identity making the request. If the identity does not exist, it will be created automatically.
|
|
13
13
|
*/
|
|
14
14
|
export type PublicContact = {
|
|
15
15
|
/**
|
|
@@ -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_01keveeq2tekm1n6201amswnne"),
|
|
44
44
|
metadata: z.record(z.any()).optional(),
|
|
45
45
|
kind: z.literal("reasoning"),
|
|
46
46
|
reasoning: z.string(),
|
|
@@ -65,7 +65,7 @@ export const ReasoningPart$outboundSchema: z.ZodType<
|
|
|
65
65
|
z.ZodTypeDef,
|
|
66
66
|
ReasoningPart
|
|
67
67
|
> = z.object({
|
|
68
|
-
id: z.string().default("
|
|
68
|
+
id: z.string().default("reasoning_01keveeq2tekm1n6201amswnne"),
|
|
69
69
|
metadata: z.record(z.any()).optional(),
|
|
70
70
|
kind: z.literal("reasoning"),
|
|
71
71
|
reasoning: z.string(),
|
|
@@ -26,6 +26,14 @@ export type Data = {
|
|
|
26
26
|
* Trace ID for this turn of the conversation (new for each continuation)
|
|
27
27
|
*/
|
|
28
28
|
workflowRunId: string;
|
|
29
|
+
/**
|
|
30
|
+
* Server-generated ID for the user message. Use this ID for frontend state consistency.
|
|
31
|
+
*/
|
|
32
|
+
userMessageId?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Server-generated ID for the assistant message. Use this ID for frontend state consistency.
|
|
35
|
+
*/
|
|
36
|
+
assistantMessageId?: string | undefined;
|
|
29
37
|
};
|
|
30
38
|
|
|
31
39
|
/**
|
|
@@ -47,6 +55,8 @@ export const Data$inboundSchema: z.ZodType<Data, z.ZodTypeDef, unknown> = z
|
|
|
47
55
|
taskId: z.string(),
|
|
48
56
|
model: z.string(),
|
|
49
57
|
workflowRunId: z.string(),
|
|
58
|
+
userMessageId: z.string().optional(),
|
|
59
|
+
assistantMessageId: z.string().optional(),
|
|
50
60
|
});
|
|
51
61
|
/** @internal */
|
|
52
62
|
export type Data$Outbound = {
|
|
@@ -54,6 +64,8 @@ export type Data$Outbound = {
|
|
|
54
64
|
taskId: string;
|
|
55
65
|
model: string;
|
|
56
66
|
workflowRunId: string;
|
|
67
|
+
userMessageId?: string | undefined;
|
|
68
|
+
assistantMessageId?: string | undefined;
|
|
57
69
|
};
|
|
58
70
|
|
|
59
71
|
/** @internal */
|
|
@@ -63,6 +75,8 @@ export const Data$outboundSchema: z.ZodType<Data$Outbound, z.ZodTypeDef, Data> =
|
|
|
63
75
|
taskId: z.string(),
|
|
64
76
|
model: z.string(),
|
|
65
77
|
workflowRunId: z.string(),
|
|
78
|
+
userMessageId: z.string().optional(),
|
|
79
|
+
assistantMessageId: z.string().optional(),
|
|
66
80
|
});
|
|
67
81
|
|
|
68
82
|
export function dataToJSON(data: Data): string {
|