@superinterface/server 1.5.1 → 1.7.0
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +2 -0
- package/.next/build-manifest.json +2 -2
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_btwyo7 +1 -1
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +17 -0
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/api/assistants/[assistantId]/tools/[toolId]/route/app-build-manifest.json +10 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/[toolId]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/[toolId]/route/build-manifest.json +16 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/[toolId]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/[toolId]/route.js +8 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/[toolId]/route.js.map +5 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/[toolId]/route.js.nft.json +1 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/[toolId]/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/route/app-build-manifest.json +10 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/route/build-manifest.json +16 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/route.js +8 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/route.js.map +5 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/route.js.nft.json +1 -0
- package/.next/server/app/api/assistants/[assistantId]/tools/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/files/[fileId]/contents/route.js +1 -1
- package/.next/server/app/api/files/[fileId]/contents/route.js.nft.json +1 -1
- package/.next/server/app/api/files/route.js +1 -1
- package/.next/server/app/api/files/route.js.nft.json +1 -1
- package/.next/server/app/api/messages/route.js +1 -1
- package/.next/server/app/api/messages/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/assistants/route.js +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/assistants/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/models/route.js +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/models/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/callback/route.js +1 -1
- package/.next/server/app/api/tasks/callback/route.js.nft.json +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/app-paths-manifest.json +2 -0
- package/.next/server/chunks/[root-of-the-server]__181844d8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__181844d8._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__37a3ac4f._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__37a3ac4f._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js.map +1 -1
- package/.next/server/chunks/{[root-of-the-server]__157cba54._.js → [root-of-the-server]__5715dd1a._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__157cba54._.js.map → [root-of-the-server]__5715dd1a._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__621f572e._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__621f572e._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__76635a77._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__76635a77._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__8b8c4831._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__8b8c4831._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__bcdbc64b._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__bcdbc64b._.js.map +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0dd082e7._.js → [root-of-the-server]__e45dec0a._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0dd082e7._.js.map → [root-of-the-server]__e45dec0a._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__b9d6eedd._.js → [root-of-the-server]__faa0774f._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__b9d6eedd._.js.map → [root-of-the-server]__faa0774f._.js.map} +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_828c7f3d.js +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_828c7f3d.js.map +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/trace +1 -1
- package/.next/types/routes.d.ts +3 -1
- package/.next/types/validator.ts +18 -0
- package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts +6 -0
- package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/buildRoute.js +8 -4
- package/dist/app/api/assistants/[assistantId]/route.d.ts +6 -0
- package/dist/app/api/assistants/[assistantId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/tools/[toolId]/buildRoute.d.ts +107 -0
- package/dist/app/api/assistants/[assistantId]/tools/[toolId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/tools/[toolId]/buildRoute.js +165 -0
- package/dist/app/api/assistants/[assistantId]/tools/[toolId]/route.d.ts +107 -0
- package/dist/app/api/assistants/[assistantId]/tools/[toolId]/route.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/tools/[toolId]/route.js +6 -0
- package/dist/app/api/assistants/[assistantId]/tools/buildRoute.d.ts +74 -0
- package/dist/app/api/assistants/[assistantId]/tools/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/tools/buildRoute.js +121 -0
- package/dist/app/api/assistants/[assistantId]/tools/route.d.ts +70 -0
- package/dist/app/api/assistants/[assistantId]/tools/route.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/tools/route.js +5 -0
- package/dist/app/api/assistants/buildRoute.d.ts +34 -16
- package/dist/app/api/assistants/buildRoute.d.ts.map +1 -1
- package/dist/app/api/assistants/buildRoute.js +8 -4
- package/dist/app/api/assistants/route.d.ts +4 -0
- package/dist/app/api/assistants/route.d.ts.map +1 -1
- package/dist/lib/assistants/serializeApiAssistant.d.ts +2 -0
- package/dist/lib/assistants/serializeApiAssistant.d.ts.map +1 -1
- package/dist/lib/assistants/serializeApiAssistant.js +2 -0
- package/dist/lib/tools/isToolConfigAvailable.d.ts +16 -0
- package/dist/lib/tools/isToolConfigAvailable.d.ts.map +1 -0
- package/dist/lib/tools/isToolConfigAvailable.js +111 -0
- package/dist/lib/tools/serializeApiTool.d.ts +39 -0
- package/dist/lib/tools/serializeApiTool.d.ts.map +1 -0
- package/dist/lib/tools/serializeApiTool.js +35 -0
- package/dist/lib/tools/toolSchema.d.ts +311 -0
- package/dist/lib/tools/toolSchema.d.ts.map +1 -0
- package/dist/lib/tools/toolSchema.js +74 -0
- package/package.json +16 -1
- package/.next/server/chunks/[root-of-the-server]__80c5437f._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__80c5437f._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__aa7dab38._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__aa7dab38._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__aacdf247._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__aacdf247._.js.map +0 -1
- /package/.next/static/{sAHFK0SESk212SK8DFgrB → RTUY1MMVeKHU4_TIxAC_f}/_buildManifest.js +0 -0
- /package/.next/static/{sAHFK0SESk212SK8DFgrB → RTUY1MMVeKHU4_TIxAC_f}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{sAHFK0SESk212SK8DFgrB → RTUY1MMVeKHU4_TIxAC_f}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export declare const GET: (_request: import("next/server").NextRequest, props: {
|
|
2
|
+
params: Promise<{
|
|
3
|
+
assistantId: string;
|
|
4
|
+
toolId: string;
|
|
5
|
+
}>;
|
|
6
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
7
|
+
error: string;
|
|
8
|
+
}> | import("next/server").NextResponse<{
|
|
9
|
+
tool: {
|
|
10
|
+
createdAt: string;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
computerUseTool?: {
|
|
13
|
+
displayWidth: number;
|
|
14
|
+
displayHeight: number;
|
|
15
|
+
environment: import("@prisma/client").$Enums.ComputerUseToolEnvironment;
|
|
16
|
+
mcpServerId: string | null;
|
|
17
|
+
} | undefined;
|
|
18
|
+
imageGenerationTool?: {
|
|
19
|
+
model: string;
|
|
20
|
+
quality: import("@prisma/client").$Enums.ImageGenerationToolQuality;
|
|
21
|
+
size: import("@prisma/client").$Enums.ImageGenerationToolSize;
|
|
22
|
+
outputFormat: import("@prisma/client").$Enums.ImageGenerationToolOutputFormat;
|
|
23
|
+
background: import("@prisma/client").$Enums.ImageGenerationToolBackground;
|
|
24
|
+
partialImages: number;
|
|
25
|
+
} | undefined;
|
|
26
|
+
codeInterpreterTool?: {} | undefined;
|
|
27
|
+
webSearchTool?: {} | undefined;
|
|
28
|
+
fileSearchTool?: {
|
|
29
|
+
vectorStoreIds: string[];
|
|
30
|
+
maxNumResults: number;
|
|
31
|
+
} | undefined;
|
|
32
|
+
id: string;
|
|
33
|
+
type: import("@prisma/client").$Enums.ToolType;
|
|
34
|
+
};
|
|
35
|
+
}>>;
|
|
36
|
+
export declare const PATCH: (request: import("next/server").NextRequest, props: {
|
|
37
|
+
params: Promise<{
|
|
38
|
+
assistantId: string;
|
|
39
|
+
toolId: string;
|
|
40
|
+
}>;
|
|
41
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
42
|
+
error: string;
|
|
43
|
+
}> | import("next/server").NextResponse<{
|
|
44
|
+
tool: {
|
|
45
|
+
createdAt: string;
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
computerUseTool?: {
|
|
48
|
+
displayWidth: number;
|
|
49
|
+
displayHeight: number;
|
|
50
|
+
environment: import("@prisma/client").$Enums.ComputerUseToolEnvironment;
|
|
51
|
+
mcpServerId: string | null;
|
|
52
|
+
} | undefined;
|
|
53
|
+
imageGenerationTool?: {
|
|
54
|
+
model: string;
|
|
55
|
+
quality: import("@prisma/client").$Enums.ImageGenerationToolQuality;
|
|
56
|
+
size: import("@prisma/client").$Enums.ImageGenerationToolSize;
|
|
57
|
+
outputFormat: import("@prisma/client").$Enums.ImageGenerationToolOutputFormat;
|
|
58
|
+
background: import("@prisma/client").$Enums.ImageGenerationToolBackground;
|
|
59
|
+
partialImages: number;
|
|
60
|
+
} | undefined;
|
|
61
|
+
codeInterpreterTool?: {} | undefined;
|
|
62
|
+
webSearchTool?: {} | undefined;
|
|
63
|
+
fileSearchTool?: {
|
|
64
|
+
vectorStoreIds: string[];
|
|
65
|
+
maxNumResults: number;
|
|
66
|
+
} | undefined;
|
|
67
|
+
id: string;
|
|
68
|
+
type: import("@prisma/client").$Enums.ToolType;
|
|
69
|
+
};
|
|
70
|
+
}>>;
|
|
71
|
+
export declare const DELETE: (_request: import("next/server").NextRequest, props: {
|
|
72
|
+
params: Promise<{
|
|
73
|
+
assistantId: string;
|
|
74
|
+
toolId: string;
|
|
75
|
+
}>;
|
|
76
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
77
|
+
error: string;
|
|
78
|
+
}> | import("next/server").NextResponse<{
|
|
79
|
+
tool: {
|
|
80
|
+
createdAt: string;
|
|
81
|
+
updatedAt: string;
|
|
82
|
+
computerUseTool?: {
|
|
83
|
+
displayWidth: number;
|
|
84
|
+
displayHeight: number;
|
|
85
|
+
environment: import("@prisma/client").$Enums.ComputerUseToolEnvironment;
|
|
86
|
+
mcpServerId: string | null;
|
|
87
|
+
} | undefined;
|
|
88
|
+
imageGenerationTool?: {
|
|
89
|
+
model: string;
|
|
90
|
+
quality: import("@prisma/client").$Enums.ImageGenerationToolQuality;
|
|
91
|
+
size: import("@prisma/client").$Enums.ImageGenerationToolSize;
|
|
92
|
+
outputFormat: import("@prisma/client").$Enums.ImageGenerationToolOutputFormat;
|
|
93
|
+
background: import("@prisma/client").$Enums.ImageGenerationToolBackground;
|
|
94
|
+
partialImages: number;
|
|
95
|
+
} | undefined;
|
|
96
|
+
codeInterpreterTool?: {} | undefined;
|
|
97
|
+
webSearchTool?: {} | undefined;
|
|
98
|
+
fileSearchTool?: {
|
|
99
|
+
vectorStoreIds: string[];
|
|
100
|
+
maxNumResults: number;
|
|
101
|
+
} | undefined;
|
|
102
|
+
id: string;
|
|
103
|
+
type: import("@prisma/client").$Enums.ToolType;
|
|
104
|
+
};
|
|
105
|
+
}>>;
|
|
106
|
+
export declare const OPTIONS: () => import("next/server").NextResponse<{}>;
|
|
107
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/app/api/assistants/[assistantId]/tools/[toolId]/route.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuB,CAAA;AAEvC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyB,CAAA;AAE3C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0B,CAAA;AAE7C,eAAO,MAAM,OAAO,8CAAiB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { prisma } from '../../../../../../lib/prisma';
|
|
2
|
+
import { buildDELETE, buildGET, buildOPTIONS, buildPATCH } from './buildRoute';
|
|
3
|
+
export const GET = buildGET({ prisma });
|
|
4
|
+
export const PATCH = buildPATCH({ prisma });
|
|
5
|
+
export const DELETE = buildDELETE({ prisma });
|
|
6
|
+
export const OPTIONS = buildOPTIONS();
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import { type PrismaClient } from '@prisma/client';
|
|
3
|
+
type RouteProps = {
|
|
4
|
+
params: Promise<{
|
|
5
|
+
assistantId: string;
|
|
6
|
+
}>;
|
|
7
|
+
};
|
|
8
|
+
export declare const buildGET: ({ prisma }: {
|
|
9
|
+
prisma: PrismaClient;
|
|
10
|
+
}) => (_request: NextRequest, props: RouteProps) => Promise<NextResponse<{
|
|
11
|
+
error: string;
|
|
12
|
+
}> | NextResponse<{
|
|
13
|
+
tools: {
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
computerUseTool?: {
|
|
17
|
+
displayWidth: number;
|
|
18
|
+
displayHeight: number;
|
|
19
|
+
environment: import("@prisma/client").$Enums.ComputerUseToolEnvironment;
|
|
20
|
+
mcpServerId: string | null;
|
|
21
|
+
} | undefined;
|
|
22
|
+
imageGenerationTool?: {
|
|
23
|
+
model: string;
|
|
24
|
+
quality: import("@prisma/client").$Enums.ImageGenerationToolQuality;
|
|
25
|
+
size: import("@prisma/client").$Enums.ImageGenerationToolSize;
|
|
26
|
+
outputFormat: import("@prisma/client").$Enums.ImageGenerationToolOutputFormat;
|
|
27
|
+
background: import("@prisma/client").$Enums.ImageGenerationToolBackground;
|
|
28
|
+
partialImages: number;
|
|
29
|
+
} | undefined;
|
|
30
|
+
codeInterpreterTool?: {} | undefined;
|
|
31
|
+
webSearchTool?: {} | undefined;
|
|
32
|
+
fileSearchTool?: {
|
|
33
|
+
vectorStoreIds: string[];
|
|
34
|
+
maxNumResults: number;
|
|
35
|
+
} | undefined;
|
|
36
|
+
id: string;
|
|
37
|
+
type: import("@prisma/client").$Enums.ToolType;
|
|
38
|
+
}[];
|
|
39
|
+
}>>;
|
|
40
|
+
export declare const buildPOST: ({ prisma }: {
|
|
41
|
+
prisma: PrismaClient;
|
|
42
|
+
}) => (request: NextRequest, props: RouteProps) => Promise<NextResponse<{
|
|
43
|
+
error: string;
|
|
44
|
+
}> | NextResponse<{
|
|
45
|
+
tool: {
|
|
46
|
+
createdAt: string;
|
|
47
|
+
updatedAt: string;
|
|
48
|
+
computerUseTool?: {
|
|
49
|
+
displayWidth: number;
|
|
50
|
+
displayHeight: number;
|
|
51
|
+
environment: import("@prisma/client").$Enums.ComputerUseToolEnvironment;
|
|
52
|
+
mcpServerId: string | null;
|
|
53
|
+
} | undefined;
|
|
54
|
+
imageGenerationTool?: {
|
|
55
|
+
model: string;
|
|
56
|
+
quality: import("@prisma/client").$Enums.ImageGenerationToolQuality;
|
|
57
|
+
size: import("@prisma/client").$Enums.ImageGenerationToolSize;
|
|
58
|
+
outputFormat: import("@prisma/client").$Enums.ImageGenerationToolOutputFormat;
|
|
59
|
+
background: import("@prisma/client").$Enums.ImageGenerationToolBackground;
|
|
60
|
+
partialImages: number;
|
|
61
|
+
} | undefined;
|
|
62
|
+
codeInterpreterTool?: {} | undefined;
|
|
63
|
+
webSearchTool?: {} | undefined;
|
|
64
|
+
fileSearchTool?: {
|
|
65
|
+
vectorStoreIds: string[];
|
|
66
|
+
maxNumResults: number;
|
|
67
|
+
} | undefined;
|
|
68
|
+
id: string;
|
|
69
|
+
type: import("@prisma/client").$Enums.ToolType;
|
|
70
|
+
};
|
|
71
|
+
}>>;
|
|
72
|
+
export declare const buildOPTIONS: () => () => NextResponse<{}>;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=buildRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRoute.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/tools/buildRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAWxE,KAAK,UAAU,GAAG;IAChB,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,QAAQ,GAClB,YAAY;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,MAC9B,UAAU,WAAW,EAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkD9C,CAAA;AAEH,eAAO,MAAM,SAAS,GACnB,YAAY;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,MAC9B,SAAS,WAAW,EAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmG7C,CAAA;AAEH,eAAO,MAAM,YAAY,8BAMtB,CAAA"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import { ApiKeyType, ToolType } from '@prisma/client';
|
|
3
|
+
import { headers } from 'next/headers';
|
|
4
|
+
import { cacheHeaders } from '../../../../../lib/cache/cacheHeaders';
|
|
5
|
+
import { getApiKey } from '../../../../../lib/apiKeys/getApiKey';
|
|
6
|
+
import { serializeApiTool, toolInclude, } from '../../../../../lib/tools/serializeApiTool';
|
|
7
|
+
import { toolSchema } from '../../../../../lib/tools/toolSchema';
|
|
8
|
+
import { isToolConfigAvailable } from '../../../../../lib/tools/isToolConfigAvailable';
|
|
9
|
+
export const buildGET = ({ prisma }) => async (_request, props) => {
|
|
10
|
+
const { assistantId } = await props.params;
|
|
11
|
+
const headersList = await headers();
|
|
12
|
+
const authorization = headersList.get('authorization');
|
|
13
|
+
if (!authorization) {
|
|
14
|
+
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
15
|
+
}
|
|
16
|
+
const privateApiKey = await getApiKey({
|
|
17
|
+
type: ApiKeyType.PRIVATE,
|
|
18
|
+
authorization,
|
|
19
|
+
prisma,
|
|
20
|
+
});
|
|
21
|
+
if (!privateApiKey) {
|
|
22
|
+
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
23
|
+
}
|
|
24
|
+
const assistant = await prisma.assistant.findFirst({
|
|
25
|
+
where: {
|
|
26
|
+
id: assistantId,
|
|
27
|
+
workspaceId: privateApiKey.workspaceId,
|
|
28
|
+
},
|
|
29
|
+
include: {
|
|
30
|
+
tools: {
|
|
31
|
+
include: toolInclude,
|
|
32
|
+
orderBy: {
|
|
33
|
+
createdAt: 'desc',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
if (!assistant) {
|
|
39
|
+
return NextResponse.json({ error: 'No assistant found' }, { status: 400 });
|
|
40
|
+
}
|
|
41
|
+
return NextResponse.json({
|
|
42
|
+
tools: assistant.tools.map((tool) => serializeApiTool({ tool })),
|
|
43
|
+
}, { headers: cacheHeaders });
|
|
44
|
+
};
|
|
45
|
+
export const buildPOST = ({ prisma }) => async (request, props) => {
|
|
46
|
+
var _a, _b, _c;
|
|
47
|
+
const { assistantId } = await props.params;
|
|
48
|
+
const headersList = await headers();
|
|
49
|
+
const authorization = headersList.get('authorization');
|
|
50
|
+
if (!authorization) {
|
|
51
|
+
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
52
|
+
}
|
|
53
|
+
const privateApiKey = await getApiKey({
|
|
54
|
+
authorization,
|
|
55
|
+
type: ApiKeyType.PRIVATE,
|
|
56
|
+
prisma,
|
|
57
|
+
});
|
|
58
|
+
if (!privateApiKey) {
|
|
59
|
+
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
60
|
+
}
|
|
61
|
+
const assistant = await prisma.assistant.findFirst({
|
|
62
|
+
where: {
|
|
63
|
+
id: assistantId,
|
|
64
|
+
workspaceId: privateApiKey.workspaceId,
|
|
65
|
+
},
|
|
66
|
+
include: {
|
|
67
|
+
modelProvider: true,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
if (!assistant) {
|
|
71
|
+
return NextResponse.json({ error: 'No assistant found' }, { status: 400 });
|
|
72
|
+
}
|
|
73
|
+
const body = await request.json();
|
|
74
|
+
const parsed = toolSchema.safeParse(body);
|
|
75
|
+
if (!parsed.success) {
|
|
76
|
+
console.error('Tool creation error:', parsed.error);
|
|
77
|
+
return NextResponse.json({ error: 'Invalid payload' }, { status: 400 });
|
|
78
|
+
}
|
|
79
|
+
const { type } = parsed.data;
|
|
80
|
+
if (!isToolConfigAvailable({
|
|
81
|
+
toolType: type,
|
|
82
|
+
modelProviderType: assistant.modelProvider.type,
|
|
83
|
+
storageProviderType: assistant.storageProviderType,
|
|
84
|
+
})) {
|
|
85
|
+
return NextResponse.json({
|
|
86
|
+
error: `Tool type ${type} is not available for this assistant's provider configuration`,
|
|
87
|
+
}, { status: 400 });
|
|
88
|
+
}
|
|
89
|
+
const typeSpecificCreate = {};
|
|
90
|
+
if (type === ToolType.FILE_SEARCH) {
|
|
91
|
+
typeSpecificCreate.fileSearchTool = {
|
|
92
|
+
create: (_a = parsed.data.fileSearchTool) !== null && _a !== void 0 ? _a : {},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
else if (type === ToolType.WEB_SEARCH) {
|
|
96
|
+
typeSpecificCreate.webSearchTool = { create: {} };
|
|
97
|
+
}
|
|
98
|
+
else if (type === ToolType.CODE_INTERPRETER) {
|
|
99
|
+
typeSpecificCreate.codeInterpreterTool = { create: {} };
|
|
100
|
+
}
|
|
101
|
+
else if (type === ToolType.IMAGE_GENERATION) {
|
|
102
|
+
typeSpecificCreate.imageGenerationTool = {
|
|
103
|
+
create: (_b = parsed.data.imageGenerationTool) !== null && _b !== void 0 ? _b : {},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
else if (type === ToolType.COMPUTER_USE) {
|
|
107
|
+
typeSpecificCreate.computerUseTool = {
|
|
108
|
+
create: (_c = parsed.data.computerUseTool) !== null && _c !== void 0 ? _c : {},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const tool = await prisma.tool.create({
|
|
112
|
+
data: Object.assign({ type, assistantId: assistant.id }, typeSpecificCreate),
|
|
113
|
+
include: toolInclude,
|
|
114
|
+
});
|
|
115
|
+
return NextResponse.json({
|
|
116
|
+
tool: serializeApiTool({ tool }),
|
|
117
|
+
}, { headers: cacheHeaders });
|
|
118
|
+
};
|
|
119
|
+
export const buildOPTIONS = () => () => NextResponse.json({}, {
|
|
120
|
+
headers: cacheHeaders,
|
|
121
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const GET: (_request: import("next/server").NextRequest, props: {
|
|
2
|
+
params: Promise<{
|
|
3
|
+
assistantId: string;
|
|
4
|
+
}>;
|
|
5
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
6
|
+
error: string;
|
|
7
|
+
}> | import("next/server").NextResponse<{
|
|
8
|
+
tools: {
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
computerUseTool?: {
|
|
12
|
+
displayWidth: number;
|
|
13
|
+
displayHeight: number;
|
|
14
|
+
environment: import("@prisma/client").$Enums.ComputerUseToolEnvironment;
|
|
15
|
+
mcpServerId: string | null;
|
|
16
|
+
} | undefined;
|
|
17
|
+
imageGenerationTool?: {
|
|
18
|
+
model: string;
|
|
19
|
+
quality: import("@prisma/client").$Enums.ImageGenerationToolQuality;
|
|
20
|
+
size: import("@prisma/client").$Enums.ImageGenerationToolSize;
|
|
21
|
+
outputFormat: import("@prisma/client").$Enums.ImageGenerationToolOutputFormat;
|
|
22
|
+
background: import("@prisma/client").$Enums.ImageGenerationToolBackground;
|
|
23
|
+
partialImages: number;
|
|
24
|
+
} | undefined;
|
|
25
|
+
codeInterpreterTool?: {} | undefined;
|
|
26
|
+
webSearchTool?: {} | undefined;
|
|
27
|
+
fileSearchTool?: {
|
|
28
|
+
vectorStoreIds: string[];
|
|
29
|
+
maxNumResults: number;
|
|
30
|
+
} | undefined;
|
|
31
|
+
id: string;
|
|
32
|
+
type: import("@prisma/client").$Enums.ToolType;
|
|
33
|
+
}[];
|
|
34
|
+
}>>;
|
|
35
|
+
export declare const POST: (request: import("next/server").NextRequest, props: {
|
|
36
|
+
params: Promise<{
|
|
37
|
+
assistantId: string;
|
|
38
|
+
}>;
|
|
39
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
40
|
+
error: string;
|
|
41
|
+
}> | import("next/server").NextResponse<{
|
|
42
|
+
tool: {
|
|
43
|
+
createdAt: string;
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
computerUseTool?: {
|
|
46
|
+
displayWidth: number;
|
|
47
|
+
displayHeight: number;
|
|
48
|
+
environment: import("@prisma/client").$Enums.ComputerUseToolEnvironment;
|
|
49
|
+
mcpServerId: string | null;
|
|
50
|
+
} | undefined;
|
|
51
|
+
imageGenerationTool?: {
|
|
52
|
+
model: string;
|
|
53
|
+
quality: import("@prisma/client").$Enums.ImageGenerationToolQuality;
|
|
54
|
+
size: import("@prisma/client").$Enums.ImageGenerationToolSize;
|
|
55
|
+
outputFormat: import("@prisma/client").$Enums.ImageGenerationToolOutputFormat;
|
|
56
|
+
background: import("@prisma/client").$Enums.ImageGenerationToolBackground;
|
|
57
|
+
partialImages: number;
|
|
58
|
+
} | undefined;
|
|
59
|
+
codeInterpreterTool?: {} | undefined;
|
|
60
|
+
webSearchTool?: {} | undefined;
|
|
61
|
+
fileSearchTool?: {
|
|
62
|
+
vectorStoreIds: string[];
|
|
63
|
+
maxNumResults: number;
|
|
64
|
+
} | undefined;
|
|
65
|
+
id: string;
|
|
66
|
+
type: import("@prisma/client").$Enums.ToolType;
|
|
67
|
+
};
|
|
68
|
+
}>>;
|
|
69
|
+
export declare const OPTIONS: () => import("next/server").NextResponse<{}>;
|
|
70
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/tools/route.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuB,CAAA;AAEvC,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAwB,CAAA;AAEzC,eAAO,MAAM,OAAO,8CAAiB,CAAA"}
|
|
@@ -18,46 +18,60 @@ declare const createAssistantSchema: z.ZodEffects<z.ZodObject<{
|
|
|
18
18
|
instructions: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
19
19
|
codeInterpreterEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
20
20
|
fileSearchEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
21
|
+
truncationType: z.ZodOptional<z.ZodNativeEnum<{
|
|
22
|
+
AUTO: "AUTO";
|
|
23
|
+
LAST_MESSAGES: "LAST_MESSAGES";
|
|
24
|
+
DISABLED: "DISABLED";
|
|
25
|
+
}>>;
|
|
26
|
+
truncationLastMessagesCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
21
27
|
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
storageProviderType: "OPENAI" | "AZURE_OPENAI" | "SUPERINTERFACE_CLOUD" | "OPENAI_RESPONSES" | "AZURE_RESPONSES" | "AZURE_AGENTS";
|
|
29
|
+
modelProviderId: string;
|
|
22
30
|
model: string;
|
|
23
|
-
instructions: string;
|
|
24
31
|
description: string;
|
|
25
|
-
|
|
26
|
-
storageProviderType: "OPENAI" | "AZURE_OPENAI" | "SUPERINTERFACE_CLOUD" | "OPENAI_RESPONSES" | "AZURE_RESPONSES" | "AZURE_AGENTS";
|
|
32
|
+
instructions: string;
|
|
27
33
|
codeInterpreterEnabled: boolean;
|
|
28
34
|
fileSearchEnabled: boolean;
|
|
29
|
-
name?: string | undefined;
|
|
30
35
|
storageProviderAssistantId?: string | null | undefined;
|
|
36
|
+
name?: string | undefined;
|
|
37
|
+
truncationType?: "AUTO" | "LAST_MESSAGES" | "DISABLED" | undefined;
|
|
38
|
+
truncationLastMessagesCount?: number | null | undefined;
|
|
31
39
|
}, {
|
|
32
|
-
model: string;
|
|
33
|
-
modelProviderId: string;
|
|
34
40
|
storageProviderType: "OPENAI" | "AZURE_OPENAI" | "SUPERINTERFACE_CLOUD" | "OPENAI_RESPONSES" | "AZURE_RESPONSES" | "AZURE_AGENTS";
|
|
41
|
+
modelProviderId: string;
|
|
42
|
+
model: string;
|
|
43
|
+
storageProviderAssistantId?: string | null | undefined;
|
|
35
44
|
name?: string | undefined;
|
|
36
|
-
instructions?: string | undefined;
|
|
37
45
|
description?: string | undefined;
|
|
38
|
-
|
|
46
|
+
instructions?: string | undefined;
|
|
39
47
|
codeInterpreterEnabled?: boolean | undefined;
|
|
40
48
|
fileSearchEnabled?: boolean | undefined;
|
|
49
|
+
truncationType?: "AUTO" | "LAST_MESSAGES" | "DISABLED" | undefined;
|
|
50
|
+
truncationLastMessagesCount?: number | null | undefined;
|
|
41
51
|
}>, {
|
|
52
|
+
storageProviderType: "OPENAI" | "AZURE_OPENAI" | "SUPERINTERFACE_CLOUD" | "OPENAI_RESPONSES" | "AZURE_RESPONSES" | "AZURE_AGENTS";
|
|
53
|
+
modelProviderId: string;
|
|
42
54
|
model: string;
|
|
43
|
-
instructions: string;
|
|
44
55
|
description: string;
|
|
45
|
-
|
|
46
|
-
storageProviderType: "OPENAI" | "AZURE_OPENAI" | "SUPERINTERFACE_CLOUD" | "OPENAI_RESPONSES" | "AZURE_RESPONSES" | "AZURE_AGENTS";
|
|
56
|
+
instructions: string;
|
|
47
57
|
codeInterpreterEnabled: boolean;
|
|
48
58
|
fileSearchEnabled: boolean;
|
|
49
|
-
name?: string | undefined;
|
|
50
59
|
storageProviderAssistantId?: string | null | undefined;
|
|
60
|
+
name?: string | undefined;
|
|
61
|
+
truncationType?: "AUTO" | "LAST_MESSAGES" | "DISABLED" | undefined;
|
|
62
|
+
truncationLastMessagesCount?: number | null | undefined;
|
|
51
63
|
}, {
|
|
52
|
-
model: string;
|
|
53
|
-
modelProviderId: string;
|
|
54
64
|
storageProviderType: "OPENAI" | "AZURE_OPENAI" | "SUPERINTERFACE_CLOUD" | "OPENAI_RESPONSES" | "AZURE_RESPONSES" | "AZURE_AGENTS";
|
|
65
|
+
modelProviderId: string;
|
|
66
|
+
model: string;
|
|
67
|
+
storageProviderAssistantId?: string | null | undefined;
|
|
55
68
|
name?: string | undefined;
|
|
56
|
-
instructions?: string | undefined;
|
|
57
69
|
description?: string | undefined;
|
|
58
|
-
|
|
70
|
+
instructions?: string | undefined;
|
|
59
71
|
codeInterpreterEnabled?: boolean | undefined;
|
|
60
72
|
fileSearchEnabled?: boolean | undefined;
|
|
73
|
+
truncationType?: "AUTO" | "LAST_MESSAGES" | "DISABLED" | undefined;
|
|
74
|
+
truncationLastMessagesCount?: number | null | undefined;
|
|
61
75
|
}>;
|
|
62
76
|
export declare const buildGET: ({ prisma }: {
|
|
63
77
|
prisma: PrismaClient;
|
|
@@ -75,6 +89,8 @@ export declare const buildGET: ({ prisma }: {
|
|
|
75
89
|
instructions: string;
|
|
76
90
|
codeInterpreterEnabled: boolean;
|
|
77
91
|
fileSearchEnabled: boolean;
|
|
92
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
93
|
+
truncationLastMessagesCount: number | null;
|
|
78
94
|
createdAt: string;
|
|
79
95
|
updatedAt: string;
|
|
80
96
|
avatar: {
|
|
@@ -104,6 +120,8 @@ export declare const buildPOST: ({ prisma }: {
|
|
|
104
120
|
instructions: string;
|
|
105
121
|
codeInterpreterEnabled: boolean;
|
|
106
122
|
fileSearchEnabled: boolean;
|
|
123
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
124
|
+
truncationLastMessagesCount: number | null;
|
|
107
125
|
createdAt: string;
|
|
108
126
|
updatedAt: string;
|
|
109
127
|
avatar: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRoute.d.ts","sourceRoot":"","sources":["../../../../src/app/api/assistants/buildRoute.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"buildRoute.d.ts","sourceRoot":"","sources":["../../../../src/app/api/assistants/buildRoute.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCvB,CAAA;AAEJ,eAAO,MAAM,QAAQ,GAClB,YAAY;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CpC,CAAA;AAEH,eAAO,MAAM,SAAS,GACnB,YAAY;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,MAC9B,SAAS,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2GtB,CAAA;AAEH,eAAO,MAAM,YAAY,8BAMtB,CAAA;AAEH,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { headers } from 'next/headers';
|
|
2
|
-
import { ApiKeyType, StorageProviderType, ToolType, } from '@prisma/client';
|
|
2
|
+
import { ApiKeyType, StorageProviderType, TruncationType, ToolType, } from '@prisma/client';
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { cacheHeaders } from '../../../lib/cache/cacheHeaders';
|
|
@@ -16,6 +16,8 @@ const createAssistantSchema = z
|
|
|
16
16
|
instructions: z.string().optional().default(''),
|
|
17
17
|
codeInterpreterEnabled: z.boolean().optional().default(false),
|
|
18
18
|
fileSearchEnabled: z.boolean().optional().default(false),
|
|
19
|
+
truncationType: z.nativeEnum(TruncationType).optional(),
|
|
20
|
+
truncationLastMessagesCount: z.number().int().nullable().optional(),
|
|
19
21
|
})
|
|
20
22
|
.superRefine((data, ctx) => {
|
|
21
23
|
if (data.storageProviderType === StorageProviderType.SUPERINTERFACE_CLOUD &&
|
|
@@ -87,17 +89,19 @@ export const buildPOST = ({ prisma }) => async (request) => {
|
|
|
87
89
|
error: `Missing required fields. ${JSON.stringify(parseResult.error.format())}`,
|
|
88
90
|
}, { status: 400 });
|
|
89
91
|
}
|
|
90
|
-
const { storageProviderType, storageProviderAssistantId, modelProviderId, model, name, description, instructions, codeInterpreterEnabled, fileSearchEnabled, } = parseResult.data;
|
|
92
|
+
const { storageProviderType, storageProviderAssistantId, modelProviderId, model, name, description, instructions, codeInterpreterEnabled, fileSearchEnabled, truncationType, truncationLastMessagesCount, } = parseResult.data;
|
|
91
93
|
const workspaceId = privateApiKey.workspaceId;
|
|
92
94
|
const assistant = await prisma.assistant.create({
|
|
93
|
-
data: Object.assign(Object.assign({ workspace: { connect: { id: workspaceId } }, modelProvider: { connect: { id: modelProviderId } }, modelSlug: model, name,
|
|
95
|
+
data: Object.assign(Object.assign(Object.assign(Object.assign({ workspace: { connect: { id: workspaceId } }, modelProvider: { connect: { id: modelProviderId } }, modelSlug: model, name,
|
|
94
96
|
description,
|
|
95
97
|
instructions,
|
|
96
98
|
storageProviderType }, (storageProviderType === StorageProviderType.AZURE_AGENTS
|
|
97
99
|
? { azureAgentsAgentId: storageProviderAssistantId !== null && storageProviderAssistantId !== void 0 ? storageProviderAssistantId : null }
|
|
98
100
|
: storageProviderType === StorageProviderType.AZURE_RESPONSES
|
|
99
101
|
? { azureResponsesAgentName: storageProviderAssistantId !== null && storageProviderAssistantId !== void 0 ? storageProviderAssistantId : null }
|
|
100
|
-
: { openaiAssistantId: storageProviderAssistantId !== null && storageProviderAssistantId !== void 0 ? storageProviderAssistantId : null })), {
|
|
102
|
+
: { openaiAssistantId: storageProviderAssistantId !== null && storageProviderAssistantId !== void 0 ? storageProviderAssistantId : null })), (truncationType !== undefined && { truncationType })), (truncationLastMessagesCount !== undefined && {
|
|
103
|
+
truncationLastMessagesCount,
|
|
104
|
+
})), { tools: {
|
|
101
105
|
create: [
|
|
102
106
|
...(fileSearchEnabled
|
|
103
107
|
? [
|
|
@@ -14,6 +14,8 @@ export declare const GET: () => Promise<import("next/server").NextResponse<{
|
|
|
14
14
|
instructions: string;
|
|
15
15
|
codeInterpreterEnabled: boolean;
|
|
16
16
|
fileSearchEnabled: boolean;
|
|
17
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
18
|
+
truncationLastMessagesCount: number | null;
|
|
17
19
|
createdAt: string;
|
|
18
20
|
updatedAt: string;
|
|
19
21
|
avatar: {
|
|
@@ -41,6 +43,8 @@ export declare const POST: (request: Request) => Promise<import("next/server").N
|
|
|
41
43
|
instructions: string;
|
|
42
44
|
codeInterpreterEnabled: boolean;
|
|
43
45
|
fileSearchEnabled: boolean;
|
|
46
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
47
|
+
truncationLastMessagesCount: number | null;
|
|
44
48
|
createdAt: string;
|
|
45
49
|
updatedAt: string;
|
|
46
50
|
avatar: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/app/api/assistants/route.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,qBAAqB,EACtB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,qBAAqB,EAAE,CAAA;AAEhC,eAAO,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/app/api/assistants/route.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,qBAAqB,EACtB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,qBAAqB,EAAE,CAAA;AAEhC,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuB,CAAA;AAEvC,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAwB,CAAA;AAEzC,eAAO,MAAM,OAAO,8CAAiB,CAAA"}
|
|
@@ -22,6 +22,8 @@ export declare const serializeApiAssistant: ({ assistant, }: {
|
|
|
22
22
|
instructions: string;
|
|
23
23
|
codeInterpreterEnabled: boolean;
|
|
24
24
|
fileSearchEnabled: boolean;
|
|
25
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
26
|
+
truncationLastMessagesCount: number | null;
|
|
25
27
|
createdAt: string;
|
|
26
28
|
updatedAt: string;
|
|
27
29
|
avatar: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeApiAssistant.d.ts","sourceRoot":"","sources":["../../../src/lib/assistants/serializeApiAssistant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAK5C,eAAO,MAAM,qBAAqB,GAAI,gBAEnC;IACD,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC;QACpC,OAAO,EAAE;YACP,KAAK,EAAE,IAAI,CAAA;YACX,MAAM,EAAE;gBACN,OAAO,EAAE;oBACP,UAAU,EAAE,IAAI,CAAA;oBAChB,WAAW,EAAE,IAAI,CAAA;iBAClB,CAAA;aACF,CAAA;SACF,CAAA;KACF,CAAC,CAAA;CACH
|
|
1
|
+
{"version":3,"file":"serializeApiAssistant.d.ts","sourceRoot":"","sources":["../../../src/lib/assistants/serializeApiAssistant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAK5C,eAAO,MAAM,qBAAqB,GAAI,gBAEnC;IACD,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC;QACpC,OAAO,EAAE;YACP,KAAK,EAAE,IAAI,CAAA;YACX,MAAM,EAAE;gBACN,OAAO,EAAE;oBACP,UAAU,EAAE,IAAI,CAAA;oBAChB,WAAW,EAAE,IAAI,CAAA;iBAClB,CAAA;aACF,CAAA;SACF,CAAA;KACF,CAAC,CAAA;CACH;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,CAAA"}
|
|
@@ -18,6 +18,8 @@ export const serializeApiAssistant = ({ assistant, }) => {
|
|
|
18
18
|
instructions: assistant.instructions,
|
|
19
19
|
codeInterpreterEnabled: assistant.tools.some((tool) => tool.type === ToolType.CODE_INTERPRETER),
|
|
20
20
|
fileSearchEnabled: assistant.tools.some((tool) => tool.type === ToolType.FILE_SEARCH),
|
|
21
|
+
truncationType: assistant.truncationType,
|
|
22
|
+
truncationLastMessagesCount: assistant.truncationLastMessagesCount,
|
|
21
23
|
createdAt: assistant.createdAt.toISOString(),
|
|
22
24
|
updatedAt: assistant.updatedAt.toISOString(),
|
|
23
25
|
avatar: serializeAvatar({
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ModelProviderType, StorageProviderType, ToolType } from '@prisma/client';
|
|
2
|
+
export type ToolConfigAvailability = {
|
|
3
|
+
modelProviderType: ModelProviderType;
|
|
4
|
+
storageProviderType: StorageProviderType;
|
|
5
|
+
};
|
|
6
|
+
export type ToolConfig = {
|
|
7
|
+
type: ToolType;
|
|
8
|
+
availabilities: ToolConfigAvailability[];
|
|
9
|
+
};
|
|
10
|
+
export declare const toolConfigs: ToolConfig[];
|
|
11
|
+
export declare const isToolConfigAvailable: ({ toolType, modelProviderType, storageProviderType, }: {
|
|
12
|
+
toolType: ToolType;
|
|
13
|
+
modelProviderType: ModelProviderType;
|
|
14
|
+
storageProviderType: StorageProviderType;
|
|
15
|
+
}) => boolean;
|
|
16
|
+
//# sourceMappingURL=isToolConfigAvailable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isToolConfigAvailable.d.ts","sourceRoot":"","sources":["../../../src/lib/tools/isToolConfigAvailable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACT,MAAM,gBAAgB,CAAA;AAEvB,MAAM,MAAM,sBAAsB,GAAG;IACnC,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,mBAAmB,EAAE,mBAAmB,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,CAAA;IACd,cAAc,EAAE,sBAAsB,EAAE,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,UAAU,EAsGnC,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,uDAInC;IACD,QAAQ,EAAE,QAAQ,CAAA;IAClB,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,mBAAmB,EAAE,mBAAmB,CAAA;CACzC,KAAG,OASH,CAAA"}
|