-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
44 lines (41 loc) · 969 Bytes
/
index.ts
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { LevelWithSilent } from 'pino';
export type Config = {
auth: {
cookieName: string;
saltRounds: number;
};
log: {
level: LevelWithSilent;
};
openai: {
apiKey: string;
maxTokens: number;
model: string;
};
prompts: {
shouldUseFakeResponses: boolean;
};
};
const config: Config = {
auth: {
cookieName: 'userAuth',
saltRounds: 10,
},
log: {
level: 'trace',
},
openai: {
apiKey: process.env.OPENAI_API_KEY as string,
maxTokens: process.env.OPENAI_MAX_TOKENS
? Number(process.env.OPENAI_MAX_TOKENS)
: 4096,
model: process.env.OPENAI_MODEL || 'gpt-4o-mini-2024-07-18',
},
prompts: {
// This tell the Prompts to use fake responses rather than
// connecting with the AI. Useful for dev/testing purposes.
// defaults to false, set to 'true' to override
shouldUseFakeResponses: process.env.PROMPTS_USE_FAKE_RESPONSES === 'true',
},
};
export default config;