@superinterface/server 1.0.22 → 1.0.24
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/build-manifest.json +2 -2
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_btwyo7 +1 -1
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/api/files/[fileId]/contents/route.js +3 -3
- package/.next/server/app/api/files/[fileId]/contents/route.js.nft.json +1 -1
- package/.next/server/app/api/files/route.js +3 -3
- package/.next/server/app/api/files/route.js.nft.json +1 -1
- package/.next/server/app/api/messages/route.js +6 -6
- package/.next/server/app/api/messages/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/callback/route.js +6 -7
- package/.next/server/app/api/tasks/callback/route.js.nft.json +1 -1
- package/.next/server/app/api/threads/runs/submit-client-tool-outputs/route.js +1 -1
- package/.next/server/app/api/threads/runs/submit-client-tool-outputs/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/chunks/[root-of-the-server]__0c1bc5ed._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0c1bc5ed._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__228bff78._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__228bff78._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__25ee13bc._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__25ee13bc._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__2945c9e9._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__2945c9e9._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__29635e8e._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__29635e8e._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__29b43490._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__29b43490._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__315f084a._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__315f084a._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__3307123c._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__3307123c._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__40ab45eb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__40ab45eb._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__441cee00._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__441cee00._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__464a4377._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__464a4377._.js.map +1 -1
- 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]__50c5f12c._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__583a7f1c._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__583a7f1c._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__5abf1160._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__5abf1160._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__5d09614a._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__5d09614a._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__62d958e7._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__62d958e7._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__676affb1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__676affb1._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__72b72b9e._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__72b72b9e._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__83461316._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__83461316._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__9a611d42._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__9a611d42._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__a878c913._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__a878c913._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__b10ec83e._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__b10ec83e._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__c1629392._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__c1629392._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__dd176cb5._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__dd176cb5._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__e7819e95._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__e7819e95._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__eb816e13._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__eb816e13._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__f845ef25._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__f845ef25._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__ff90af03._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__ff90af03._.js.map +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_cb746cf4.js +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_cb746cf4.js.map +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_f952d9ab.js +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_f952d9ab.js.map +1 -1
- package/.next/server/chunks/supercorp_superinterface_bebd2c96._.js +3 -3
- package/.next/server/chunks/supercorp_superinterface_bebd2c96._.js.map +1 -1
- package/.next/server/functions-config-manifest.json +2 -2
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/trace +1 -1
- package/dist/app/api/api-keys/[apiKeyId]/route.d.ts +6 -51
- package/dist/app/api/api-keys/[apiKeyId]/route.d.ts.map +1 -1
- package/dist/app/api/api-keys/[apiKeyId]/route.js +10 -7
- package/dist/app/api/api-keys/route.d.ts +4 -26
- package/dist/app/api/api-keys/route.d.ts.map +1 -1
- package/dist/app/api/api-keys/route.js +7 -5
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts +6 -168
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.js +10 -7
- package/dist/app/api/assistants/[assistantId]/functions/route.d.ts +4 -110
- package/dist/app/api/assistants/[assistantId]/functions/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/functions/route.js +7 -5
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts +4 -36
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.js +7 -5
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.d.ts +6 -90
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js +10 -7
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts +4 -58
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.js +7 -5
- package/dist/app/api/assistants/[assistantId]/route.d.ts +6 -119
- package/dist/app/api/assistants/[assistantId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/route.js +10 -7
- package/dist/app/api/assistants/route.d.ts +4 -56
- package/dist/app/api/assistants/route.d.ts.map +1 -1
- package/dist/app/api/assistants/route.js +7 -5
- package/dist/app/api/files/[fileId]/contents/route.d.ts +2 -6
- package/dist/app/api/files/[fileId]/contents/route.d.ts.map +1 -1
- package/dist/app/api/files/[fileId]/contents/route.js +4 -3
- package/dist/app/api/files/route.d.ts +2 -8
- package/dist/app/api/files/route.d.ts.map +1 -1
- package/dist/app/api/files/route.js +4 -3
- package/dist/app/api/messages/lib/initialMessagesResponse.d.ts.map +1 -1
- package/dist/app/api/messages/lib/initialMessagesResponse.js +2 -3
- package/dist/app/api/messages/route.d.ts +4 -22
- package/dist/app/api/messages/route.d.ts.map +1 -1
- package/dist/app/api/messages/route.js +7 -5
- package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts +2 -17
- package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/assistants/route.js +4 -3
- package/dist/app/api/providers/[modelProviderId]/models/route.d.ts +2 -12
- package/dist/app/api/providers/[modelProviderId]/models/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/models/route.js +4 -3
- package/dist/app/api/providers/[modelProviderId]/route.d.ts +6 -60
- package/dist/app/api/providers/[modelProviderId]/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/route.js +10 -7
- package/dist/app/api/providers/route.d.ts +4 -32
- package/dist/app/api/providers/route.d.ts.map +1 -1
- package/dist/app/api/providers/route.js +7 -5
- package/dist/app/api/tasks/[taskId]/route.d.ts +6 -57
- package/dist/app/api/tasks/[taskId]/route.d.ts.map +1 -1
- package/dist/app/api/tasks/[taskId]/route.js +10 -7
- package/dist/app/api/tasks/callback/route.d.ts.map +1 -1
- package/dist/app/api/tasks/callback/route.js +5 -5
- package/dist/app/api/tasks/route.d.ts +4 -30
- package/dist/app/api/tasks/route.d.ts.map +1 -1
- package/dist/app/api/tasks/route.js +7 -5
- package/dist/app/api/threads/runs/submit-client-tool-outputs/route.d.ts +2 -6
- package/dist/app/api/threads/runs/submit-client-tool-outputs/route.d.ts.map +1 -1
- package/dist/app/api/threads/runs/submit-client-tool-outputs/route.js +6 -6
- package/dist/app/api/workspaces/[workspaceId]/route.d.ts +4 -30
- package/dist/app/api/workspaces/[workspaceId]/route.d.ts.map +1 -1
- package/dist/app/api/workspaces/[workspaceId]/route.js +7 -5
- package/dist/app/api/workspaces/route.d.ts +4 -22
- package/dist/app/api/workspaces/route.d.ts.map +1 -1
- package/dist/app/api/workspaces/route.js +7 -5
- package/dist/lib/functions/handleFunction/handleAssistant.d.ts.map +1 -1
- package/dist/lib/functions/handleFunction/handleAssistant.js +2 -3
- package/dist/lib/mcpServers/getToolCallMcpServer.d.ts.map +1 -1
- package/dist/lib/mcpServers/getToolCallMcpServer.js +5 -6
- package/dist/lib/prisma/index.d.ts +1 -0
- package/dist/lib/prisma/index.d.ts.map +1 -1
- package/dist/lib/prisma/index.js +12 -0
- package/dist/lib/tools/tools/index.d.ts.map +1 -1
- package/dist/lib/tools/tools/index.js +2 -3
- package/package.json +2 -3
- package/.next/server/chunks/[root-of-the-server]__19865527._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__19865527._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__27aadac9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__27aadac9._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__3ba06f7c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__3ba06f7c._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__51977f30._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__51977f30._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__7f9ca1e3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__7f9ca1e3._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__a135e388._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__a135e388._.js.map +0 -1
- package/dist/app/messages/lib/getWorkspaceId.d.ts +0 -6
- package/dist/app/messages/lib/getWorkspaceId.d.ts.map +0 -1
- package/dist/app/messages/lib/getWorkspaceId.js +0 -3
- package/dist/app/messages/lib/initialMessagesResponse.d.ts +0 -26
- package/dist/app/messages/lib/initialMessagesResponse.d.ts.map +0 -1
- package/dist/app/messages/lib/initialMessagesResponse.js +0 -59
- package/dist/app/messages/lib/serializeThread.d.ts +0 -18
- package/dist/app/messages/lib/serializeThread.d.ts.map +0 -1
- package/dist/app/messages/lib/serializeThread.js +0 -8
- package/dist/app/messages/route.d.ts +0 -31
- package/dist/app/messages/route.d.ts.map +0 -1
- package/dist/app/messages/route.js +0 -585
- package/dist/lib/prismaClient.d.ts +0 -5
- package/dist/lib/prismaClient.d.ts.map +0 -1
- package/dist/lib/prismaClient.js +0 -4
- /package/.next/static/{ImVeJObVDbb-MHLkfrFb1 → X1k4ISA6YteJsnJalPLxm}/_buildManifest.js +0 -0
- /package/.next/static/{ImVeJObVDbb-MHLkfrFb1 → X1k4ISA6YteJsnJalPLxm}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{ImVeJObVDbb-MHLkfrFb1 → X1k4ISA6YteJsnJalPLxm}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type NextRequest, NextResponse } from 'next/server';
|
|
2
2
|
import { type PrismaClient } from '@prisma/client';
|
|
3
|
-
export declare const buildGET: ({ prisma }?: {
|
|
3
|
+
export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
4
4
|
prisma?: PrismaClient;
|
|
5
5
|
}) => (request: NextRequest, props: {
|
|
6
6
|
params: Promise<{
|
|
@@ -56,61 +56,8 @@ export declare const buildGET: ({ prisma }?: {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
}>>;
|
|
59
|
-
export declare const GET:
|
|
60
|
-
|
|
61
|
-
assistantId: string;
|
|
62
|
-
}>;
|
|
63
|
-
}) => Promise<NextResponse<{
|
|
64
|
-
error: string;
|
|
65
|
-
}> | NextResponse<{
|
|
66
|
-
assistant: {
|
|
67
|
-
id: string;
|
|
68
|
-
storageProviderType: import("@prisma/client").$Enums.StorageProviderType;
|
|
69
|
-
storageProviderAssistantId: string | null;
|
|
70
|
-
modelProviderId: string;
|
|
71
|
-
model: string;
|
|
72
|
-
name: string;
|
|
73
|
-
description: string;
|
|
74
|
-
instructions: string;
|
|
75
|
-
codeInterpreterEnabled: boolean;
|
|
76
|
-
fileSearchEnabled: boolean;
|
|
77
|
-
createdAt: string;
|
|
78
|
-
updatedAt: string;
|
|
79
|
-
avatar: {
|
|
80
|
-
type: import("@prisma/client").$Enums.AvatarType;
|
|
81
|
-
imageAvatar: {
|
|
82
|
-
url: string;
|
|
83
|
-
} | null;
|
|
84
|
-
iconAvatar: {
|
|
85
|
-
name: import("@prisma/client").$Enums.IconAvatarName;
|
|
86
|
-
} | null;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
}> | NextResponse<{
|
|
90
|
-
assistant: {
|
|
91
|
-
id: string;
|
|
92
|
-
name: string;
|
|
93
|
-
description: string;
|
|
94
|
-
theme: {
|
|
95
|
-
accentColor: "gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "ruby" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky";
|
|
96
|
-
grayColor: "auto" | "gray" | "mauve" | "slate" | "sage" | "olive" | "sand";
|
|
97
|
-
appearance: "inherit" | "light" | "dark";
|
|
98
|
-
radius: "small" | "none" | "medium" | "large" | "full";
|
|
99
|
-
scaling: "90%" | "95%" | "100%" | "105%" | "110%";
|
|
100
|
-
panelBackground: "solid";
|
|
101
|
-
};
|
|
102
|
-
avatar: {
|
|
103
|
-
type: import("@prisma/client").$Enums.AvatarType;
|
|
104
|
-
imageAvatar: {
|
|
105
|
-
url: string;
|
|
106
|
-
} | null;
|
|
107
|
-
iconAvatar: {
|
|
108
|
-
name: import("@prisma/client").$Enums.IconAvatarName;
|
|
109
|
-
} | null;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
}>>;
|
|
113
|
-
export declare const buildPATCH: ({ prisma }?: {
|
|
59
|
+
export declare const GET: ReturnType<typeof buildGET>;
|
|
60
|
+
export declare const buildPATCH: ({ prisma: providedPrisma }?: {
|
|
114
61
|
prisma?: PrismaClient;
|
|
115
62
|
}) => (request: NextRequest, props: {
|
|
116
63
|
params: Promise<{
|
|
@@ -143,38 +90,8 @@ export declare const buildPATCH: ({ prisma }?: {
|
|
|
143
90
|
};
|
|
144
91
|
};
|
|
145
92
|
}>>;
|
|
146
|
-
export declare const PATCH:
|
|
147
|
-
|
|
148
|
-
assistantId: string;
|
|
149
|
-
}>;
|
|
150
|
-
}) => Promise<NextResponse<{
|
|
151
|
-
error: string;
|
|
152
|
-
}> | NextResponse<{
|
|
153
|
-
assistant: {
|
|
154
|
-
id: string;
|
|
155
|
-
storageProviderType: import("@prisma/client").$Enums.StorageProviderType;
|
|
156
|
-
storageProviderAssistantId: string | null;
|
|
157
|
-
modelProviderId: string;
|
|
158
|
-
model: string;
|
|
159
|
-
name: string;
|
|
160
|
-
description: string;
|
|
161
|
-
instructions: string;
|
|
162
|
-
codeInterpreterEnabled: boolean;
|
|
163
|
-
fileSearchEnabled: boolean;
|
|
164
|
-
createdAt: string;
|
|
165
|
-
updatedAt: string;
|
|
166
|
-
avatar: {
|
|
167
|
-
type: import("@prisma/client").$Enums.AvatarType;
|
|
168
|
-
imageAvatar: {
|
|
169
|
-
url: string;
|
|
170
|
-
} | null;
|
|
171
|
-
iconAvatar: {
|
|
172
|
-
name: import("@prisma/client").$Enums.IconAvatarName;
|
|
173
|
-
} | null;
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
}>>;
|
|
177
|
-
export declare const buildDELETE: ({ prisma }?: {
|
|
93
|
+
export declare const PATCH: ReturnType<typeof buildPATCH>;
|
|
94
|
+
export declare const buildDELETE: ({ prisma: providedPrisma }?: {
|
|
178
95
|
prisma?: PrismaClient;
|
|
179
96
|
}) => (request: NextRequest, props: {
|
|
180
97
|
params: Promise<{
|
|
@@ -207,36 +124,6 @@ export declare const buildDELETE: ({ prisma }?: {
|
|
|
207
124
|
};
|
|
208
125
|
};
|
|
209
126
|
}>>;
|
|
210
|
-
export declare const DELETE:
|
|
211
|
-
params: Promise<{
|
|
212
|
-
assistantId: string;
|
|
213
|
-
}>;
|
|
214
|
-
}) => Promise<NextResponse<{
|
|
215
|
-
error: string;
|
|
216
|
-
}> | NextResponse<{
|
|
217
|
-
assistant: {
|
|
218
|
-
id: string;
|
|
219
|
-
storageProviderType: import("@prisma/client").$Enums.StorageProviderType;
|
|
220
|
-
storageProviderAssistantId: string | null;
|
|
221
|
-
modelProviderId: string;
|
|
222
|
-
model: string;
|
|
223
|
-
name: string;
|
|
224
|
-
description: string;
|
|
225
|
-
instructions: string;
|
|
226
|
-
codeInterpreterEnabled: boolean;
|
|
227
|
-
fileSearchEnabled: boolean;
|
|
228
|
-
createdAt: string;
|
|
229
|
-
updatedAt: string;
|
|
230
|
-
avatar: {
|
|
231
|
-
type: import("@prisma/client").$Enums.AvatarType;
|
|
232
|
-
imageAvatar: {
|
|
233
|
-
url: string;
|
|
234
|
-
} | null;
|
|
235
|
-
iconAvatar: {
|
|
236
|
-
name: import("@prisma/client").$Enums.IconAvatarName;
|
|
237
|
-
} | null;
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
}>>;
|
|
127
|
+
export declare const DELETE: ReturnType<typeof buildDELETE>;
|
|
241
128
|
export declare const OPTIONS: () => NextResponse<{}>;
|
|
242
129
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/assistants/[assistantId]/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAA;AAUvB,eAAO,MAAM,QAAQ,GAClB,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/assistants/[assistantId]/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAA;AAUvB,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,MAAM,CAAA;KACpB,CAAC,CAAA;CACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,UAAU,GACpB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,MAAM,CAAA;KACpB,CAAC,CAAA;CACH;;;;;;;;;;;;;;;;;;;;;;;;;;GAuJF,CAAA;AAEH,eAAO,MAAM,KAAK,EACU,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AAEzD,eAAO,MAAM,WAAW,GACrB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,MAAM,CAAA;KACpB,CAAC,CAAA;CACH;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDF,CAAA;AAEH,eAAO,MAAM,MAAM,EACU,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;AAE3D,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
|
|
@@ -2,13 +2,14 @@ import { NextResponse } from 'next/server';
|
|
|
2
2
|
import { StorageProviderType, ApiKeyType, ToolType, } from '@prisma/client';
|
|
3
3
|
import { cacheHeaders } from '../../../../lib/cache/cacheHeaders';
|
|
4
4
|
import { workspaceAccessWhere as getWorkspaceAccessWhere } from '../../../../lib/apiKeys/workspaceAccessWhere';
|
|
5
|
-
import {
|
|
5
|
+
import { resolvePrisma } from '../../../../lib/prisma';
|
|
6
6
|
import { serializeAssistant } from '../../../../lib/assistants/serializeAssistant';
|
|
7
7
|
import { serializeApiAssistant } from '../../../../lib/assistants/serializeApiAssistant';
|
|
8
8
|
import { headers } from 'next/headers';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { getApiKey } from '../../../../lib/apiKeys/getApiKey';
|
|
11
|
-
export const buildGET = ({ prisma
|
|
11
|
+
export const buildGET = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
12
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
12
13
|
const params = await props.params;
|
|
13
14
|
const { assistantId } = params;
|
|
14
15
|
const headersList = await headers();
|
|
@@ -75,8 +76,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (request, pro
|
|
|
75
76
|
assistant: serializeAssistant({ assistant }),
|
|
76
77
|
}, { headers: cacheHeaders });
|
|
77
78
|
};
|
|
78
|
-
export const GET = buildGET();
|
|
79
|
-
export const buildPATCH = ({ prisma
|
|
79
|
+
export const GET = ((...args) => buildGET()(...args));
|
|
80
|
+
export const buildPATCH = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
81
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
80
82
|
const params = await props.params;
|
|
81
83
|
const { assistantId } = params;
|
|
82
84
|
const headersList = await headers();
|
|
@@ -180,8 +182,9 @@ export const buildPATCH = ({ prisma = defaultPrisma } = {}) => async (request, p
|
|
|
180
182
|
assistant: serializeApiAssistant({ assistant }),
|
|
181
183
|
}, { headers: cacheHeaders });
|
|
182
184
|
};
|
|
183
|
-
export const PATCH = buildPATCH();
|
|
184
|
-
export const buildDELETE = ({ prisma
|
|
185
|
+
export const PATCH = ((...args) => buildPATCH()(...args));
|
|
186
|
+
export const buildDELETE = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
187
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
185
188
|
const params = await props.params;
|
|
186
189
|
const { assistantId } = params;
|
|
187
190
|
const headersList = await headers();
|
|
@@ -224,7 +227,7 @@ export const buildDELETE = ({ prisma = defaultPrisma } = {}) => async (request,
|
|
|
224
227
|
assistant: serializeApiAssistant({ assistant }),
|
|
225
228
|
}, { headers: cacheHeaders });
|
|
226
229
|
};
|
|
227
|
-
export const DELETE = buildDELETE();
|
|
230
|
+
export const DELETE = ((...args) => buildDELETE()(...args));
|
|
228
231
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
229
232
|
headers: cacheHeaders,
|
|
230
233
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PrismaClient } from '@prisma/client';
|
|
2
2
|
import { NextResponse } from 'next/server';
|
|
3
|
-
export declare const buildGET: ({ prisma }?: {
|
|
3
|
+
export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
4
4
|
prisma?: PrismaClient;
|
|
5
5
|
}) => () => Promise<NextResponse<{
|
|
6
6
|
error: string;
|
|
@@ -29,34 +29,8 @@ export declare const buildGET: ({ prisma }?: {
|
|
|
29
29
|
};
|
|
30
30
|
}[];
|
|
31
31
|
}>>;
|
|
32
|
-
export declare const GET:
|
|
33
|
-
|
|
34
|
-
}> | NextResponse<{
|
|
35
|
-
assistants: {
|
|
36
|
-
id: string;
|
|
37
|
-
storageProviderType: import("@prisma/client").$Enums.StorageProviderType;
|
|
38
|
-
storageProviderAssistantId: string | null;
|
|
39
|
-
modelProviderId: string;
|
|
40
|
-
model: string;
|
|
41
|
-
name: string;
|
|
42
|
-
description: string;
|
|
43
|
-
instructions: string;
|
|
44
|
-
codeInterpreterEnabled: boolean;
|
|
45
|
-
fileSearchEnabled: boolean;
|
|
46
|
-
createdAt: string;
|
|
47
|
-
updatedAt: string;
|
|
48
|
-
avatar: {
|
|
49
|
-
type: import("@prisma/client").$Enums.AvatarType;
|
|
50
|
-
imageAvatar: {
|
|
51
|
-
url: string;
|
|
52
|
-
} | null;
|
|
53
|
-
iconAvatar: {
|
|
54
|
-
name: import("@prisma/client").$Enums.IconAvatarName;
|
|
55
|
-
} | null;
|
|
56
|
-
};
|
|
57
|
-
}[];
|
|
58
|
-
}>>;
|
|
59
|
-
export declare const buildPOST: ({ prisma }?: {
|
|
32
|
+
export declare const GET: ReturnType<typeof buildGET>;
|
|
33
|
+
export declare const buildPOST: ({ prisma: providedPrisma }?: {
|
|
60
34
|
prisma?: PrismaClient;
|
|
61
35
|
}) => (request: Request) => Promise<NextResponse<{
|
|
62
36
|
error: string;
|
|
@@ -85,32 +59,6 @@ export declare const buildPOST: ({ prisma }?: {
|
|
|
85
59
|
};
|
|
86
60
|
};
|
|
87
61
|
}>>;
|
|
88
|
-
export declare const POST:
|
|
89
|
-
error: string;
|
|
90
|
-
}> | NextResponse<{
|
|
91
|
-
assistant: {
|
|
92
|
-
id: string;
|
|
93
|
-
storageProviderType: import("@prisma/client").$Enums.StorageProviderType;
|
|
94
|
-
storageProviderAssistantId: string | null;
|
|
95
|
-
modelProviderId: string;
|
|
96
|
-
model: string;
|
|
97
|
-
name: string;
|
|
98
|
-
description: string;
|
|
99
|
-
instructions: string;
|
|
100
|
-
codeInterpreterEnabled: boolean;
|
|
101
|
-
fileSearchEnabled: boolean;
|
|
102
|
-
createdAt: string;
|
|
103
|
-
updatedAt: string;
|
|
104
|
-
avatar: {
|
|
105
|
-
type: import("@prisma/client").$Enums.AvatarType;
|
|
106
|
-
imageAvatar: {
|
|
107
|
-
url: string;
|
|
108
|
-
} | null;
|
|
109
|
-
iconAvatar: {
|
|
110
|
-
name: import("@prisma/client").$Enums.IconAvatarName;
|
|
111
|
-
} | null;
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
}>>;
|
|
62
|
+
export declare const POST: ReturnType<typeof buildPOST>;
|
|
115
63
|
export declare const OPTIONS: () => NextResponse<{}>;
|
|
116
64
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/app/api/assistants/route.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO1C,eAAO,MAAM,QAAQ,GAClB,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/app/api/assistants/route.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO1C,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;GA6C1D,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAwCrD,eAAO,MAAM,SAAS,GACnB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MACpD,SAAS,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;GAkGtB,CAAA;AAEH,eAAO,MAAM,IAAI,EACU,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
|
|
@@ -3,10 +3,11 @@ import { ApiKeyType, StorageProviderType, 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';
|
|
6
|
-
import {
|
|
6
|
+
import { resolvePrisma } from '../../../lib/prisma';
|
|
7
7
|
import { serializeApiAssistant } from '../../../lib/assistants/serializeApiAssistant';
|
|
8
8
|
import { getApiKey } from '../../../lib/apiKeys/getApiKey';
|
|
9
|
-
export const buildGET = ({ prisma
|
|
9
|
+
export const buildGET = ({ prisma: providedPrisma } = {}) => async () => {
|
|
10
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
10
11
|
const headersList = await headers();
|
|
11
12
|
const authorization = headersList.get('authorization');
|
|
12
13
|
if (!authorization) {
|
|
@@ -38,7 +39,7 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async () => {
|
|
|
38
39
|
assistants: assistants.map((a) => serializeApiAssistant({ assistant: a })),
|
|
39
40
|
}, { headers: cacheHeaders });
|
|
40
41
|
};
|
|
41
|
-
export const GET = buildGET();
|
|
42
|
+
export const GET = ((...args) => buildGET()(...args));
|
|
42
43
|
const createAssistantSchema = z
|
|
43
44
|
.object({
|
|
44
45
|
storageProviderType: z.nativeEnum(StorageProviderType),
|
|
@@ -69,7 +70,8 @@ const createAssistantSchema = z
|
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
72
|
});
|
|
72
|
-
export const buildPOST = ({ prisma
|
|
73
|
+
export const buildPOST = ({ prisma: providedPrisma } = {}) => async (request) => {
|
|
74
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
73
75
|
const headersList = await headers();
|
|
74
76
|
const authorization = headersList.get('authorization');
|
|
75
77
|
if (!authorization) {
|
|
@@ -140,7 +142,7 @@ export const buildPOST = ({ prisma = defaultPrisma } = {}) => async (request) =>
|
|
|
140
142
|
assistant: serializeApiAssistant({ assistant }),
|
|
141
143
|
}, { headers: cacheHeaders });
|
|
142
144
|
};
|
|
143
|
-
export const POST = buildPOST();
|
|
145
|
+
export const POST = ((...args) => buildPOST()(...args));
|
|
144
146
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
145
147
|
headers: cacheHeaders,
|
|
146
148
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OpenAI } from 'openai';
|
|
2
2
|
import { type Prisma, type PrismaClient } from '@prisma/client';
|
|
3
3
|
import { type NextRequest, NextResponse } from 'next/server';
|
|
4
|
-
export declare const buildGET: ({ prisma, purposeAssistantsResponse, }?: {
|
|
4
|
+
export declare const buildGET: ({ prisma: providedPrisma, purposeAssistantsResponse, }?: {
|
|
5
5
|
prisma?: PrismaClient;
|
|
6
6
|
purposeAssistantsResponse?: ({ file, }: {
|
|
7
7
|
file: OpenAI.Files.FileObject;
|
|
@@ -12,10 +12,6 @@ export declare const buildGET: ({ prisma, purposeAssistantsResponse, }?: {
|
|
|
12
12
|
fileId: string;
|
|
13
13
|
}>;
|
|
14
14
|
}) => Promise<NextResponse<unknown>>;
|
|
15
|
-
export declare const GET:
|
|
16
|
-
params: Promise<{
|
|
17
|
-
fileId: string;
|
|
18
|
-
}>;
|
|
19
|
-
}) => Promise<NextResponse<unknown>>;
|
|
15
|
+
export declare const GET: ReturnType<typeof buildGET>;
|
|
20
16
|
export declare const OPTIONS: () => NextResponse<{}>;
|
|
21
17
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/files/[fileId]/contents/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO5D,eAAO,MAAM,QAAQ,GAClB,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/files/[fileId]/contents/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO5D,eAAO,MAAM,QAAQ,GAClB,yDAIE;IACD,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,yBAAyB,CAAC,EAAE,CAAC,EAC3B,IAAI,GACL,EAAE;QACD,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAA;QAC7B,oBAAoB,EAAE,MAAM,CAAC,mBAAmB,CAAA;KACjD,KAAK,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAAA;CACtC,MAEJ,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QACd,MAAM,EAAE,MAAM,CAAA;KACf,CAAC,CAAA;CACH,mCA8GF,CAAA;AAEH,eAAO,MAAM,GAAG,EACY,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAEvD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
|
|
@@ -3,10 +3,11 @@ import { NextResponse } from 'next/server';
|
|
|
3
3
|
import { cacheHeaders } from '../../../../../lib/cache/cacheHeaders';
|
|
4
4
|
import { assistantClientAdapter } from '../../../../../lib/assistants/assistantClientAdapter';
|
|
5
5
|
import { workspaceAccessWhere as getWorkspaceAccessWhere } from '../../../../../lib/apiKeys/workspaceAccessWhere';
|
|
6
|
-
import {
|
|
6
|
+
import { resolvePrisma } from '../../../../../lib/prisma';
|
|
7
7
|
import { isOpenaiAssistantsStorageProvider } from '../../../../../lib/storageProviders/isOpenaiAssistantsStorageProvider';
|
|
8
|
-
export const buildGET = ({ prisma
|
|
8
|
+
export const buildGET = ({ prisma: providedPrisma, purposeAssistantsResponse = () => NextResponse.json({ error: 'No file source found' }, { status: 404 }), } = {}) => async (request, props) => {
|
|
9
9
|
var _a, _b;
|
|
10
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
10
11
|
const params = await props.params;
|
|
11
12
|
const { fileId } = params;
|
|
12
13
|
const assistantId = request.nextUrl.searchParams.get('assistantId');
|
|
@@ -77,7 +78,7 @@ export const buildGET = ({ prisma = defaultPrisma, purposeAssistantsResponse = (
|
|
|
77
78
|
headers: Object.assign(Object.assign({}, cacheHeaders), { 'Content-Type': (_a = fileContentResponse.headers.get('Content-Type')) !== null && _a !== void 0 ? _a : 'application/octet-stream', 'Content-Disposition': (_b = fileContentResponse.headers.get('Content-Disposition')) !== null && _b !== void 0 ? _b : 'inline' }),
|
|
78
79
|
});
|
|
79
80
|
};
|
|
80
|
-
export const GET = buildGET({});
|
|
81
|
+
export const GET = ((...args) => buildGET({})(...args));
|
|
81
82
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
82
83
|
headers: cacheHeaders,
|
|
83
84
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type OpenAI from 'openai';
|
|
2
2
|
import { type PrismaClient } from '@prisma/client';
|
|
3
3
|
import { type NextRequest, NextResponse } from 'next/server';
|
|
4
|
-
export declare const buildPOST: ({ prisma }?: {
|
|
4
|
+
export declare const buildPOST: ({ prisma: providedPrisma }?: {
|
|
5
5
|
prisma?: PrismaClient;
|
|
6
6
|
}) => (request: NextRequest) => Promise<NextResponse<{
|
|
7
7
|
error: string;
|
|
@@ -10,12 +10,6 @@ export declare const buildPOST: ({ prisma }?: {
|
|
|
10
10
|
_request_id?: string | null;
|
|
11
11
|
};
|
|
12
12
|
}>>;
|
|
13
|
-
export declare const POST:
|
|
14
|
-
error: string;
|
|
15
|
-
}> | NextResponse<{
|
|
16
|
-
file: OpenAI.Files.FileObject & {
|
|
17
|
-
_request_id?: string | null;
|
|
18
|
-
};
|
|
19
|
-
}>>;
|
|
13
|
+
export declare const POST: ReturnType<typeof buildPOST>;
|
|
20
14
|
export declare const OPTIONS: () => NextResponse<{}>;
|
|
21
15
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/app/api/files/route.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACvE,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO5D,eAAO,MAAM,SAAS,GACnB,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/app/api/files/route.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACvE,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO5D,eAAO,MAAM,SAAS,GACnB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MACpD,SAAS,WAAW;;;;;;GA+G1B,CAAA;AAEH,eAAO,MAAM,IAAI,EACU,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
|
|
@@ -4,10 +4,11 @@ import { NextResponse } from 'next/server';
|
|
|
4
4
|
import { cacheHeaders } from '../../../lib/cache/cacheHeaders';
|
|
5
5
|
import { assistantClientAdapter } from '../../../lib/assistants/assistantClientAdapter';
|
|
6
6
|
import { workspaceAccessWhere as getWorkspaceAccessWhere } from '../../../lib/apiKeys/workspaceAccessWhere';
|
|
7
|
-
import {
|
|
7
|
+
import { resolvePrisma } from '../../../lib/prisma';
|
|
8
8
|
import { isOpenaiAssistantsStorageProvider } from '../../../lib/storageProviders/isOpenaiAssistantsStorageProvider';
|
|
9
|
-
export const buildPOST = ({ prisma
|
|
9
|
+
export const buildPOST = ({ prisma: providedPrisma } = {}) => async (request) => {
|
|
10
10
|
var _a;
|
|
11
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
11
12
|
const formData = await request.formData();
|
|
12
13
|
const assistantId = formData.get('assistantId');
|
|
13
14
|
if (!isString(assistantId)) {
|
|
@@ -84,7 +85,7 @@ export const buildPOST = ({ prisma = defaultPrisma } = {}) => async (request) =>
|
|
|
84
85
|
file: createFileResponse,
|
|
85
86
|
}, { headers: cacheHeaders });
|
|
86
87
|
};
|
|
87
|
-
export const POST = buildPOST();
|
|
88
|
+
export const POST = ((...args) => buildPOST()(...args));
|
|
88
89
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
89
90
|
headers: cacheHeaders,
|
|
90
91
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialMessagesResponse.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/messages/lib/initialMessagesResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"initialMessagesResponse.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/messages/lib/initialMessagesResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,EACL,MAAM,EAIP,MAAM,gBAAgB,CAAA;AA+BvB,eAAO,MAAM,uBAAuB,GAAU,gBAE3C;IACD,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC;QACpC,OAAO,EAAE;YACP,eAAe,EAAE,IAAI,CAAA;SACtB,CAAA;KACF,CAAC,CAAA;CACH;;;;;;;;;;;;;;;;EA4CA,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
|
-
import { map } from 'p-iteration';
|
|
3
2
|
import { StorageProviderType, MessageRole, } from '@prisma/client';
|
|
4
3
|
import { optimisticId, serializeMessage } from '@superinterface/react/utils';
|
|
5
4
|
import { isOpenaiAssistantsStorageProvider } from '../../../../lib/storageProviders/isOpenaiAssistantsStorageProvider';
|
|
@@ -24,7 +23,7 @@ export const initialMessagesResponse = async ({ assistant, }) => {
|
|
|
24
23
|
const threadId = optimisticId();
|
|
25
24
|
const initialCreatedAt = dayjs().unix();
|
|
26
25
|
return {
|
|
27
|
-
data: await
|
|
26
|
+
data: await Promise.all(assistant.initialMessages.map((message, index) => serializeMessage({
|
|
28
27
|
message: {
|
|
29
28
|
id: optimisticId(),
|
|
30
29
|
role: message.role.toLowerCase(),
|
|
@@ -52,7 +51,7 @@ export const initialMessagesResponse = async ({ assistant, }) => {
|
|
|
52
51
|
status: 'completed',
|
|
53
52
|
runSteps: [],
|
|
54
53
|
},
|
|
55
|
-
})),
|
|
54
|
+
}))),
|
|
56
55
|
hasNextPage: false,
|
|
57
56
|
lastId: null,
|
|
58
57
|
};
|
|
@@ -3,7 +3,7 @@ import OpenAI from 'openai';
|
|
|
3
3
|
import { type PrismaClient } from '@prisma/client';
|
|
4
4
|
import type { Thread } from '@prisma/client';
|
|
5
5
|
export declare const maxDuration = 800;
|
|
6
|
-
export declare const buildGET: ({ prisma }?: {
|
|
6
|
+
export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
7
7
|
prisma?: PrismaClient;
|
|
8
8
|
}) => (request: NextRequest) => Promise<NextResponse<{
|
|
9
9
|
error: string;
|
|
@@ -24,31 +24,13 @@ export declare const buildGET: ({ prisma }?: {
|
|
|
24
24
|
hasNextPage: boolean;
|
|
25
25
|
lastId: null;
|
|
26
26
|
}> | NextResponse<import("@superinterface/react/types/index").MessagesPage>>;
|
|
27
|
-
export declare const GET:
|
|
28
|
-
|
|
29
|
-
}> | NextResponse<{
|
|
30
|
-
data: {
|
|
31
|
-
id: string;
|
|
32
|
-
role: "user" | "assistant";
|
|
33
|
-
created_at: number;
|
|
34
|
-
content: OpenAI.Beta.Threads.Messages.MessageContent[];
|
|
35
|
-
run_id: string;
|
|
36
|
-
assistant_id: string;
|
|
37
|
-
thread_id: string;
|
|
38
|
-
attachments: OpenAI.Beta.Threads.Messages.Message.Attachment[];
|
|
39
|
-
metadata: import("openai/resources/shared.mjs").Metadata;
|
|
40
|
-
runSteps: Pick<OpenAI.Beta.Threads.Runs.Steps.RunStep, "id" | "run_id" | "step_details" | "completed_at" | "cancelled_at" | "failed_at" | "status">[];
|
|
41
|
-
status: "in_progress" | "incomplete" | "completed";
|
|
42
|
-
}[];
|
|
43
|
-
hasNextPage: boolean;
|
|
44
|
-
lastId: null;
|
|
45
|
-
}> | NextResponse<import("@superinterface/react/types/index").MessagesPage>>;
|
|
46
|
-
export declare const buildPOST: ({ prisma, onSuccessCreateThread, }?: {
|
|
27
|
+
export declare const GET: ReturnType<typeof buildGET>;
|
|
28
|
+
export declare const buildPOST: ({ prisma: providedPrisma, onSuccessCreateThread, }?: {
|
|
47
29
|
prisma?: PrismaClient;
|
|
48
30
|
onSuccessCreateThread?: ({ thread, }: {
|
|
49
31
|
thread: Thread;
|
|
50
32
|
}) => void | Promise<void>;
|
|
51
33
|
}) => (request: NextRequest) => Promise<Response>;
|
|
52
|
-
export declare const POST:
|
|
34
|
+
export declare const POST: ReturnType<typeof buildPOST>;
|
|
53
35
|
export declare const OPTIONS: () => NextResponse<{}>;
|
|
54
36
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/app/api/messages/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AA2B5C,eAAO,MAAM,WAAW,MAAM,CAAA;AAE9B,eAAO,MAAM,QAAQ,GAClB,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/app/api/messages/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AA2B5C,eAAO,MAAM,WAAW,MAAM,CAAA;AAE9B,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MACpD,SAAS,WAAW;;;;;;;;;;;;;;;;;;4EA4K1B,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,SAAS,GACnB,qDAGE;IACD,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,qBAAqB,CAAC,EAAE,CAAC,EACvB,MAAM,GACP,EAAE;QACD,MAAM,EAAE,MAAM,CAAA;KACf,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB,MACC,SAAS,WAAW,sBAggB1B,CAAA;AAEH,eAAO,MAAM,IAAI,EACY,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAEzD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
|
|
@@ -24,7 +24,7 @@ import { createRunOpts } from '../../../lib/runs/createRunOpts';
|
|
|
24
24
|
import { handleToolCall } from '../../../lib/toolCalls/handleToolCall';
|
|
25
25
|
import { createThread } from '../../../lib/threads/createThread';
|
|
26
26
|
import { managedOpenaiThreadId } from '../../../lib/threads/managedOpenaiThreadId';
|
|
27
|
-
import {
|
|
27
|
+
import { resolvePrisma } from '../../../lib/prisma';
|
|
28
28
|
import { createLog } from '../../../lib/logs/createLog';
|
|
29
29
|
import { serializeThread } from './lib/serializeThread';
|
|
30
30
|
import { getWorkspaceId } from './lib/getWorkspaceId';
|
|
@@ -34,8 +34,9 @@ import { serializeMetadata } from '../../../lib/metadata/serializeMetadata';
|
|
|
34
34
|
import { isResponsesStorageProvider } from '../../../lib/storageProviders/isResponsesStorageProvider';
|
|
35
35
|
import { serializeError } from '../../../lib/errors/serializeError';
|
|
36
36
|
export const maxDuration = 800;
|
|
37
|
-
export const buildGET = ({ prisma
|
|
37
|
+
export const buildGET = ({ prisma: providedPrisma } = {}) => async (request) => {
|
|
38
38
|
var _a;
|
|
39
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
39
40
|
const paramsResult = z
|
|
40
41
|
.object({
|
|
41
42
|
publicApiKey: z.string().optional(),
|
|
@@ -179,9 +180,10 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (request) =>
|
|
|
179
180
|
return NextResponse.json({ error: 'Failed to load messages.' }, { status: 500 });
|
|
180
181
|
}
|
|
181
182
|
};
|
|
182
|
-
export const GET = buildGET();
|
|
183
|
-
export const buildPOST = ({ prisma
|
|
183
|
+
export const GET = ((...args) => buildGET()(...args));
|
|
184
|
+
export const buildPOST = ({ prisma: providedPrisma, onSuccessCreateThread = () => void 0, } = {}) => async (request) => {
|
|
184
185
|
var _a;
|
|
186
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
185
187
|
const bodyResult = z
|
|
186
188
|
.object({
|
|
187
189
|
audioContent: z.any().optional(),
|
|
@@ -604,7 +606,7 @@ export const buildPOST = ({ prisma = defaultPrisma, onSuccessCreateThread = () =
|
|
|
604
606
|
},
|
|
605
607
|
});
|
|
606
608
|
};
|
|
607
|
-
export const POST = buildPOST({});
|
|
609
|
+
export const POST = ((...args) => buildPOST({})(...args));
|
|
608
610
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
609
611
|
headers: cacheHeaders,
|
|
610
612
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PrismaClient } from '@prisma/client';
|
|
2
2
|
import { NextResponse, type NextRequest } from 'next/server';
|
|
3
|
-
export declare const buildGET: ({ prisma }?: {
|
|
3
|
+
export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
4
4
|
prisma?: PrismaClient;
|
|
5
5
|
}) => (_request: NextRequest, props: {
|
|
6
6
|
params: Promise<{
|
|
@@ -18,21 +18,6 @@ export declare const buildGET: ({ prisma }?: {
|
|
|
18
18
|
tools: import("openai/resources/beta/assistants.mjs").AssistantTool[];
|
|
19
19
|
}[];
|
|
20
20
|
}>>;
|
|
21
|
-
export declare const GET:
|
|
22
|
-
params: Promise<{
|
|
23
|
-
modelProviderId: string;
|
|
24
|
-
}>;
|
|
25
|
-
}) => Promise<NextResponse<{
|
|
26
|
-
error: string;
|
|
27
|
-
}> | NextResponse<{
|
|
28
|
-
storageProviderAssistants: {
|
|
29
|
-
id: string;
|
|
30
|
-
model: string;
|
|
31
|
-
name: string | null;
|
|
32
|
-
description: string | null;
|
|
33
|
-
instructions: string | null;
|
|
34
|
-
tools: import("openai/resources/beta/assistants.mjs").AssistantTool[];
|
|
35
|
-
}[];
|
|
36
|
-
}>>;
|
|
21
|
+
export declare const GET: ReturnType<typeof buildGET>;
|
|
37
22
|
export declare const OPTIONS: () => NextResponse<{}>;
|
|
38
23
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/providers/[modelProviderId]/assistants/route.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAO5D,eAAO,MAAM,QAAQ,GAClB,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/providers/[modelProviderId]/assistants/route.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAO5D,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC7C;;;;;;;;;;;GAkDF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
|
|
@@ -2,11 +2,12 @@ import { headers } from 'next/headers';
|
|
|
2
2
|
import { ApiKeyType } from '@prisma/client';
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
4
|
import { cacheHeaders } from '../../../../../lib/cache/cacheHeaders';
|
|
5
|
-
import {
|
|
5
|
+
import { resolvePrisma } from '../../../../../lib/prisma';
|
|
6
6
|
import { getApiKey } from '../../../../../lib/apiKeys/getApiKey';
|
|
7
7
|
import { getStorageProviderAssistants } from '../../../../../lib/storageProviders/getStorageProviderAssistants';
|
|
8
8
|
import { serializeApiStorageProviderAssistant } from '../../../../../lib/storageProviders/serializeApiStorageProviderAssistant';
|
|
9
|
-
export const buildGET = ({ prisma
|
|
9
|
+
export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
10
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
10
11
|
const { modelProviderId } = await props.params;
|
|
11
12
|
const headersList = await headers();
|
|
12
13
|
const authorization = headersList.get('authorization');
|
|
@@ -39,7 +40,7 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
|
|
|
39
40
|
})),
|
|
40
41
|
}, { headers: cacheHeaders });
|
|
41
42
|
};
|
|
42
|
-
export const GET = buildGET();
|
|
43
|
+
export const GET = ((...args) => buildGET()(...args));
|
|
43
44
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
44
45
|
headers: cacheHeaders,
|
|
45
46
|
});
|