constants.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import { browser, dev } from '$app/environment';
  2. // import { version } from '../../package.json';
  3. export const APP_NAME = 'Open WebUI';
  4. export const WEBUI_HOSTNAME = browser ? (dev ? `${location.hostname}:8080` : ``) : '';
  5. export const WEBUI_BASE_URL = browser ? (dev ? `http://${WEBUI_HOSTNAME}` : ``) : ``;
  6. export const WEBUI_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1`;
  7. export const OLLAMA_API_BASE_URL = `${WEBUI_BASE_URL}/ollama`;
  8. export const OPENAI_API_BASE_URL = `${WEBUI_BASE_URL}/openai`;
  9. export const AUDIO_API_BASE_URL = `${WEBUI_BASE_URL}/audio/api/v1`;
  10. export const IMAGES_API_BASE_URL = `${WEBUI_BASE_URL}/images/api/v1`;
  11. export const RETRIEVAL_API_BASE_URL = `${WEBUI_BASE_URL}/retrieval/api/v1`;
  12. export const WEBUI_VERSION = APP_VERSION;
  13. export const WEBUI_BUILD_HASH = APP_BUILD_HASH;
  14. export const REQUIRED_OLLAMA_VERSION = '0.1.16';
  15. export const SUPPORTED_FILE_TYPE = [
  16. 'application/epub+zip',
  17. 'application/pdf',
  18. 'text/plain',
  19. 'text/csv',
  20. 'text/xml',
  21. 'text/html',
  22. 'text/x-python',
  23. 'text/css',
  24. 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  25. 'application/octet-stream',
  26. 'application/x-javascript',
  27. 'text/markdown',
  28. 'audio/mpeg',
  29. 'audio/wav',
  30. 'audio/ogg',
  31. 'audio/x-m4a'
  32. ];
  33. export const SUPPORTED_FILE_EXTENSIONS = [
  34. 'md',
  35. 'rst',
  36. 'go',
  37. 'py',
  38. 'java',
  39. 'sh',
  40. 'bat',
  41. 'ps1',
  42. 'cmd',
  43. 'js',
  44. 'ts',
  45. 'css',
  46. 'cpp',
  47. 'hpp',
  48. 'h',
  49. 'c',
  50. 'cs',
  51. 'htm',
  52. 'html',
  53. 'sql',
  54. 'log',
  55. 'ini',
  56. 'pl',
  57. 'pm',
  58. 'r',
  59. 'dart',
  60. 'dockerfile',
  61. 'env',
  62. 'php',
  63. 'hs',
  64. 'hsc',
  65. 'lua',
  66. 'nginxconf',
  67. 'conf',
  68. 'm',
  69. 'mm',
  70. 'plsql',
  71. 'perl',
  72. 'rb',
  73. 'rs',
  74. 'db2',
  75. 'scala',
  76. 'bash',
  77. 'swift',
  78. 'vue',
  79. 'svelte',
  80. 'doc',
  81. 'docx',
  82. 'pdf',
  83. 'csv',
  84. 'txt',
  85. 'xls',
  86. 'xlsx',
  87. 'pptx',
  88. 'ppt',
  89. 'msg'
  90. ];
  91. export const PASTED_TEXT_CHARACTER_LIMIT = 1000;
  92. // Source: https://kit.svelte.dev/docs/modules#$env-static-public
  93. // This feature, akin to $env/static/private, exclusively incorporates environment variables
  94. // that are prefixed with config.kit.env.publicPrefix (usually set to PUBLIC_).
  95. // Consequently, these variables can be securely exposed to client-side code.