@magemetrics/core 0.5.1 → 0.5.3
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/dist/index.d.ts +61 -0
- package/dist/index.js +12 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -212,6 +212,13 @@ declare interface components {
|
|
|
212
212
|
sampledCount: number;
|
|
213
213
|
};
|
|
214
214
|
};
|
|
215
|
+
/** @description Prompt starter template */
|
|
216
|
+
PromptStarter: {
|
|
217
|
+
id: number;
|
|
218
|
+
title: string;
|
|
219
|
+
template: string;
|
|
220
|
+
is_default: boolean;
|
|
221
|
+
};
|
|
215
222
|
/** @description Starter recommendations */
|
|
216
223
|
StarterRecommendation: {
|
|
217
224
|
starter: string;
|
|
@@ -1898,6 +1905,43 @@ declare interface operations {
|
|
|
1898
1905
|
};
|
|
1899
1906
|
};
|
|
1900
1907
|
};
|
|
1908
|
+
getPromptStarters: {
|
|
1909
|
+
parameters: {
|
|
1910
|
+
query?: {
|
|
1911
|
+
input?: string;
|
|
1912
|
+
};
|
|
1913
|
+
header: {
|
|
1914
|
+
"sp-access-token": string;
|
|
1915
|
+
};
|
|
1916
|
+
path?: never;
|
|
1917
|
+
cookie?: never;
|
|
1918
|
+
};
|
|
1919
|
+
requestBody?: never;
|
|
1920
|
+
responses: {
|
|
1921
|
+
/** @description List available prompt starters */
|
|
1922
|
+
200: {
|
|
1923
|
+
headers: {
|
|
1924
|
+
[name: string]: unknown;
|
|
1925
|
+
};
|
|
1926
|
+
content: {
|
|
1927
|
+
"application/json": {
|
|
1928
|
+
starters: components["schemas"]["PromptStarter"][];
|
|
1929
|
+
};
|
|
1930
|
+
};
|
|
1931
|
+
};
|
|
1932
|
+
/** @description Something wrong happened */
|
|
1933
|
+
500: {
|
|
1934
|
+
headers: {
|
|
1935
|
+
[name: string]: unknown;
|
|
1936
|
+
};
|
|
1937
|
+
content: {
|
|
1938
|
+
"application/json": {
|
|
1939
|
+
error: string;
|
|
1940
|
+
};
|
|
1941
|
+
};
|
|
1942
|
+
};
|
|
1943
|
+
};
|
|
1944
|
+
};
|
|
1901
1945
|
retrieveChatMessages: {
|
|
1902
1946
|
parameters: {
|
|
1903
1947
|
query?: never;
|
|
@@ -2214,6 +2258,7 @@ declare interface operations {
|
|
|
2214
2258
|
variables: {
|
|
2215
2259
|
[key: string]: string;
|
|
2216
2260
|
};
|
|
2261
|
+
applicationName?: string;
|
|
2217
2262
|
};
|
|
2218
2263
|
};
|
|
2219
2264
|
};
|
|
@@ -3561,6 +3606,22 @@ declare interface paths {
|
|
|
3561
3606
|
patch?: never;
|
|
3562
3607
|
trace?: never;
|
|
3563
3608
|
};
|
|
3609
|
+
"/api/v1/prompt-starters": {
|
|
3610
|
+
parameters: {
|
|
3611
|
+
query?: never;
|
|
3612
|
+
header?: never;
|
|
3613
|
+
path?: never;
|
|
3614
|
+
cookie?: never;
|
|
3615
|
+
};
|
|
3616
|
+
get: operations["getPromptStarters"];
|
|
3617
|
+
put?: never;
|
|
3618
|
+
post?: never;
|
|
3619
|
+
delete?: never;
|
|
3620
|
+
options?: never;
|
|
3621
|
+
head?: never;
|
|
3622
|
+
patch?: never;
|
|
3623
|
+
trace?: never;
|
|
3624
|
+
};
|
|
3564
3625
|
"/api/v1/chat/{flowId}/messages": {
|
|
3565
3626
|
parameters: {
|
|
3566
3627
|
query?: never;
|
package/dist/index.js
CHANGED
|
@@ -2362,53 +2362,20 @@ var CreateSpeechToken = createRoute({
|
|
|
2362
2362
|
}
|
|
2363
2363
|
}
|
|
2364
2364
|
});
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
status: z.literal("error"),
|
|
2370
|
-
error: z.string()
|
|
2365
|
+
var End2EndApiResponseSchema = z5.discriminatedUnion("status", [
|
|
2366
|
+
z5.object({
|
|
2367
|
+
status: z5.literal("error"),
|
|
2368
|
+
error: z5.string()
|
|
2371
2369
|
}),
|
|
2372
|
-
|
|
2373
|
-
status:
|
|
2374
|
-
flowId:
|
|
2370
|
+
z5.object({
|
|
2371
|
+
status: z5.literal("success"),
|
|
2372
|
+
flowId: z5.string()
|
|
2375
2373
|
})
|
|
2376
2374
|
]);
|
|
2377
|
-
createRoute({
|
|
2378
|
-
method: "post",
|
|
2379
|
-
path: "/api/v1/end2end",
|
|
2380
|
-
operationId: "runEnd2EndFlow",
|
|
2381
|
-
request: {
|
|
2382
|
-
headers: SupabaseHeaderSchema,
|
|
2383
|
-
body: {
|
|
2384
|
-
required: true,
|
|
2385
|
-
content: {
|
|
2386
|
-
"application/json": {
|
|
2387
|
-
schema: z.object({
|
|
2388
|
-
userQuery: z.string(),
|
|
2389
|
-
isNewAnalysisGoal: z.boolean().default(true),
|
|
2390
|
-
difficultyLevel: z.enum(["simple", "moderate", "complex"]).default("complex")
|
|
2391
|
-
})
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
|
-
}
|
|
2395
|
-
},
|
|
2396
|
-
responses: {
|
|
2397
|
-
200: {
|
|
2398
|
-
description: "Run the end2end flow",
|
|
2399
|
-
content: {
|
|
2400
|
-
"application/json": {
|
|
2401
|
-
schema: End2EndApiResponseSchema
|
|
2402
|
-
}
|
|
2403
|
-
}
|
|
2404
|
-
}
|
|
2405
|
-
}
|
|
2406
|
-
});
|
|
2407
|
-
|
|
2408
|
-
// ../shared/dist/src/endpoints/companion/triggers.routes.js
|
|
2409
2375
|
var TriggerFlowBody = z5.object({
|
|
2410
2376
|
triggerId: z5.string(),
|
|
2411
|
-
variables: z5.record(z5.string(), z5.string())
|
|
2377
|
+
variables: z5.record(z5.string(), z5.string()),
|
|
2378
|
+
applicationName: z5.string().optional()
|
|
2412
2379
|
});
|
|
2413
2380
|
var TriggerFlow = createRoute({
|
|
2414
2381
|
method: "post",
|
|
@@ -3150,7 +3117,7 @@ var toSearchParams = ({ cursor, filters, sorting, limit }) => {
|
|
|
3150
3117
|
|
|
3151
3118
|
// package.json
|
|
3152
3119
|
var package_default = {
|
|
3153
|
-
version: "0.5.
|
|
3120
|
+
version: "0.5.3"};
|
|
3154
3121
|
var MageMetricsChatTransport = class extends DefaultChatTransport {
|
|
3155
3122
|
constructor(apiUrl, flowId, options) {
|
|
3156
3123
|
super({
|
|
@@ -3433,7 +3400,8 @@ var MageMetricsClient = class {
|
|
|
3433
3400
|
{
|
|
3434
3401
|
body: {
|
|
3435
3402
|
triggerId,
|
|
3436
|
-
variables
|
|
3403
|
+
variables,
|
|
3404
|
+
applicationName: this.config.applicationName
|
|
3437
3405
|
}
|
|
3438
3406
|
}
|
|
3439
3407
|
);
|