Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat: revert temp bedrock test api (#36669)

Greg Richardson55e5d6b95a58
diff --git a/apps/studio/middleware.ts b/apps/studio/middleware.ts
index 5ba40012d41..339d6116acd 100644
--- a/apps/studio/middleware.ts
+++ b/apps/studio/middleware.ts
@@ -14,7 +14,6 @@ const HOSTED_SUPPORTED_API_URLS = [
'/ai/sql/title',
'/ai/sql/cron',
'/ai/feedback/classify',
- '/ai/temp/bedrock-test',
'/get-ip-address',
'/get-utc-time',
'/edge-functions/test',
diff --git a/apps/studio/package.json b/apps/studio/package.json
index 8c5954cdad8..8a35b6160e0 100644
--- a/apps/studio/package.json
+++ b/apps/studio/package.json
@@ -25,7 +25,6 @@
"build:graphql-types:watch": "pnpm graphql-codegen --config scripts/codegen.ts --watch"
},
"dependencies": {
- "@ai-sdk/amazon-bedrock": "^2.2.10",
"@ai-sdk/openai": "^0.0.72",
"@dagrejs/dagre": "^1.0.4",
"@deno/eszip": "0.83.0",
@@ -61,11 +60,9 @@
"@tanstack/react-query-devtools": "4.35.7",
"@tanstack/react-table": "^8.21.3",
"@uidotdev/usehooks": "^2.4.1",
- "@vercel/functions": "^2.2.2",
"@vitejs/plugin-react": "^4.3.4",
"@zip.js/zip.js": "^2.7.29",
"ai": "^3.4.33",
- "ai-4": "npm:ai@4",
"ai-commands": "workspace:*",
"awesome-debounce-promise": "^2.1.0",
"common": "workspace:*",
diff --git a/apps/studio/pages/api/ai/temp/bedrock-test.ts b/apps/studio/pages/api/ai/temp/bedrock-test.ts
deleted file mode 100644
index 90d5e9fa2df..00000000000
--- a/apps/studio/pages/api/ai/temp/bedrock-test.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import { createAmazonBedrock } from '@ai-sdk/amazon-bedrock'
-import { awsCredentialsProvider } from '@vercel/functions/oidc'
-import { CoreMessage, streamText } from 'ai-4'
-import apiWrapper from 'lib/api/apiWrapper'
-import { NextApiRequest, NextApiResponse } from 'next'
-import { z } from 'zod'
-
-const bedrock = createAmazonBedrock({
- credentialProvider: awsCredentialsProvider({
- roleArn: process.env.AWS_BEDROCK_ROLE_ARN!,
- }),
-})
-
-const messageSchema = z.object({
- role: z.enum(['user', 'assistant']),
- content: z.string(),
-})
-
-const requestBodySchema = z.object({
- messages: z.array(messageSchema),
-})
-
-async function handler(req: NextApiRequest, res: NextApiResponse) {
- const { method } = req
-
- switch (method) {
- case 'POST':
- return handlePost(req, res)
- default:
- res.setHeader('Allow', ['POST'])
- res.status(405).json({ data: null, error: { message: `Method ${method} Not Allowed` } })
- }
-}
-
-async function handlePost(req: NextApiRequest, res: NextApiResponse) {
- const { data, error: parseError } = requestBodySchema.safeParse(req.body)
-
- if (parseError) {
- return res.status(400).json({
- error: 'Invalid request body',
- issues: parseError.issues,
- })
- }
-
- const { messages: clientMessages } = data
-
- const model = bedrock('us.anthropic.claude-sonnet-4-20250514-v1:0')
- const messages: CoreMessage[] = [
- {
- role: 'system',
- content: 'You are a helpful assistant.',
- },
- ...clientMessages,
- ]
-
- const result = streamText({
- model,
- messages,
- onError: ({ error }) => {
- console.error(error)
- },
- })
-
- return result.pipeDataStreamToResponse(res)
-}
-
-const wrapper = (req: NextApiRequest, res: NextApiResponse) =>
- apiWrapper(req, res, handler, { withAuth: false })
-
-export default wrapper
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 9de532ea492..8841ae78d96 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -331,7 +331,7 @@ importers:
'@sentry/nextjs':
specifier: ^9.15.0
'@supabase/supabase-js':
specifier: 'catalog:'
version: 2.49.3
@@ -451,7 +451,7 @@ importers:
nuqs:
specifier: ^1.19.1
openai:
specifier: ^4.20.1
@@ -651,9 +651,6 @@ importers:
apps/studio:
dependencies:
- '@ai-sdk/amazon-bedrock':
- specifier: ^2.2.10
- version: 2.2.10([email protected])
'@ai-sdk/openai':
specifier: ^0.0.72
version: 0.0.72([email protected])
@@ -759,9 +756,6 @@ importers:
'@uidotdev/usehooks':
specifier: ^2.4.1
- '@vercel/functions':
- specifier: ^2.2.2
- version: 2.2.2(@aws-sdk/[email protected])
'@vitejs/plugin-react':
specifier: ^4.3.4
@@ -771,9 +765,6 @@ importers:
ai:
specifier: ^3.4.33
- ai-4:
- specifier: npm:ai@4
ai-commands:
specifier: workspace:*
version: link:../../packages/ai-commands
@@ -1119,7 +1110,7 @@ importers:
version: 2.4.11([email protected])
next-router-mock:
specifier: ^0.9.13
postcss:
specifier: ^8.5.3
version: 8.5.3
@@ -1279,7 +1270,7 @@ importers:
'@tanstack/react-start':
specifier: ^1.114.25
'@types/lodash':
specifier: ^4.17.16
version: 4.17.16
@@ -2275,7 +2266,7 @@ importers:
version: link:../api-types
next-router-mock:
specifier: ^0.9.13
tsx:
specifier: ^4.19.3
version: 4.19.3
@@ -2304,12 +2295,6 @@ packages:
resolution: {integrity: sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ==}
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-icLGO7Q0NinnHIPgT+y1QjHVwH4HwV+brWbvM+FfCG2Afpa89PyKa3Ret91kGjZpBgM/xnj1B7K5eM+rRlsXQA==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.0.0
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-IKsgxIt6KJGkEHyMp975xW5VPmetwhI8g9H6dDmwvemBB41IRQa78YMNttiJqPcgmrZX2QfErOICv1gQvZ1gZg==}
engines: {node: '>=18'}
@@ -2325,20 +2310,10 @@ packages:
zod:
optional: true
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-fqhG+4sCVv8x7nFzYnFo19ryhAa3w096Kmc3hWxMQfW/TubPOmt3A6tYZhl4mUfQWWQMsuSkLrtjlWuXBVSGQA==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.23.8
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-dQkfBDs2lTYpKM8389oopPdQgIU007GQyCbuPPrV+K6MtSII3HBfE0stUIMXUb44L+LK1t6GXPP7wjSzjO6uKg==}
engines: {node: '>=18'}
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-qZMxYJ0qqX/RfnuIaab+zp8UAeJn/ygXXAffR5I4N0n1IrvA6qBsjc8hXLmBiMV2zoXlifkacF7sEFnYnjBcqg==}
- engines: {node: '>=18'}
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-GnwbtjW4/4z7MleLiW+TOZC2M29eCg1tOUpuEiYFMmFNZK8mkrqM0PFZMo6UsYeUYMWqEOOcPOU9OQVJMJh7IQ==}
engines: {node: '>=18'}
@@ -2351,16 +2326,6 @@ packages:
zod:
optional: true
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-jK1IZZ22evPZoQW3vlkZ7wvjYGYF+tRBKXtrcolduIkQ/m/sOAVcVeVDUDvh1T91xCnWCdUGCPZg2avZ90mv3g==}
- engines: {node: '>=18'}
- peerDependencies:
- react: ^18 || ^19 || ^19.0.0-rc
- zod: ^3.23.8
- peerDependenciesMeta:
- zod:
- optional: true
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-96KWTVK+opdFeRubqrgaJXoNiDP89gNxFRWUp0PJOotZW816AbhUf4EnDjBjXTLjXL1n0h8tGSE9sZsRkj9wQQ==}
engines: {node: '>=18'}
@@ -2388,12 +2353,6 @@ packages:
zod:
optional: true
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-3zcwCc8ezzFlwp3ZD15wAPjf2Au4s3vAbKsXQVyhxODHcmu0iyPO2Eua6D/vicq/AUm/BAo60r97O6HU+EI0+w==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.23.8
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-+ofYlnqdc8c4F6tM0IKF0+7NagZRAiqBJpGDJ+6EYhDW8FHLUP/JFBgu32SjxSxC6IKFZxEnl68ZoP/Z38EMlw==}
engines: {node: '>=18'}
@@ -8704,15 +8663,6 @@ packages:
'@usercentrics/[email protected]':
resolution: {integrity: sha512-/cik01TdeiYUV1+EasK83Ip05TDqmowM5tmWGfRDdaOrneSic5BedBdJHKya4pP2vwiYAtzDYVJe4BwPt2M16g==}
- '@vercel/[email protected]':
- resolution: {integrity: sha512-wgtgFwhYAUzS7UOvw44q14FaoRPONEnyoM0JlrjcDkI+kzSu7M8J5Tk5T3Kvv52//8is+HGxVQtaBSiO3G0wbw==}
- engines: {node: '>= 18'}
- peerDependencies:
- '@aws-sdk/credential-provider-web-identity': '*'
- peerDependenciesMeta:
- '@aws-sdk/credential-provider-web-identity':
- optional: true
-
'@vercel/[email protected]':
resolution: {integrity: sha512-A/Si4mrTkQqJ6EXJKv5EYCDQ3NL6nJXxG8VGXePsaiQigsomHYQC9xSpX8qGk7AEZk4b1ssbYIqJ0ISQQ7bfcA==}
engines: {node: '>=18'}
@@ -8987,16 +8937,6 @@ packages:
zod:
optional: true
- resolution: {integrity: sha512-KUDwlThJ5tr2Vw0A1ZkbDKNME3wzWhuVfAOwIvFUzl1TPVDFAXDFTXio3p+jaKneB+dKNCvFFlolYmmgHttG1g==}
- engines: {node: '>=18'}
- peerDependencies:
- react: ^18 || ^19 || ^19.0.0-rc
- zod: ^3.23.8
- peerDependenciesMeta:
- react:
- optional: true
-
resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==}
peerDependencies:
@@ -9270,9 +9210,6 @@ packages:
resolution: {integrity: sha512-7q4WPsYiD8Omvi/yHL314DkvsD/lM//Z2/KcU1vWk0xJotiV0GMJTgHTpWl3n90HJqpXKg7qX+VVNs5YbQyPRQ==}
engines: {node: '>=8', npm: '>=5'}
- resolution: {integrity: sha512-/djoAN709iY65ETD6LKCtyyEI04XIBP5xVvfmNxsEP0uJB5tyaGBztSryRr4HqMStr9R06PisQE7m9zDTXKu6g==}
-
resolution: {integrity: sha512-Xm7bpRXnDSX2YE2YFfBk2FnF0ep6tmG7xPh8iHee8MIcrgq762Nkce856dYtJYLkuIoYZvGfTs/PbZhideTcEg==}
engines: {node: '>=4'}
@@ -10954,6 +10891,7 @@ packages:
resolution: {integrity: sha512-t0q23FIpvHDTtnORW+bDJziGsal5uh9RJTJ1fyH8drd4lICOoXhJ5pLMUZ5C0VQei6dNmwTzzoTRgMkO9JgHEQ==}
peerDependencies:
eslint: '>= 5'
+ bundledDependencies: []
resolution: {integrity: sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==}
@@ -17831,11 +17769,6 @@ packages:
peerDependencies:
zod: ^3.23.3
- resolution: {integrity: sha512-h/z3PKvcTcTetyjl1fkj79MHNEjm+HpD6NXheWjzOekY7kV+lwDYnHw+ivHkijnCSMz1yJaWBD9vu/Fcmk+vEg==}
- peerDependencies:
- zod: ^3.24.1
-
resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==}
@@ -17869,15 +17802,6 @@ snapshots:
'@adobe/[email protected]': {}
- dependencies:
- '@ai-sdk/provider': 1.1.3
- '@ai-sdk/provider-utils': 2.2.8([email protected])
- '@smithy/eventstream-codec': 4.0.4
- '@smithy/util-utf8': 4.0.0
- aws4fetch: 1.0.20
- zod: 3.23.8
-
dependencies:
'@ai-sdk/provider': 0.0.26
@@ -17893,21 +17817,10 @@ snapshots:
optionalDependencies:
zod: 3.23.8
- dependencies:
- '@ai-sdk/provider': 1.1.3
- nanoid: 3.3.8
- secure-json-parse: 2.7.0
- zod: 3.23.8
-
'@ai-sdk/[email protected]':
dependencies:
json-schema: 0.4.0
- '@ai-sdk/[email protected]':
- dependencies:
- json-schema: 0.4.0
-
dependencies:
'@ai-sdk/provider-utils': 1.0.22([email protected])
@@ -17918,16 +17831,6 @@ snapshots:
react: 18.3.1
zod: 3.23.8
- dependencies:
- '@ai-sdk/provider-utils': 2.2.8([email protected])
- '@ai-sdk/ui-utils': 1.2.11([email protected])
- react: 18.3.1
- swr: 2.2.5([email protected])
- throttleit: 2.1.0
- optionalDependencies:
- zod: 3.23.8
-
dependencies:
'@ai-sdk/provider-utils': 1.0.22([email protected])
@@ -17955,13 +17858,6 @@ snapshots:
optionalDependencies:
zod: 3.23.8
- dependencies:
- '@ai-sdk/provider': 1.1.3
- '@ai-sdk/provider-utils': 2.2.8([email protected])
- zod: 3.23.8
- zod-to-json-schema: 3.24.6([email protected])
-
dependencies:
'@ai-sdk/provider-utils': 1.0.22([email protected])
@@ -18006,7 +17902,7 @@ snapshots:
'@aws-crypto/[email protected]':
dependencies:
'@aws-crypto/util': 3.0.0
- '@aws-sdk/types': 3.821.0
+ '@aws-sdk/types': 3.468.0
tslib: 1.14.1
'@aws-crypto/[email protected]':
@@ -18083,7 +17979,7 @@ snapshots:
'@aws-crypto/[email protected]':
dependencies:
- '@aws-sdk/types': 3.821.0
+ '@aws-sdk/types': 3.468.0
'@aws-sdk/util-utf8-browser': 3.259.0
tslib: 1.14.1
@@ -24717,7 +24613,7 @@ snapshots:
- supports-color
- webpack
dependencies:
'@opentelemetry/api': 1.9.0
'@opentelemetry/semantic-conventions': 1.32.0
@@ -25784,7 +25680,7 @@ snapshots:
tiny-invariant: 1.3.3
tiny-warning: 1.0.3
dependencies:
'@tanstack/react-router': 1.114.27([email protected]([email protected]))([email protected])
'@tanstack/router-core': 1.114.25
@@ -25795,7 +25691,7 @@ snapshots:
react-dom: 18.3.1([email protected])
tiny-invariant: 1.3.3
tiny-warning: 1.0.3
transitivePeerDependencies:
- '@azure/app-configuration'
- '@azure/cosmos'
@@ -25839,7 +25735,7 @@ snapshots:
- xml2js
- yaml
dependencies:
'@tanstack/router-core': 1.114.25
@@ -25849,11 +25745,11 @@ snapshots:
'@tanstack/start-server-functions-handler': 1.114.25
import-meta-resolve: 4.1.0
ofetch: 1.4.1
react: 18.3.1
react-dom: 18.3.1([email protected])
zod: 3.24.2
transitivePeerDependencies:
@@ -25931,11 +25827,11 @@ snapshots:
- tsx
- yaml
dependencies:
'@tanstack/router-core': 1.114.25
tiny-invariant: 1.3.3
transitivePeerDependencies:
- '@azure/app-configuration'
- '@azure/cosmos'
@@ -25994,13 +25890,13 @@ snapshots:
tiny-warning: 1.0.3
unctx: 2.4.1
dependencies:
'@tanstack/react-start-server': 1.114.27([email protected]([email protected]))([email protected])
'@tanstack/start-server-functions-handler': 1.114.25
@@ -26151,11 +26047,11 @@ snapshots:
- tsx
- yaml
dependencies:
'@tanstack/router-core': 1.114.25
'@tanstack/start-server-core': 1.114.25
transitivePeerDependencies:
- '@azure/app-configuration'
- '@azure/cosmos'
@@ -27018,10 +26914,6 @@ snapshots:
lz-string: 1.5.0
uuid: 9.0.1
- '@vercel/[email protected](@aws-sdk/[email protected])':
- optionalDependencies:
- '@aws-sdk/credential-provider-web-identity': 3.821.0
-
dependencies:
'@mapbox/node-pre-gyp': 2.0.0([email protected])([email protected])
@@ -27447,18 +27339,6 @@ snapshots:
- solid-js
- vue
- dependencies:
- '@ai-sdk/provider': 1.1.3
- '@ai-sdk/provider-utils': 2.2.8([email protected])
- '@ai-sdk/react': 1.2.12([email protected])([email protected])
- '@ai-sdk/ui-utils': 1.2.11([email protected])
- '@opentelemetry/api': 1.9.0
- jsondiffpatch: 0.6.0
- zod: 3.23.8
- optionalDependencies:
- react: 18.3.1
-
optionalDependencies:
ajv: 8.12.0
@@ -27768,8 +27648,6 @@ snapshots:
dependencies:
awesome-imperative-promise: 1.0.1
-
@@ -33478,7 +33356,7 @@ snapshots:
dependencies:
js-yaml-loader: 1.2.2
dependencies:
react: 18.3.1
@@ -33526,7 +33404,7 @@ snapshots:
dependencies:
'@cloudflare/kv-asset-handler': 0.4.0
'@netlify/functions': 3.0.4
@@ -33595,7 +33473,7 @@ snapshots:
unenv: 2.0.0-rc.15
unimport: 4.1.2
unplugin-utils: 0.2.4
untyped: 2.0.0
unwasm: 0.3.9
youch: 4.1.0-beta.6
@@ -33815,7 +33693,7 @@ snapshots:
dependencies:
mitt: 3.0.1
@@ -37641,7 +37519,7 @@ snapshots:
acorn: 8.14.1
webpack-virtual-modules: 0.6.2
dependencies:
anymatch: 3.1.3
chokidar: 4.0.3
@@ -37652,7 +37530,6 @@ snapshots:
ofetch: 1.4.1
ufo: 1.5.4
optionalDependencies:
- aws4fetch: 1.0.20
ioredis: 5.6.0([email protected])
@@ -37875,7 +37752,7 @@ snapshots:
d3-time: 3.1.0
d3-timer: 3.0.1
dependencies:
'@babel/core': 7.26.10([email protected])
'@babel/plugin-syntax-jsx': 7.25.9(@babel/[email protected]([email protected]))
@@ -37897,7 +37774,7 @@ snapshots:
hookable: 5.5.3
http-proxy: 1.18.1
micromatch: 4.0.8
node-fetch-native: 1.6.6
path-to-regexp: 6.3.0
pathe: 1.1.2
@@ -37908,7 +37785,7 @@ snapshots:
ufo: 1.5.4
unctx: 2.4.1
unenv: 1.10.0
zod: 3.23.8
transitivePeerDependencies:
@@ -38496,10 +38373,6 @@ snapshots:
dependencies:
zod: 3.23.8
- dependencies:
- zod: 3.23.8
-
diff --git a/turbo.json b/turbo.json
index 6a883096ddb..4002332fed4 100644
--- a/turbo.json
+++ b/turbo.json
@@ -90,8 +90,6 @@
"SENTRY_AUTH_TOKEN",
"AWS_ACCESS_KEY_ID",
"AWS_SECRET_ACCESS_KEY",
- "AWS_BEDROCK_REGION",
- "AWS_BEDROCK_ROLE_ARN",
"FORCE_ASSET_CDN",
"ASSET_CDN_S3_ENDPOINT",
"SITE_NAME",