constants.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import { dev } from '$app/environment';
  2. export const WEBUI_NAME = 'Ollama Web UI';
  3. export const WEBUI_BASE_URL = dev ? `http://${location.hostname}:8080` : ``;
  4. export const WEBUI_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1`;
  5. export const OLLAMA_API_BASE_URL = `${WEBUI_BASE_URL}/ollama/api`;
  6. export const OPENAI_API_BASE_URL = `${WEBUI_BASE_URL}/openai/api`;
  7. export const RAG_API_BASE_URL = `${WEBUI_BASE_URL}/rag/api/v1`;
  8. export const WEB_UI_VERSION = 'v1.0.0-alpha-static';
  9. export const REQUIRED_OLLAMA_VERSION = '0.1.16';
  10. export const SUPPORTED_FILE_TYPE = [
  11. 'application/epub+zip',
  12. 'application/pdf',
  13. 'text/plain',
  14. 'text/csv',
  15. 'text/xml',
  16. 'text/x-python',
  17. 'text/css',
  18. 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  19. 'application/octet-stream',
  20. 'application/x-javascript',
  21. 'text/markdown'
  22. ];
  23. export const SUPPORTED_FILE_EXTENSIONS = [
  24. 'md',
  25. 'rst',
  26. 'go',
  27. 'py',
  28. 'java',
  29. 'sh',
  30. 'bat',
  31. 'ps1',
  32. 'cmd',
  33. 'js',
  34. 'ts',
  35. 'css',
  36. 'cpp',
  37. 'hpp',
  38. 'h',
  39. 'c',
  40. 'cs',
  41. 'sql',
  42. 'log',
  43. 'ini',
  44. 'pl',
  45. 'pm',
  46. 'r',
  47. 'dart',
  48. 'dockerfile',
  49. 'env',
  50. 'php',
  51. 'hs',
  52. 'hsc',
  53. 'lua',
  54. 'nginxconf',
  55. 'conf',
  56. 'm',
  57. 'mm',
  58. 'plsql',
  59. 'perl',
  60. 'rb',
  61. 'rs',
  62. 'db2',
  63. 'scala',
  64. 'bash',
  65. 'swift',
  66. 'vue',
  67. 'svelte',
  68. 'doc',
  69. 'docx',
  70. 'pdf',
  71. 'csv',
  72. 'txt',
  73. 'xls',
  74. 'xlsx'
  75. ];
  76. // Source: https://kit.svelte.dev/docs/modules#$env-static-public
  77. // This feature, akin to $env/static/private, exclusively incorporates environment variables
  78. // that are prefixed with config.kit.env.publicPrefix (usually set to PUBLIC_).
  79. // Consequently, these variables can be securely exposed to client-side code.
  80. // Example of the .env configuration:
  81. // OLLAMA_API_BASE_URL="http://localhost:11434/api"
  82. // # Public
  83. // PUBLIC_API_BASE_URL=$OLLAMA_API_BASE_URL