@aj-archipelago/cortex 1.3.50 → 1.3.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/config.js +1 -1
  2. package/helper-apps/cortex-browser/Dockerfile +19 -31
  3. package/helper-apps/cortex-browser/function_app.py +708 -181
  4. package/helper-apps/cortex-browser/requirements.txt +4 -4
  5. package/helper-apps/cortex-file-handler/blobHandler.js +850 -429
  6. package/helper-apps/cortex-file-handler/constants.js +64 -48
  7. package/helper-apps/cortex-file-handler/docHelper.js +7 -114
  8. package/helper-apps/cortex-file-handler/fileChunker.js +96 -51
  9. package/helper-apps/cortex-file-handler/function.json +2 -6
  10. package/helper-apps/cortex-file-handler/helper.js +34 -25
  11. package/helper-apps/cortex-file-handler/index.js +324 -136
  12. package/helper-apps/cortex-file-handler/localFileHandler.js +56 -57
  13. package/helper-apps/cortex-file-handler/package-lock.json +6065 -5964
  14. package/helper-apps/cortex-file-handler/package.json +8 -4
  15. package/helper-apps/cortex-file-handler/redis.js +23 -17
  16. package/helper-apps/cortex-file-handler/scripts/setup-azure-container.js +12 -9
  17. package/helper-apps/cortex-file-handler/scripts/setup-test-containers.js +21 -18
  18. package/helper-apps/cortex-file-handler/scripts/test-azure.sh +1 -1
  19. package/helper-apps/cortex-file-handler/scripts/test-gcs.sh +1 -1
  20. package/helper-apps/cortex-file-handler/services/ConversionService.js +288 -0
  21. package/helper-apps/cortex-file-handler/services/FileConversionService.js +53 -0
  22. package/helper-apps/cortex-file-handler/start.js +63 -38
  23. package/helper-apps/cortex-file-handler/tests/FileConversionService.test.js +144 -0
  24. package/helper-apps/cortex-file-handler/tests/blobHandler.test.js +88 -64
  25. package/helper-apps/cortex-file-handler/tests/fileChunker.test.js +114 -91
  26. package/helper-apps/cortex-file-handler/tests/fileUpload.test.js +351 -0
  27. package/helper-apps/cortex-file-handler/tests/files/DOCX_TestPage.docx +0 -0
  28. package/helper-apps/cortex-file-handler/tests/files/tests-example.xls +0 -0
  29. package/helper-apps/cortex-file-handler/tests/start.test.js +943 -642
  30. package/helper-apps/cortex-file-handler/tests/testUtils.helper.js +31 -0
  31. package/helper-apps/cortex-markitdown/.funcignore +1 -0
  32. package/helper-apps/cortex-markitdown/MarkitdownConverterFunction/__init__.py +64 -0
  33. package/helper-apps/cortex-markitdown/MarkitdownConverterFunction/function.json +21 -0
  34. package/helper-apps/cortex-markitdown/README.md +94 -0
  35. package/helper-apps/cortex-markitdown/host.json +15 -0
  36. package/helper-apps/cortex-markitdown/requirements.txt +2 -0
  37. package/lib/requestExecutor.js +44 -36
  38. package/package.json +1 -1
  39. package/pathways/system/entity/tools/sys_tool_readfile.js +24 -2
  40. package/server/plugins/openAiWhisperPlugin.js +59 -87
  41. package/helper-apps/cortex-file-handler/tests/docHelper.test.js +0 -148
package/config.js CHANGED
@@ -88,7 +88,7 @@ var config = convict({
88
88
  },
89
89
  ollamaUrl: {
90
90
  format: String,
91
- default: 'http://127.0.0.1:11434',
91
+ default: '',
92
92
  env: 'OLLAMA_URL'
93
93
  },
94
94
  claudeVertexUrl: {
@@ -1,52 +1,40 @@
1
1
  # Use an official Python runtime as a parent image suitable for Azure Functions
2
- FROM mcr.microsoft.com/azure-functions/python:4-python3.9
2
+ FROM mcr.microsoft.com/azure-functions/python:4-python3.11
3
3
 
4
4
  # Set environment variables for Azure Functions runtime
5
5
  ENV AzureWebJobsScriptRoot=/home/site/wwwroot
6
6
  ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true
7
+ # This might still be useful for Azure deployments, can be kept or removed based on specific SSL/TLS needs for accessing other Azure resources.
8
+ ENV WEBSITES_INCLUDE_CLOUD_CERTS=true
7
9
 
8
- # Install OS dependencies needed by Playwright browsers (Debian-based)
9
- # This list is based on Playwright documentation and common needs
10
+ # Install Playwright dependencies
10
11
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
- libnss3 \
12
- libnspr4 \
13
- libdbus-glib-1-2 \
14
- libatk1.0-0 \
15
- libatk-bridge2.0-0 \
16
- libcups2 \
17
- libdrm2 \
18
- libexpat1 \
19
- libgbm1 \
20
- libpango-1.0-0 \
21
- libx11-6 \
22
- libxcb1 \
23
- libxcomposite1 \
24
- libxdamage1 \
25
- libxext6 \
26
- libxfixes3 \
27
- libxrandr2 \
28
- libxrender1 \
29
- libxtst6 \
30
- lsb-release \
31
- wget \
32
- xvfb \
33
- # Clean up apt cache
12
+ # Common fonts for rendering (can be useful even for headless)
13
+ fonts-liberation \
14
+ fonts-noto \
15
+ fontconfig \
16
+ # Clean up APT caches
34
17
  && rm -rf /var/lib/apt/lists/*
35
18
 
36
19
  # Copy requirements file first to leverage Docker cache
37
20
  COPY requirements.txt /tmp/
38
21
  WORKDIR /tmp
39
22
 
40
- # Install Python dependencies
23
+ # Install Python dependencies (including playwright)
41
24
  RUN pip install --no-cache-dir -r requirements.txt
42
25
 
43
- # Install Playwright browsers and their dependencies within the container
44
- # Using --with-deps helps install system dependencies needed by the browsers
45
- # Installing only chromium as it's specified in the code
26
+ # Install Playwright browser(s) and their OS dependencies
27
+ # This installs Chromium by default along with its necessary OS packages.
28
+ # Add other browsers like firefox or webkit if needed: playwright install --with-deps firefox webkit
46
29
  RUN playwright install --with-deps chromium
47
30
 
31
+ RUN playwright install-deps
32
+
48
33
  # Copy the function app code to the final location
49
34
  COPY . /home/site/wwwroot
50
35
 
51
36
  # Set the working directory for the function app
52
- WORKDIR /home/site/wwwroot
37
+ WORKDIR /home/site/wwwroot
38
+
39
+ # Expose the default Azure Functions port
40
+ EXPOSE 80