@superinterface/server 1.0.25 → 1.0.26
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/api-keys/[apiKeyId]/route.js +1 -1
- package/.next/server/app/api/api-keys/[apiKeyId]/route.js.nft.json +1 -1
- package/.next/server/app/api/api-keys/route.js +1 -1
- package/.next/server/app/api/api-keys/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/functions/[functionId]/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/functions/[functionId]/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/functions/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/functions/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/initial-messages/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/initial-messages/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/mcp-servers/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/mcp-servers/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/route.js +1 -1
- package/.next/server/app/api/assistants/route.js.nft.json +1 -1
- 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/providers/[modelProviderId]/route.js +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/route.js +1 -1
- package/.next/server/app/api/providers/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/[taskId]/route.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/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/api/tasks/route.js +1 -1
- package/.next/server/app/api/tasks/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/api/workspaces/[workspaceId]/route.js +1 -1
- package/.next/server/app/api/workspaces/[workspaceId]/route.js.nft.json +1 -1
- package/.next/server/app/api/workspaces/route.js +1 -1
- package/.next/server/app/api/workspaces/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]__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]__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]__40ab45eb._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__40ab45eb._.js.map +1 -1
- 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]__47b17fad._.js +38 -0
- package/.next/server/chunks/[root-of-the-server]__47b17fad._.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]__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 +1 -1
- package/.next/server/chunks/[root-of-the-server]__676affb1._.js.map +1 -1
- 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 +1 -1
- package/.next/server/chunks/[root-of-the-server]__a878c913._.js.map +1 -1
- 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]__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]__f6f61507._.js +38 -0
- package/.next/server/chunks/[root-of-the-server]__f6f61507._.js.map +1 -0
- 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/functions-config-manifest.json +1 -8
- 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]/buildRoute.d.ts +52 -0
- package/dist/app/api/api-keys/[apiKeyId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/api-keys/[apiKeyId]/buildRoute.js +121 -0
- package/dist/app/api/api-keys/[apiKeyId]/route.d.ts +10 -21
- package/dist/app/api/api-keys/[apiKeyId]/route.d.ts.map +1 -1
- package/dist/app/api/api-keys/[apiKeyId]/route.js +6 -125
- package/dist/app/api/api-keys/buildRoute.d.ts +32 -0
- package/dist/app/api/api-keys/buildRoute.d.ts.map +1 -0
- package/dist/app/api/api-keys/buildRoute.js +104 -0
- package/dist/app/api/api-keys/builders.d.ts +31 -0
- package/dist/app/api/api-keys/builders.d.ts.map +1 -0
- package/dist/app/api/api-keys/builders.js +109 -0
- package/dist/app/api/api-keys/route.d.ts +5 -13
- package/dist/app/api/api-keys/route.d.ts.map +1 -1
- package/dist/app/api/api-keys/route.js +8 -108
- package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts +120 -0
- package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/buildRoute.js +226 -0
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/buildRoute.d.ts +167 -0
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/buildRoute.js +184 -0
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts +10 -21
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.js +6 -191
- package/dist/app/api/assistants/[assistantId]/functions/buildRoute.d.ts +114 -0
- package/dist/app/api/assistants/[assistantId]/functions/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/functions/buildRoute.js +117 -0
- package/dist/app/api/assistants/[assistantId]/functions/route.d.ts +7 -15
- package/dist/app/api/assistants/[assistantId]/functions/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/functions/route.js +5 -122
- package/dist/app/api/assistants/[assistantId]/initial-messages/buildRoute.d.ts +40 -0
- package/dist/app/api/assistants/[assistantId]/initial-messages/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/initial-messages/buildRoute.js +85 -0
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts +7 -15
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.js +5 -90
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/buildRoute.d.ts +89 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/buildRoute.js +167 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.d.ts +10 -21
- 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 +6 -174
- package/dist/app/api/assistants/[assistantId]/mcp-servers/buildRoute.d.ts +62 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/buildRoute.js +115 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts +7 -15
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.js +5 -120
- package/dist/app/api/assistants/[assistantId]/route.d.ts +11 -22
- package/dist/app/api/assistants/[assistantId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/route.js +6 -233
- package/dist/app/api/assistants/buildRoute.d.ts +121 -0
- package/dist/app/api/assistants/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/buildRoute.js +144 -0
- package/dist/app/api/assistants/route.d.ts +7 -13
- package/dist/app/api/assistants/route.d.ts.map +1 -1
- package/dist/app/api/assistants/route.js +6 -148
- package/dist/app/api/files/[fileId]/contents/buildRoute.d.ts +18 -0
- package/dist/app/api/files/[fileId]/contents/buildRoute.d.ts.map +1 -0
- package/dist/app/api/files/[fileId]/contents/buildRoute.js +81 -0
- package/dist/app/api/files/[fileId]/contents/route.d.ts +3 -13
- package/dist/app/api/files/[fileId]/contents/route.d.ts.map +1 -1
- package/dist/app/api/files/[fileId]/contents/route.js +4 -84
- package/dist/app/api/files/buildRoute.d.ts +14 -0
- package/dist/app/api/files/buildRoute.d.ts.map +1 -0
- package/dist/app/api/files/buildRoute.js +88 -0
- package/dist/app/api/files/route.d.ts +4 -10
- package/dist/app/api/files/route.d.ts.map +1 -1
- package/dist/app/api/files/route.js +4 -91
- package/dist/app/api/messages/buildRoute.d.ts +34 -0
- package/dist/app/api/messages/buildRoute.d.ts.map +1 -0
- package/dist/app/api/messages/buildRoute.js +607 -0
- package/dist/app/api/messages/lib/initialMessagesResponse.d.ts.map +1 -1
- package/dist/app/api/messages/lib/initialMessagesResponse.js +1 -1
- package/dist/app/api/messages/route.d.ts +10 -22
- package/dist/app/api/messages/route.d.ts.map +1 -1
- package/dist/app/api/messages/route.js +6 -612
- package/dist/app/api/providers/[modelProviderId]/assistants/buildRoute.d.ts +24 -0
- package/dist/app/api/providers/[modelProviderId]/assistants/buildRoute.d.ts.map +1 -0
- package/dist/app/api/providers/[modelProviderId]/assistants/buildRoute.js +43 -0
- package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts +4 -9
- package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/assistants/route.js +4 -46
- package/dist/app/api/providers/[modelProviderId]/buildRoute.d.ts +61 -0
- package/dist/app/api/providers/[modelProviderId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/providers/[modelProviderId]/buildRoute.js +134 -0
- package/dist/app/api/providers/[modelProviderId]/models/buildRoute.d.ts +19 -0
- package/dist/app/api/providers/[modelProviderId]/models/buildRoute.d.ts.map +1 -0
- package/dist/app/api/providers/[modelProviderId]/models/buildRoute.js +43 -0
- package/dist/app/api/providers/[modelProviderId]/models/route.d.ts +4 -9
- package/dist/app/api/providers/[modelProviderId]/models/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/models/route.js +4 -46
- package/dist/app/api/providers/[modelProviderId]/route.d.ts +10 -21
- package/dist/app/api/providers/[modelProviderId]/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/route.js +6 -141
- package/dist/app/api/providers/buildRoute.d.ts +38 -0
- package/dist/app/api/providers/buildRoute.d.ts.map +1 -0
- package/dist/app/api/providers/buildRoute.js +75 -0
- package/dist/app/api/providers/route.d.ts +5 -13
- package/dist/app/api/providers/route.d.ts.map +1 -1
- package/dist/app/api/providers/route.js +5 -80
- package/dist/app/api/tasks/[taskId]/buildRoute.d.ts +19 -0
- package/dist/app/api/tasks/[taskId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/tasks/[taskId]/buildRoute.js +125 -0
- package/dist/app/api/tasks/[taskId]/route.d.ts +7 -57
- package/dist/app/api/tasks/[taskId]/route.d.ts.map +1 -1
- package/dist/app/api/tasks/[taskId]/route.js +6 -144
- package/dist/app/api/tasks/buildRoute.d.ts +36 -0
- package/dist/app/api/tasks/buildRoute.d.ts.map +1 -0
- package/dist/app/api/tasks/buildRoute.js +85 -0
- package/dist/app/api/tasks/callback/buildRoute.d.ts +6 -0
- package/dist/app/api/tasks/callback/buildRoute.d.ts.map +1 -0
- package/dist/app/api/tasks/callback/buildRoute.js +244 -0
- package/dist/app/api/tasks/callback/route.d.ts +2 -1
- package/dist/app/api/tasks/callback/route.d.ts.map +1 -1
- package/dist/app/api/tasks/callback/route.js +4 -244
- package/dist/app/api/tasks/route.d.ts +5 -13
- package/dist/app/api/tasks/route.d.ts.map +1 -1
- package/dist/app/api/tasks/route.js +5 -90
- package/dist/app/api/threads/runs/submit-client-tool-outputs/buildRoute.d.ts +10 -0
- package/dist/app/api/threads/runs/submit-client-tool-outputs/buildRoute.d.ts.map +1 -0
- package/dist/app/api/threads/runs/submit-client-tool-outputs/buildRoute.js +36 -0
- package/dist/app/api/threads/runs/submit-client-tool-outputs/route.d.ts +2 -7
- 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 +3 -37
- package/dist/app/api/workspaces/[workspaceId]/buildRoute.d.ts +16 -0
- package/dist/app/api/workspaces/[workspaceId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/workspaces/[workspaceId]/buildRoute.js +89 -0
- package/dist/app/api/workspaces/[workspaceId]/route.d.ts +5 -31
- package/dist/app/api/workspaces/[workspaceId]/route.d.ts.map +1 -1
- package/dist/app/api/workspaces/[workspaceId]/route.js +5 -89
- package/dist/app/api/workspaces/buildRoute.d.ts +42 -0
- package/dist/app/api/workspaces/buildRoute.d.ts.map +1 -0
- package/dist/app/api/workspaces/buildRoute.js +78 -0
- package/dist/app/api/workspaces/route.d.ts +7 -27
- package/dist/app/api/workspaces/route.d.ts.map +1 -1
- package/dist/app/api/workspaces/route.js +6 -82
- package/dist/lib/functions/functionSchema.d.ts +56 -56
- package/dist/lib/functions/handleFunction/getFunction.d.ts +4 -4
- package/dist/lib/mcpServers/mcpServerSchema.d.ts +20 -20
- package/dist/lib/prisma/index.d.ts +2 -5
- package/dist/lib/prisma/index.d.ts.map +1 -1
- package/dist/lib/prisma/index.js +6 -78
- package/package.json +4 -12
- package/.next/server/chunks/[root-of-the-server]__228bff78._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__228bff78._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__3307123c._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__3307123c._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__e7819e95._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__e7819e95._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__ff90af03._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__ff90af03._.js.map +0 -1
- /package/.next/static/{jt8inwg6nWaLQZ4qpiSJ- → KhKDqyqUf75vkMRrXaWJf}/_buildManifest.js +0 -0
- /package/.next/static/{jt8inwg6nWaLQZ4qpiSJ- → KhKDqyqUf75vkMRrXaWJf}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{jt8inwg6nWaLQZ4qpiSJ- → KhKDqyqUf75vkMRrXaWJf}/_ssgManifest.js +0 -0
|
@@ -1,120 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { getApiKey } from '../../../../../lib/apiKeys/getApiKey';
|
|
7
|
-
import { serializeApiMcpServer } from '../../../../../lib/mcpServers/serializeApiMcpServer';
|
|
8
|
-
import { mcpServerSchema } from '../../../../../lib/mcpServers/mcpServerSchema';
|
|
9
|
-
export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
10
|
-
const prisma = resolvePrisma(providedPrisma);
|
|
11
|
-
const { assistantId } = await props.params;
|
|
12
|
-
const headersList = await headers();
|
|
13
|
-
const authorization = headersList.get('authorization');
|
|
14
|
-
if (!authorization) {
|
|
15
|
-
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
16
|
-
}
|
|
17
|
-
const privateApiKey = await getApiKey({
|
|
18
|
-
type: ApiKeyType.PRIVATE,
|
|
19
|
-
authorization,
|
|
20
|
-
prisma,
|
|
21
|
-
});
|
|
22
|
-
if (!privateApiKey) {
|
|
23
|
-
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
24
|
-
}
|
|
25
|
-
const assistant = await prisma.assistant.findFirst({
|
|
26
|
-
where: {
|
|
27
|
-
id: assistantId,
|
|
28
|
-
workspaceId: privateApiKey.workspaceId,
|
|
29
|
-
},
|
|
30
|
-
include: {
|
|
31
|
-
mcpServers: {
|
|
32
|
-
include: {
|
|
33
|
-
stdioTransport: true,
|
|
34
|
-
sseTransport: true,
|
|
35
|
-
httpTransport: true,
|
|
36
|
-
},
|
|
37
|
-
orderBy: {
|
|
38
|
-
createdAt: 'desc',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
if (!assistant) {
|
|
44
|
-
return NextResponse.json({ error: 'No assistant found' }, { status: 400 });
|
|
45
|
-
}
|
|
46
|
-
return NextResponse.json({
|
|
47
|
-
mcpServers: assistant.mcpServers.map((mcpServer) => serializeApiMcpServer({
|
|
48
|
-
mcpServer,
|
|
49
|
-
})),
|
|
50
|
-
}, { headers: cacheHeaders });
|
|
51
|
-
};
|
|
52
|
-
export const GET = ((...args) => buildGET()(...args));
|
|
53
|
-
export const buildPOST = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
54
|
-
const prisma = resolvePrisma(providedPrisma);
|
|
55
|
-
const { assistantId } = await props.params;
|
|
56
|
-
const headersList = await headers();
|
|
57
|
-
const authorization = headersList.get('authorization');
|
|
58
|
-
if (!authorization) {
|
|
59
|
-
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
60
|
-
}
|
|
61
|
-
const privateApiKey = await getApiKey({
|
|
62
|
-
authorization,
|
|
63
|
-
type: ApiKeyType.PRIVATE,
|
|
64
|
-
prisma,
|
|
65
|
-
});
|
|
66
|
-
if (!privateApiKey) {
|
|
67
|
-
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
68
|
-
}
|
|
69
|
-
const body = await request.json();
|
|
70
|
-
const parsed = mcpServerSchema.safeParse(body);
|
|
71
|
-
if (!parsed.success) {
|
|
72
|
-
return NextResponse.json({ error: 'Invalid payload' }, { status: 400 });
|
|
73
|
-
}
|
|
74
|
-
const { transportType, sseTransport, httpTransport } = parsed.data;
|
|
75
|
-
const workspaceId = privateApiKey.workspaceId;
|
|
76
|
-
const assistant = await prisma.assistant.findFirst({
|
|
77
|
-
where: { id: assistantId, workspaceId },
|
|
78
|
-
});
|
|
79
|
-
if (!assistant) {
|
|
80
|
-
return NextResponse.json({ error: 'No assistant found' }, { status: 400 });
|
|
81
|
-
}
|
|
82
|
-
const mcpServer = await prisma.mcpServer.create({
|
|
83
|
-
data: Object.assign(Object.assign(Object.assign({ transportType }, (transportType === TransportType.SSE
|
|
84
|
-
? {
|
|
85
|
-
sseTransport: {
|
|
86
|
-
create: {
|
|
87
|
-
url: sseTransport.url,
|
|
88
|
-
headers: JSON.parse(sseTransport.headers),
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
}
|
|
92
|
-
: {})), (transportType === TransportType.HTTP
|
|
93
|
-
? {
|
|
94
|
-
httpTransport: {
|
|
95
|
-
create: {
|
|
96
|
-
url: httpTransport.url,
|
|
97
|
-
headers: JSON.parse(httpTransport.headers),
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
}
|
|
101
|
-
: {})), { assistant: {
|
|
102
|
-
connect: {
|
|
103
|
-
id: assistantId,
|
|
104
|
-
workspaceId,
|
|
105
|
-
},
|
|
106
|
-
} }),
|
|
107
|
-
include: {
|
|
108
|
-
stdioTransport: true,
|
|
109
|
-
sseTransport: true,
|
|
110
|
-
httpTransport: true,
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
return NextResponse.json({
|
|
114
|
-
mcpServer: serializeApiMcpServer({ mcpServer }),
|
|
115
|
-
}, { headers: cacheHeaders });
|
|
116
|
-
};
|
|
117
|
-
export const POST = ((...args) => buildPOST()(...args));
|
|
118
|
-
export const OPTIONS = () => NextResponse.json({}, {
|
|
119
|
-
headers: cacheHeaders,
|
|
120
|
-
});
|
|
1
|
+
import { prisma } from '../../../../../lib/prisma';
|
|
2
|
+
import { buildGET, buildOPTIONS, buildPOST, } from './buildRoute';
|
|
3
|
+
export const GET = buildGET({ prisma });
|
|
4
|
+
export const POST = buildPOST({ prisma });
|
|
5
|
+
export const OPTIONS = buildOPTIONS();
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { type PrismaClient } from '@prisma/client';
|
|
3
|
-
export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
4
|
-
prisma?: PrismaClient;
|
|
5
|
-
}) => (request: NextRequest, props: {
|
|
1
|
+
export declare const GET: (request: import("next/server").NextRequest, props: {
|
|
6
2
|
params: Promise<{
|
|
7
3
|
assistantId: string;
|
|
8
4
|
}>;
|
|
9
|
-
}) => Promise<NextResponse<{
|
|
5
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
10
6
|
error: string;
|
|
11
|
-
}> | NextResponse<{
|
|
7
|
+
}> | import("next/server").NextResponse<{
|
|
12
8
|
assistant: {
|
|
13
9
|
id: string;
|
|
14
10
|
storageProviderType: import("@prisma/client").$Enums.StorageProviderType;
|
|
@@ -32,7 +28,7 @@ export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
|
32
28
|
} | null;
|
|
33
29
|
};
|
|
34
30
|
};
|
|
35
|
-
}> | NextResponse<{
|
|
31
|
+
}> | import("next/server").NextResponse<{
|
|
36
32
|
assistant: {
|
|
37
33
|
id: string;
|
|
38
34
|
name: string;
|
|
@@ -56,16 +52,13 @@ export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
|
56
52
|
};
|
|
57
53
|
};
|
|
58
54
|
}>>;
|
|
59
|
-
export declare const
|
|
60
|
-
export declare const buildPATCH: ({ prisma: providedPrisma }?: {
|
|
61
|
-
prisma?: PrismaClient;
|
|
62
|
-
}) => (request: NextRequest, props: {
|
|
55
|
+
export declare const PATCH: (request: import("next/server").NextRequest, props: {
|
|
63
56
|
params: Promise<{
|
|
64
57
|
assistantId: string;
|
|
65
58
|
}>;
|
|
66
|
-
}) => Promise<NextResponse<{
|
|
59
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
67
60
|
error: string;
|
|
68
|
-
}> | NextResponse<{
|
|
61
|
+
}> | import("next/server").NextResponse<{
|
|
69
62
|
assistant: {
|
|
70
63
|
id: string;
|
|
71
64
|
storageProviderType: import("@prisma/client").$Enums.StorageProviderType;
|
|
@@ -90,16 +83,13 @@ export declare const buildPATCH: ({ prisma: providedPrisma }?: {
|
|
|
90
83
|
};
|
|
91
84
|
};
|
|
92
85
|
}>>;
|
|
93
|
-
export declare const
|
|
94
|
-
export declare const buildDELETE: ({ prisma: providedPrisma }?: {
|
|
95
|
-
prisma?: PrismaClient;
|
|
96
|
-
}) => (request: NextRequest, props: {
|
|
86
|
+
export declare const DELETE: (_request: import("next/server").NextRequest, props: {
|
|
97
87
|
params: Promise<{
|
|
98
88
|
assistantId: string;
|
|
99
89
|
}>;
|
|
100
|
-
}) => Promise<NextResponse<{
|
|
90
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
101
91
|
error: string;
|
|
102
|
-
}> | NextResponse<{
|
|
92
|
+
}> | import("next/server").NextResponse<{
|
|
103
93
|
assistant: {
|
|
104
94
|
id: string;
|
|
105
95
|
storageProviderType: import("@prisma/client").$Enums.StorageProviderType;
|
|
@@ -124,6 +114,5 @@ export declare const buildDELETE: ({ prisma: providedPrisma }?: {
|
|
|
124
114
|
};
|
|
125
115
|
};
|
|
126
116
|
}>>;
|
|
127
|
-
export declare const
|
|
128
|
-
export declare const OPTIONS: () => NextResponse<{}>;
|
|
117
|
+
export declare const OPTIONS: () => import("next/server").NextResponse<{}>;
|
|
129
118
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/assistants/[assistantId]/route.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuB,CAAA;AAEvC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyB,CAAA;AAE3C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0B,CAAA;AAE7C,eAAO,MAAM,OAAO,8CAAiB,CAAA"}
|
|
@@ -1,233 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { serializeApiAssistant } from '../../../../lib/assistants/serializeApiAssistant';
|
|
8
|
-
import { headers } from 'next/headers';
|
|
9
|
-
import { z } from 'zod';
|
|
10
|
-
import { getApiKey } from '../../../../lib/apiKeys/getApiKey';
|
|
11
|
-
export const buildGET = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
12
|
-
const prisma = resolvePrisma(providedPrisma);
|
|
13
|
-
const params = await props.params;
|
|
14
|
-
const { assistantId } = params;
|
|
15
|
-
const headersList = await headers();
|
|
16
|
-
const authorization = headersList.get('authorization');
|
|
17
|
-
if (authorization) {
|
|
18
|
-
const privateApiKey = await getApiKey({
|
|
19
|
-
authorization,
|
|
20
|
-
type: ApiKeyType.PRIVATE,
|
|
21
|
-
prisma,
|
|
22
|
-
});
|
|
23
|
-
if (!privateApiKey) {
|
|
24
|
-
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
25
|
-
}
|
|
26
|
-
const assistant = await prisma.assistant.findUnique({
|
|
27
|
-
where: {
|
|
28
|
-
id: assistantId,
|
|
29
|
-
workspaceId: privateApiKey.workspaceId,
|
|
30
|
-
},
|
|
31
|
-
include: {
|
|
32
|
-
tools: true,
|
|
33
|
-
avatar: {
|
|
34
|
-
include: {
|
|
35
|
-
imageAvatar: true,
|
|
36
|
-
iconAvatar: true,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
if (!assistant) {
|
|
42
|
-
return NextResponse.json({ error: 'No assistant found' }, { status: 400 });
|
|
43
|
-
}
|
|
44
|
-
return NextResponse.json({
|
|
45
|
-
assistant: serializeApiAssistant({ assistant }),
|
|
46
|
-
}, { headers: cacheHeaders });
|
|
47
|
-
}
|
|
48
|
-
const workspaceAccessWhere = await getWorkspaceAccessWhere({
|
|
49
|
-
publicApiKey: request.nextUrl.searchParams.get('publicApiKey'),
|
|
50
|
-
prisma,
|
|
51
|
-
});
|
|
52
|
-
if (!workspaceAccessWhere) {
|
|
53
|
-
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
54
|
-
}
|
|
55
|
-
if (!assistantId) {
|
|
56
|
-
return NextResponse.json({ error: 'No assistant id found' }, { status: 400 });
|
|
57
|
-
}
|
|
58
|
-
const assistant = await prisma.assistant.findFirst({
|
|
59
|
-
where: {
|
|
60
|
-
id: assistantId,
|
|
61
|
-
workspace: workspaceAccessWhere,
|
|
62
|
-
},
|
|
63
|
-
include: {
|
|
64
|
-
avatar: {
|
|
65
|
-
include: {
|
|
66
|
-
imageAvatar: true,
|
|
67
|
-
iconAvatar: true,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
if (!assistant) {
|
|
73
|
-
return NextResponse.json({ error: 'No assistant found' }, { status: 400 });
|
|
74
|
-
}
|
|
75
|
-
return NextResponse.json({
|
|
76
|
-
assistant: serializeAssistant({ assistant }),
|
|
77
|
-
}, { headers: cacheHeaders });
|
|
78
|
-
};
|
|
79
|
-
export const GET = ((...args) => buildGET()(...args));
|
|
80
|
-
export const buildPATCH = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
81
|
-
const prisma = resolvePrisma(providedPrisma);
|
|
82
|
-
const params = await props.params;
|
|
83
|
-
const { assistantId } = params;
|
|
84
|
-
const headersList = await headers();
|
|
85
|
-
const authorization = headersList.get('authorization');
|
|
86
|
-
if (!authorization) {
|
|
87
|
-
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
88
|
-
}
|
|
89
|
-
const privateApiKey = await getApiKey({
|
|
90
|
-
authorization,
|
|
91
|
-
type: ApiKeyType.PRIVATE,
|
|
92
|
-
prisma,
|
|
93
|
-
});
|
|
94
|
-
if (!privateApiKey) {
|
|
95
|
-
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
96
|
-
}
|
|
97
|
-
const updateSchema = z
|
|
98
|
-
.object({
|
|
99
|
-
storageProviderType: z.nativeEnum(StorageProviderType).optional(),
|
|
100
|
-
storageProviderAssistantId: z.string().nullable().optional(),
|
|
101
|
-
modelProviderId: z.string().optional(),
|
|
102
|
-
model: z.string().optional(),
|
|
103
|
-
name: z.string().optional(),
|
|
104
|
-
description: z.string().optional(),
|
|
105
|
-
instructions: z.string().optional(),
|
|
106
|
-
codeInterpreterEnabled: z.boolean().optional(),
|
|
107
|
-
fileSearchEnabled: z.boolean().optional(),
|
|
108
|
-
})
|
|
109
|
-
.superRefine((data, ctx) => {
|
|
110
|
-
if (!data.storageProviderType)
|
|
111
|
-
return;
|
|
112
|
-
if (data.storageProviderType ===
|
|
113
|
-
StorageProviderType.SUPERINTERFACE_CLOUD &&
|
|
114
|
-
data.storageProviderAssistantId) {
|
|
115
|
-
ctx.addIssue({
|
|
116
|
-
code: z.ZodIssueCode.custom,
|
|
117
|
-
message: 'storageProviderAssistantId should not be provided for SUPERINTERFACE_CLOUD',
|
|
118
|
-
path: ['storageProviderAssistantId'],
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
if (data.storageProviderType !==
|
|
122
|
-
StorageProviderType.SUPERINTERFACE_CLOUD &&
|
|
123
|
-
!data.storageProviderAssistantId) {
|
|
124
|
-
ctx.addIssue({
|
|
125
|
-
code: z.ZodIssueCode.custom,
|
|
126
|
-
message: 'storageProviderAssistantId is required for this storage provider',
|
|
127
|
-
path: ['storageProviderAssistantId'],
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
const parseResult = updateSchema.safeParse(await request.json());
|
|
132
|
-
if (!parseResult.success) {
|
|
133
|
-
return NextResponse.json({
|
|
134
|
-
error: 'Invalid body: ' + parseResult.error.message,
|
|
135
|
-
}, { status: 400 });
|
|
136
|
-
}
|
|
137
|
-
const { storageProviderType, storageProviderAssistantId, modelProviderId, model, name, description, instructions, codeInterpreterEnabled, fileSearchEnabled, } = parseResult.data;
|
|
138
|
-
const data = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (storageProviderType !== undefined && { storageProviderType })), (storageProviderAssistantId !== undefined && {
|
|
139
|
-
openaiAssistantId: storageProviderAssistantId,
|
|
140
|
-
})), (modelProviderId !== undefined && {
|
|
141
|
-
modelProvider: { connect: { id: modelProviderId } },
|
|
142
|
-
})), (model !== undefined && { modelSlug: model })), (name !== undefined && { name })), (description !== undefined && { description })), (instructions !== undefined && { instructions })), { tools: {
|
|
143
|
-
create: [
|
|
144
|
-
...(codeInterpreterEnabled === true
|
|
145
|
-
? [
|
|
146
|
-
{
|
|
147
|
-
type: ToolType.CODE_INTERPRETER,
|
|
148
|
-
codeInterpreterTool: { create: {} },
|
|
149
|
-
},
|
|
150
|
-
]
|
|
151
|
-
: []),
|
|
152
|
-
...(fileSearchEnabled === true
|
|
153
|
-
? [{ type: ToolType.FILE_SEARCH, fileSearchTool: { create: {} } }]
|
|
154
|
-
: []),
|
|
155
|
-
],
|
|
156
|
-
deleteMany: [
|
|
157
|
-
...(codeInterpreterEnabled === false
|
|
158
|
-
? [{ assistantId, type: ToolType.CODE_INTERPRETER }]
|
|
159
|
-
: []),
|
|
160
|
-
...(fileSearchEnabled === false
|
|
161
|
-
? [{ assistantId, type: ToolType.FILE_SEARCH }]
|
|
162
|
-
: []),
|
|
163
|
-
],
|
|
164
|
-
} });
|
|
165
|
-
const assistant = await prisma.assistant.update({
|
|
166
|
-
where: {
|
|
167
|
-
id: assistantId,
|
|
168
|
-
workspaceId: privateApiKey.workspaceId,
|
|
169
|
-
},
|
|
170
|
-
data,
|
|
171
|
-
include: {
|
|
172
|
-
tools: true,
|
|
173
|
-
avatar: {
|
|
174
|
-
include: {
|
|
175
|
-
imageAvatar: true,
|
|
176
|
-
iconAvatar: true,
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
},
|
|
180
|
-
});
|
|
181
|
-
return NextResponse.json({
|
|
182
|
-
assistant: serializeApiAssistant({ assistant }),
|
|
183
|
-
}, { headers: cacheHeaders });
|
|
184
|
-
};
|
|
185
|
-
export const PATCH = ((...args) => buildPATCH()(...args));
|
|
186
|
-
export const buildDELETE = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
187
|
-
const prisma = resolvePrisma(providedPrisma);
|
|
188
|
-
const params = await props.params;
|
|
189
|
-
const { assistantId } = params;
|
|
190
|
-
const headersList = await headers();
|
|
191
|
-
const authorization = headersList.get('authorization');
|
|
192
|
-
if (!authorization) {
|
|
193
|
-
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
194
|
-
}
|
|
195
|
-
const privateApiKey = await getApiKey({
|
|
196
|
-
authorization,
|
|
197
|
-
type: ApiKeyType.PRIVATE,
|
|
198
|
-
prisma,
|
|
199
|
-
});
|
|
200
|
-
if (!privateApiKey) {
|
|
201
|
-
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
202
|
-
}
|
|
203
|
-
const assistant = await prisma.assistant.findFirst({
|
|
204
|
-
where: {
|
|
205
|
-
id: assistantId,
|
|
206
|
-
workspaceId: privateApiKey.workspaceId,
|
|
207
|
-
},
|
|
208
|
-
include: {
|
|
209
|
-
tools: true,
|
|
210
|
-
avatar: {
|
|
211
|
-
include: {
|
|
212
|
-
imageAvatar: true,
|
|
213
|
-
iconAvatar: true,
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
});
|
|
218
|
-
if (!assistant) {
|
|
219
|
-
return NextResponse.json({ error: 'No assistant found' }, { status: 400 });
|
|
220
|
-
}
|
|
221
|
-
await prisma.assistant.delete({
|
|
222
|
-
where: {
|
|
223
|
-
id: assistant.id,
|
|
224
|
-
},
|
|
225
|
-
});
|
|
226
|
-
return NextResponse.json({
|
|
227
|
-
assistant: serializeApiAssistant({ assistant }),
|
|
228
|
-
}, { headers: cacheHeaders });
|
|
229
|
-
};
|
|
230
|
-
export const DELETE = ((...args) => buildDELETE()(...args));
|
|
231
|
-
export const OPTIONS = () => NextResponse.json({}, {
|
|
232
|
-
headers: cacheHeaders,
|
|
233
|
-
});
|
|
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,121 @@
|
|
|
1
|
+
import { type PrismaClient } from '@prisma/client';
|
|
2
|
+
import { NextResponse } from 'next/server';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
declare const createAssistantSchema: z.ZodEffects<z.ZodObject<{
|
|
5
|
+
storageProviderType: z.ZodNativeEnum<{
|
|
6
|
+
OPENAI: "OPENAI";
|
|
7
|
+
AZURE_OPENAI: "AZURE_OPENAI";
|
|
8
|
+
SUPERINTERFACE_CLOUD: "SUPERINTERFACE_CLOUD";
|
|
9
|
+
OPENAI_RESPONSES: "OPENAI_RESPONSES";
|
|
10
|
+
AZURE_OPENAI_RESPONSES: "AZURE_OPENAI_RESPONSES";
|
|
11
|
+
}>;
|
|
12
|
+
storageProviderAssistantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
modelProviderId: z.ZodString;
|
|
14
|
+
model: z.ZodString;
|
|
15
|
+
name: z.ZodOptional<z.ZodString>;
|
|
16
|
+
description: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
17
|
+
instructions: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
18
|
+
codeInterpreterEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
19
|
+
fileSearchEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
model: string;
|
|
22
|
+
instructions: string;
|
|
23
|
+
description: string;
|
|
24
|
+
modelProviderId: string;
|
|
25
|
+
storageProviderType: "OPENAI" | "AZURE_OPENAI" | "SUPERINTERFACE_CLOUD" | "OPENAI_RESPONSES" | "AZURE_OPENAI_RESPONSES";
|
|
26
|
+
codeInterpreterEnabled: boolean;
|
|
27
|
+
fileSearchEnabled: boolean;
|
|
28
|
+
name?: string | undefined;
|
|
29
|
+
storageProviderAssistantId?: string | null | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
model: string;
|
|
32
|
+
modelProviderId: string;
|
|
33
|
+
storageProviderType: "OPENAI" | "AZURE_OPENAI" | "SUPERINTERFACE_CLOUD" | "OPENAI_RESPONSES" | "AZURE_OPENAI_RESPONSES";
|
|
34
|
+
name?: string | undefined;
|
|
35
|
+
instructions?: string | undefined;
|
|
36
|
+
description?: string | undefined;
|
|
37
|
+
storageProviderAssistantId?: string | null | undefined;
|
|
38
|
+
codeInterpreterEnabled?: boolean | undefined;
|
|
39
|
+
fileSearchEnabled?: boolean | undefined;
|
|
40
|
+
}>, {
|
|
41
|
+
model: string;
|
|
42
|
+
instructions: string;
|
|
43
|
+
description: string;
|
|
44
|
+
modelProviderId: string;
|
|
45
|
+
storageProviderType: "OPENAI" | "AZURE_OPENAI" | "SUPERINTERFACE_CLOUD" | "OPENAI_RESPONSES" | "AZURE_OPENAI_RESPONSES";
|
|
46
|
+
codeInterpreterEnabled: boolean;
|
|
47
|
+
fileSearchEnabled: boolean;
|
|
48
|
+
name?: string | undefined;
|
|
49
|
+
storageProviderAssistantId?: string | null | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
model: string;
|
|
52
|
+
modelProviderId: string;
|
|
53
|
+
storageProviderType: "OPENAI" | "AZURE_OPENAI" | "SUPERINTERFACE_CLOUD" | "OPENAI_RESPONSES" | "AZURE_OPENAI_RESPONSES";
|
|
54
|
+
name?: string | undefined;
|
|
55
|
+
instructions?: string | undefined;
|
|
56
|
+
description?: string | undefined;
|
|
57
|
+
storageProviderAssistantId?: string | null | undefined;
|
|
58
|
+
codeInterpreterEnabled?: boolean | undefined;
|
|
59
|
+
fileSearchEnabled?: boolean | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const buildGET: ({ prisma }: {
|
|
62
|
+
prisma: PrismaClient;
|
|
63
|
+
}) => () => Promise<NextResponse<{
|
|
64
|
+
error: string;
|
|
65
|
+
}> | NextResponse<{
|
|
66
|
+
assistants: {
|
|
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
|
+
}>>;
|
|
90
|
+
export declare const buildPOST: ({ prisma }: {
|
|
91
|
+
prisma: PrismaClient;
|
|
92
|
+
}) => (request: Request) => Promise<NextResponse<{
|
|
93
|
+
error: string;
|
|
94
|
+
}> | NextResponse<{
|
|
95
|
+
assistant: {
|
|
96
|
+
id: string;
|
|
97
|
+
storageProviderType: import("@prisma/client").$Enums.StorageProviderType;
|
|
98
|
+
storageProviderAssistantId: string | null;
|
|
99
|
+
modelProviderId: string;
|
|
100
|
+
model: string;
|
|
101
|
+
name: string;
|
|
102
|
+
description: string;
|
|
103
|
+
instructions: string;
|
|
104
|
+
codeInterpreterEnabled: boolean;
|
|
105
|
+
fileSearchEnabled: boolean;
|
|
106
|
+
createdAt: string;
|
|
107
|
+
updatedAt: string;
|
|
108
|
+
avatar: {
|
|
109
|
+
type: import("@prisma/client").$Enums.AvatarType;
|
|
110
|
+
imageAvatar: {
|
|
111
|
+
url: string;
|
|
112
|
+
} | null;
|
|
113
|
+
iconAvatar: {
|
|
114
|
+
name: import("@prisma/client").$Enums.IconAvatarName;
|
|
115
|
+
} | null;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}>>;
|
|
119
|
+
export declare const buildOPTIONS: () => () => NextResponse<{}>;
|
|
120
|
+
export { createAssistantSchema };
|
|
121
|
+
//# sourceMappingURL=buildRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRoute.d.ts","sourceRoot":"","sources":["../../../../src/app/api/assistants/buildRoute.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCvB,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;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGtB,CAAA;AAEH,eAAO,MAAM,YAAY,8BAMtB,CAAA;AAEH,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|