* Add dropdown header for model switching * Allow variant duplication * Fix prettier * Use env variable to restrict prisma logs * Fix env.mjs * Remove unnecessary scroll bar from function call output * Properly record when 404 error occurs in queryLLM task * Add SelectedModelInfo in SelectModelModal * Add react-select * Calculate new prompt after switching model * Send newly selected model with creation request * Get new prompt construction function back from GPT-4 * Fix prettier * Fix prettier
54 lines
1.8 KiB
JavaScript
54 lines
1.8 KiB
JavaScript
import { createEnv } from "@t3-oss/env-nextjs";
|
|
import { z } from "zod";
|
|
|
|
export const env = createEnv({
|
|
/**
|
|
* Specify your server-side environment variables schema here. This way you can ensure the app
|
|
* isn't built with invalid env vars.
|
|
*/
|
|
server: {
|
|
DATABASE_URL: z.string().url(),
|
|
NODE_ENV: z.enum(["development", "test", "production"]).default("development"),
|
|
OPENAI_API_KEY: z.string().min(1),
|
|
RESTRICT_PRISMA_LOGS: z
|
|
.string()
|
|
.optional()
|
|
.default("false")
|
|
.transform((val) => val.toLowerCase() === "true"),
|
|
},
|
|
|
|
/**
|
|
* Specify your client-side environment variables schema here. This way you can ensure the app
|
|
* isn't built with invalid env vars. To expose them to the client, prefix them with
|
|
* `NEXT_PUBLIC_`.
|
|
*/
|
|
client: {
|
|
NEXT_PUBLIC_POSTHOG_KEY: z.string().optional(),
|
|
NEXT_PUBLIC_IS_PUBLIC_PLAYGROUND: z
|
|
.string()
|
|
.optional()
|
|
.default("false")
|
|
.transform((val) => val.toLowerCase() === "true"),
|
|
NEXT_PUBLIC_SOCKET_URL: z.string().url().default("http://localhost:3318"),
|
|
},
|
|
|
|
/**
|
|
* You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
|
|
* middlewares) or client-side so we need to destruct manually.
|
|
*/
|
|
runtimeEnv: {
|
|
DATABASE_URL: process.env.DATABASE_URL,
|
|
NODE_ENV: process.env.NODE_ENV,
|
|
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
|
|
RESTRICT_PRISMA_LOGS: process.env.RESTRICT_PRISMA_LOGS,
|
|
NEXT_PUBLIC_POSTHOG_KEY: process.env.NEXT_PUBLIC_POSTHOG_KEY,
|
|
NEXT_PUBLIC_IS_PUBLIC_PLAYGROUND: process.env.NEXT_PUBLIC_IS_PUBLIC_PLAYGROUND,
|
|
NEXT_PUBLIC_SOCKET_URL: process.env.NEXT_PUBLIC_SOCKET_URL,
|
|
},
|
|
/**
|
|
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation.
|
|
* This is especially useful for Docker builds.
|
|
*/
|
|
skipValidation: !!process.env.SKIP_ENV_VALIDATION,
|
|
});
|