-
Notifications
You must be signed in to change notification settings - Fork 267
Expand file tree
/
Copy pathenv.ts
More file actions
25 lines (18 loc) · 773 Bytes
/
env.ts
File metadata and controls
25 lines (18 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { createEnv } from "@t3-oss/env-core";
import { z } from "zod";
export const numberSchema = z.coerce.number();
const SOURCEBOT_DEFAULT_HOST = "http://localhost:3000";
export const env = createEnv({
server: {
SOURCEBOT_HOST: z.string().url().default(SOURCEBOT_DEFAULT_HOST),
SOURCEBOT_API_KEY: z.string().optional(),
// The minimum number of tokens to return
DEFAULT_MINIMUM_TOKENS: numberSchema.default(10000),
// The number of matches to fetch from the search API.
DEFAULT_MATCHES: numberSchema.default(10000),
// The number of lines to include above and below a match
DEFAULT_CONTEXT_LINES: numberSchema.default(5),
},
runtimeEnv: process.env,
emptyStringAsUndefined: true,
});