Skip to content

Commit

Permalink
feat: make Bedrock integration conditional on AWS credentials
Browse files Browse the repository at this point in the history
Co-Authored-By: ben <ben@prologe.io>
  • Loading branch information
devin-ai-integration[bot] and benjaminshafii committed Dec 24, 2024
1 parent 548b9d6 commit 9c41122
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 5 deletions.
110 changes: 110 additions & 0 deletions packages/web/.turbo/turbo-build.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@


> @file-organizer/web@0.1.0 build /home/ubuntu/repos/file-organizer-2000/packages/web
> pnpm run db:migrate && pnpm next build


> @file-organizer/web@0.1.0 db:migrate /home/ubuntu/repos/file-organizer-2000/packages/web
> pnpm dotenv -c -- drizzle-kit migrate

drizzle-kit: v0.22.8
drizzle-orm: v0.31.4

No config path provided, using default path
Reading config file '/home/ubuntu/repos/file-organizer-2000/packages/web/drizzle.config.ts'
Using 'pg' driver for database querying
[⣷] applying migrations...[⣯] applying migrations...[⣟] applying migrations...[⡿] applying migrations...[⢿] applying migrations...[⣻] applying migrations...[⣽] applying migrations...[✓] migrations applied successfully! ▲ Next.js 14.2.21

  Creating an optimized production build ...
✓ Compiled successfully
  Skipping linting
