From f9d40784f0db7d621335927aafcffb8e184ab074 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sun, 1 Jun 2025 17:48:19 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix:=20Dev=20Deployment,=20Mistr?= =?UTF-8?q?al=20OCR=20Error,=20and=20UI=20Consistency=20(#7668)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔧 fix: Update ProgressText and ToolCall components for improved error handling and localization * 🔧 chore: Format ESLint configuration for improved readability and remove unused rule * 🔧 refactor: Simplify ProgressText component logic for better readability and maintainability * 🔧 refactor: Update ProgressText and ToolCall components for improved layout consistency * 🔧 refactor: Simplify icon rendering in TTS components and enhance button rendering logic in HoverButtons * 🔧 refactor: Update placeholder logic in VariableForm component to simply use variable name * fix: .docx. .pptx Mistral OCR Error with `image_limit=0` * chore: Update deploy workflow to include conditions for successful dev branch deployment and streamline deployment steps * ci: Set image_limit to 0 in MistralOCR service tests for consistent behavior --- .github/workflows/deploy-dev.yml | 9 ++- api/server/services/Files/MistralOCR/crud.js | 1 + .../services/Files/MistralOCR/crud.spec.js | 2 + client/src/components/Audio/TTS.tsx | 69 ++++++++++++------- .../Chat/Messages/Content/ProgressText.tsx | 33 +++++++-- .../Chat/Messages/Content/ToolCall.tsx | 4 +- .../components/Chat/Messages/HoverButtons.tsx | 15 +--- .../Prompts/Groups/VariableForm.tsx | 4 +- client/src/locales/en/translation.json | 2 +- eslint.config.mjs | 8 ++- 10 files changed, 95 insertions(+), 52 deletions(-) diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index 5208084393..ef02e4decc 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -12,7 +12,8 @@ jobs: runs-on: ubuntu-latest if: | github.repository == 'danny-avila/LibreChat' && - (github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success') + (github.event_name == 'workflow_dispatch' || + (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'dev')) steps: - name: Checkout repository uses: actions/checkout@v4 @@ -32,9 +33,13 @@ jobs: sudo -i -u danny bash << EEOF cd ~/LibreChat && \ git fetch origin main && \ + npm run stop:deployed && \ + docker images -a | grep "librechat" | awk '{print \$3}' | xargs docker rmi && \ npm run update:deployed && \ + git checkout dev && \ + git pull origin dev && \ git checkout do-deploy && \ - git rebase main && \ + git rebase dev && \ npm run start:deployed && \ echo "Update completed. Application should be running now." EEOF diff --git a/api/server/services/Files/MistralOCR/crud.js b/api/server/services/Files/MistralOCR/crud.js index cc01d803b0..02fdb85461 100644 --- a/api/server/services/Files/MistralOCR/crud.js +++ b/api/server/services/Files/MistralOCR/crud.js @@ -92,6 +92,7 @@ async function performOCR({ `${baseURL}/ocr`, { model, + image_limit: 0, include_image_base64: false, document: { type: documentType, diff --git a/api/server/services/Files/MistralOCR/crud.spec.js b/api/server/services/Files/MistralOCR/crud.spec.js index 8cc63cade2..72d6be7cb0 100644 --- a/api/server/services/Files/MistralOCR/crud.spec.js +++ b/api/server/services/Files/MistralOCR/crud.spec.js @@ -186,6 +186,7 @@ describe('MistralOCR Service', () => { { model: 'mistral-ocr-latest', include_image_base64: false, + image_limit: 0, document: { type: 'document_url', document_url: 'https://document-url.com', @@ -221,6 +222,7 @@ describe('MistralOCR Service', () => { { model: 'mistral-ocr-latest', include_image_base64: false, + image_limit: 0, document: { type: 'image_url', image_url: 'https://image-url.com/image.png', diff --git a/client/src/components/Audio/TTS.tsx b/client/src/components/Audio/TTS.tsx index d5fcb91120..9343b483d2 100644 --- a/client/src/components/Audio/TTS.tsx +++ b/client/src/components/Audio/TTS.tsx @@ -25,16 +25,16 @@ export function BrowserTTS({ content, }); - const renderIcon = (size: string) => { + const renderIcon = () => { if (isLoading === true) { - return ; + return ; } if (isSpeaking === true) { - return ; + return ; } - return ; + return ; }; useEffect(() => { @@ -68,13 +68,13 @@ export function BrowserTTS({ renderButton({ onClick: handleClick, title: title, - icon: renderIcon('19'), + icon: renderIcon(), isActive: isSpeaking, className, }) ) : ( )}