Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

constants.ts 1.2 KB

You have to be logged in to leave a comment. Sign In
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
  1. import packageJson from '../package.json';
  2. import { getEnvString } from './envars';
  3. export const VERSION = packageJson.version;
  4. export const DEFAULT_QUERY_LIMIT = 100;
  5. // We use process.env in this file because it's imported by the next.js server as well.
  6. // This is used for sharing evals.
  7. export const SHARE_API_BASE_URL =
  8. // TODO(ian): Backwards compatibility, 2024-04-01
  9. process.env.NEXT_PUBLIC_PROMPTFOO_REMOTE_API_BASE_URL ||
  10. process.env.NEXT_PUBLIC_PROMPTFOO_BASE_URL ||
  11. process.env.PROMPTFOO_REMOTE_API_BASE_URL ||
  12. `https://api.promptfoo.dev`;
  13. export const DEFAULT_SHARE_VIEW_BASE_URL = getEnvString(
  14. 'PROMPTFOO_SHARING_APP_BASE_URL',
  15. `https://app.promptfoo.dev`,
  16. );
  17. // This is used for creating shared eval links.
  18. export const SHARE_VIEW_BASE_URL =
  19. process.env.NEXT_PUBLIC_PROMPTFOO_BASE_URL ||
  20. process.env.PROMPTFOO_REMOTE_APP_BASE_URL ||
  21. DEFAULT_SHARE_VIEW_BASE_URL;
  22. export const DEFAULT_PORT = Number.parseInt(process.env.API_PORT || '15500');
  23. // Maximum width for terminal outputs.
  24. export const TERMINAL_MAX_WIDTH =
  25. process?.stdout?.isTTY && process?.stdout?.columns && process?.stdout?.columns > 10
  26. ? process?.stdout?.columns - 10
  27. : 120;
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...