[?25l   Checking validity of types .   Checking validity of types .. ⚠ TypeScript project references are not fully supported. Attempting to build in incremental mode.
   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..[?25h   Checking validity of types ✓ Checking validity of types
[?25l   Collecting page data .   Collecting page data ..   Collecting page data ...   Collecting page data .(node:32305) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[?25h ⚠ Using edge runtime on a page currently disables static generation for that page
[?25l   Collecting page data .[?25h   Collecting page data ✓ Collecting page data
[?25l   Generating static pages (0/52) [ ]   Generating static pages (0/52) [= ]   Generating static pages (9/52) [== ]   Generating static pages (28/52) [=== ]   Generating static pages (41/52) [ ===](node:32302) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Redeploy cron job started
   Generating static pages (51/52) [ ==]Error fetching deployment status: n [Error]: Dynamic server usage: Route /api/deployment/status couldn't be rendered statically because it used `headers`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
at l (/home/ubuntu/repos/file-organizer-2000/packages/web/.next/server/chunks/4385.js:1:57698)
at u (/home/ubuntu/repos/file-organizer-2000/packages/web/.next/server/chunks/7481.js:9:21260)
at s (/home/ubuntu/repos/file-organizer-2000/packages/web/.next/server/chunks/7481.js:1:524)
at P (/home/ubuntu/repos/file-organizer-2000/packages/web/.next/server/chunks/3609.js:1:4668)
at c (/home/ubuntu/repos/file-organizer-2000/packages/web/.next/server/app/api/deployment/status/route.js:1:1396)
at /home/ubuntu/repos/file-organizer-2000/node_modules/.pnpm/next@14.2.21_@babel+core@7.26.0_@opentelemetry+api@1.9.0_@playwright+test@1.49.1_babel-plugin_eijz2nmsxu5mtrciidzudqwz2y/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:38417
at /home/ubuntu/repos/file-organizer-2000/node_modules/.pnpm/next@14.2.21_@babel+core@7.26.0_@opentelemetry+api@1.9.0_@playwright+test@1.49.1_babel-plugin_eijz2nmsxu5mtrciidzudqwz2y/node_modules/next/dist/server/lib/trace/tracer.js:140:36
at NoopContextManager.with (/home/ubuntu/repos/file-organizer-2000/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js:25:19)
at ContextAPI.with (/home/ubuntu/repos/file-organizer-2000/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/api/context.js:60:46)
at NoopTracer.startActiveSpan (/home/ubuntu/repos/file-organizer-2000/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js:65:31) {
description: "Route /api/deployment/status couldn't be rendered statically because it used `headers`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error",
digest: 'DYNAMIC_SERVER_USAGE'
}
[?25h ✓ Generating static pages (52/52)
[?25l   Finalizing page optimization .[?25l   Collecting build traces .[?25h   Collecting build traces ✓ Collecting build traces
[?25h   Finalizing page optimization ✓ Finalizing page optimization

Route (app) Size First Load JS
┌ ○ / 142 B 87.2 kB
├ ○ /_not-found 872 B 88 kB
├ ƒ /api/aliases 0 B 0 B
├ ƒ /api/chat 0 B 0 B
├ ƒ /api/check-key 0 B 0 B
├ ○ /api/check-premium 0 B 0 B
├ ƒ /api/chunks 0 B 0 B
├ ƒ /api/classify-v2 0 B 0 B
├ ƒ /api/classify1 0 B 0 B
├ ƒ /api/concepts 0 B 0 B
├ ƒ /api/concepts-and-chunks 0 B 0 B
├ ƒ /api/create-folder 0 B 0 B
├ ƒ /api/cron/redeploy 0 B 0 B
├ ƒ /api/cron/reset-tokens 0 B 0 B
├ ƒ /api/deployment/status 0 B 0 B
├ ƒ /api/deployment/update-key 0 B 0 B
├ ƒ /api/fabric-classify 0 B 0 B
├ ƒ /api/folders 0 B 0 B
├ ƒ /api/folders/embeddings 0 B 0 B
├ ƒ /api/folders/existing 0 B 0 B
├ ƒ /api/folders/new 0 B 0 B
├ ƒ /api/folders/v2 0 B 0 B
├ ƒ /api/format 0 B 0 B
├ ƒ /api/format-stream 0 B 0 B
├ ƒ /api/format/v2 0 B 0 B
├ ○ /api/health 0 B 0 B
├ ƒ /api/organize-all 0 B 0 B
├ ƒ /api/redeploy 0 B 0 B
├ ƒ /api/relationships 0 B 0 B
├ ƒ /api/tags 0 B 0 B
├ ƒ /api/tags/existing 0 B 0 B
├ ƒ /api/tags/new 0 B 0 B
├ ƒ /api/tags/v2 0 B 0 B
├ ƒ /api/title 0 B 0 B
├ ƒ /api/title/multiple 0 B 0 B
├ ƒ /api/title/multiple-stream 0 B 0 B
├ ƒ /api/title/v2 0 B 0 B
├ ƒ /api/top-up 0 B 0 B
├ ƒ /api/transcribe 0 B 0 B
├ ƒ /api/usage 0 B 0 B
├ ƒ /api/vision 0 B 0 B
├ ƒ /api/webhook 0 B 0 B
├ ○ /dashboard/deployment 97 kB 223 kB
├ ○ /dashboard/lifetime 10.7 kB 157 kB
├ ○ /dashboard/onboarding 1.5 kB 102 kB
├ ○ /dashboard/pricing 397 B 101 kB
├ ○ /dashboard/self-hosted 142 B 87.2 kB
├ ○ /dashboard/subscribers 2.13 kB 118 kB
├ ○ /top-up-cancelled 178 B 94.1 kB
└ ○ /top-up-success 178 B 94.1 kB
+ First Load JS shared by all 87.1 kB
├ chunks/559-8081ffbc384b587b.js 31.6 kB
├ chunks/8eb2234e-bf095b28ff238582.js 53.6 kB
└ other shared chunks (total) 1.9 kB


ƒ Middleware 60.4 kB

○ (Static) prerendered as static content
ƒ (Dynamic) server-rendered on demand

[?25h
Expand Down
12 changes: 7 additions & 5 deletions packages/web/lib/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ const models = {
"gemini-2.0-flash-exp": createGoogleGenerativeAI({
apiKey: process.env.GOOGLE_API_KEY
})("gemini-2.0-flash-exp"),
"claude-3-sonnet": createAmazonBedrock({
region: process.env.AWS_REGION,
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
})("anthropic.claude-3-sonnet-20240229-v1:0"),
...(process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY ? {
"claude-3-sonnet": createAmazonBedrock({
region: process.env.AWS_REGION || "us-east-1",
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
})("anthropic.claude-3-sonnet-20240229-v1:0"),
} : {}),
};

export const getModel = (name: string) => {
Expand Down

0 comments on commit 9c41122

Please sign in to comment.