constants.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. import { browser, dev } from '$app/environment';
  2. // import { version } from '../../package.json';
  3. export const APP_NAME = 'Open WebUI';
  4. export const WEBUI_BASE_URL = browser ? (dev ? `http://${location.hostname}:8080` : ``) : ``;
  5. export const WEBUI_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1`;
  6. export const LITELLM_API_BASE_URL = `${WEBUI_BASE_URL}/litellm/api`;
  7. export const OLLAMA_API_BASE_URL = `${WEBUI_BASE_URL}/ollama`;
  8. export const OPENAI_API_BASE_URL = `${WEBUI_BASE_URL}/openai/api`;
  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 RAG_API_BASE_URL = `${WEBUI_BASE_URL}/rag/api/v1`;
  12. export const WEBUI_VERSION = APP_VERSION;
  13. export const WEBUI_HASH = APP_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. ];
  31. export const SUPPORTED_FILE_EXTENSIONS = [
  32. 'md',
  33. 'rst',
  34. 'go',
  35. 'py',
  36. 'java',
  37. 'sh',
  38. 'bat',
  39. 'ps1',
  40. 'cmd',
  41. 'js',
  42. 'ts',
  43. 'css',
  44. 'cpp',
  45. 'hpp',
  46. 'h',
  47. 'c',
  48. 'cs',
  49. 'htm',
  50. 'html',
  51. 'sql',
  52. 'log',
  53. 'ini',
  54. 'pl',
  55. 'pm',
  56. 'r',
  57. 'dart',
  58. 'dockerfile',
  59. 'env',
  60. 'php',
  61. 'hs',
  62. 'hsc',
  63. 'lua',
  64. 'nginxconf',
  65. 'conf',
  66. 'm',
  67. 'mm',
  68. 'plsql',
  69. 'perl',
  70. 'rb',
  71. 'rs',
  72. 'db2',
  73. 'scala',
  74. 'bash',
  75. 'swift',
  76. 'vue',
  77. 'svelte',
  78. 'doc',
  79. 'docx',
  80. 'pdf',
  81. 'csv',
  82. 'txt',
  83. 'xls',
  84. 'xlsx',
  85. 'pptx',
  86. 'ppt'
  87. ];
  88. // Source: https://kit.svelte.dev/docs/modules#$env-static-public
  89. // This feature, akin to $env/static/private, exclusively incorporates environment variables
  90. // that are prefixed with config.kit.env.publicPrefix (usually set to PUBLIC_).
  91. // Consequently, these variables can be securely exposed to client-side code.