From f202734705fc346950088fb6619a0b4ff7a8c270 Mon Sep 17 00:00:00 2001 From: Denis Palnitsky Date: Sat, 15 Jun 2024 17:46:17 +0200 Subject: [PATCH 01/10] =?UTF-8?q?=F0=9F=90=8B=20ci:=20adjust=20docker=20wo?= =?UTF-8?q?rkflow=20(#43)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * release github actions workflow * test workflows * test with my repo name * rollback tests * remove test repo * remove spaces --- .github/workflows/docker-build-workflow.yaml | 7 +-- .github/workflows/images.yaml | 53 ++------------------ 2 files changed, 7 insertions(+), 53 deletions(-) diff --git a/.github/workflows/docker-build-workflow.yaml b/.github/workflows/docker-build-workflow.yaml index f9b9a713..116bc990 100644 --- a/.github/workflows/docker-build-workflow.yaml +++ b/.github/workflows/docker-build-workflow.yaml @@ -52,11 +52,8 @@ jobs: context: . file: ${{ matrix.file }} push: true - # tags: | - # ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ github.sha }} - # ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ inputs.tag }} tags: | - ghcr.io/denispalnitsky/${{ matrix.image_name }}:${{ github.sha }} - ghcr.io/denispalnitsky/${{ matrix.image_name }}:${{ inputs.tag }} + ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ github.sha }} + ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ inputs.tag }} platforms: linux/amd64,linux/arm64 target: ${{ matrix.target }} \ No newline at end of file diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 9c0d7ba3..bfc57435 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -7,53 +7,10 @@ on: - 'README.md' branches: - main + jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - strategy: - matrix: - include: - - target: main - file: Dockerfile - image_name: librechat-rag-api-dev - - target: lite - file: Dockerfile.lite - image_name: librechat-rag-api-dev-lite - - steps: - # Check out the repository - - name: Checkout - uses: actions/checkout@v4 - - # Set up QEMU - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - # Set up Docker Buildx - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - # Log in to GitHub Container Registry - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Build and push Docker images for each target - - name: Build and push Docker images - uses: docker/build-push-action@v5 - with: - context: . - file: ${{ matrix.file }} - push: true - tags: | - ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ github.sha }} - ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:latest - platforms: linux/amd64,linux/arm64 - target: ${{ matrix.target }} + call-docker-build: + uses: ./.github/workflows/docker-build-workflow.yaml + with: + tag: latest \ No newline at end of file From 780b3bbcdf0c8cbddebf5acaa6791010e282061a Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sat, 15 Jun 2024 11:49:32 -0400 Subject: [PATCH 02/10] =?UTF-8?q?Revert=20"=F0=9F=90=8B=20ci:=20adjust=20d?= =?UTF-8?q?ocker=20workflow=20(#43)"=20(#46)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f202734705fc346950088fb6619a0b4ff7a8c270. --- .github/workflows/docker-build-workflow.yaml | 7 ++- .github/workflows/images.yaml | 53 ++++++++++++++++++-- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-build-workflow.yaml b/.github/workflows/docker-build-workflow.yaml index 116bc990..f9b9a713 100644 --- a/.github/workflows/docker-build-workflow.yaml +++ b/.github/workflows/docker-build-workflow.yaml @@ -52,8 +52,11 @@ jobs: context: . file: ${{ matrix.file }} push: true + # tags: | + # ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ github.sha }} + # ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ inputs.tag }} tags: | - ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ github.sha }} - ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ inputs.tag }} + ghcr.io/denispalnitsky/${{ matrix.image_name }}:${{ github.sha }} + ghcr.io/denispalnitsky/${{ matrix.image_name }}:${{ inputs.tag }} platforms: linux/amd64,linux/arm64 target: ${{ matrix.target }} \ No newline at end of file diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index bfc57435..9c0d7ba3 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -7,10 +7,53 @@ on: - 'README.md' branches: - main - jobs: - call-docker-build: - uses: ./.github/workflows/docker-build-workflow.yaml - with: - tag: latest \ No newline at end of file + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + strategy: + matrix: + include: + - target: main + file: Dockerfile + image_name: librechat-rag-api-dev + - target: lite + file: Dockerfile.lite + image_name: librechat-rag-api-dev-lite + + steps: + # Check out the repository + - name: Checkout + uses: actions/checkout@v4 + + # Set up QEMU + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + # Set up Docker Buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # Log in to GitHub Container Registry + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Build and push Docker images for each target + - name: Build and push Docker images + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ matrix.file }} + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ github.sha }} + ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:latest + platforms: linux/amd64,linux/arm64 + target: ${{ matrix.target }} From 3a579eea7f40751ae4b14843988402d45eaa61ff Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sat, 15 Jun 2024 12:08:54 -0400 Subject: [PATCH 03/10] =?UTF-8?q?=F0=9F=90=8B=20ci:=20Add=20write=20permis?= =?UTF-8?q?sions=20for=20packages=20in=20release=20workflow=20(#47)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c4861f73..c68cc924 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,6 +6,9 @@ on: tags: - '*' +permissions: + packages: write + jobs: call-docker-build: uses: ./.github/workflows/docker-build-workflow.yaml From cdb3c7d3b21f6c8152cb164d6dd020f1dbcf7407 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sat, 15 Jun 2024 12:12:15 -0400 Subject: [PATCH 04/10] =?UTF-8?q?=F0=9F=90=8B=20ci:=20Add=20write=20permis?= =?UTF-8?q?sions=20for=20packages=20in=20release=20workflow=20(#48)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐋 ci: Add write permissions for packages in release workflow * feat: Add read permission for contents in release workflow --- .github/workflows/release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c68cc924..3aaeaaff 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,10 +7,11 @@ on: - '*' permissions: + contents: read packages: write jobs: call-docker-build: uses: ./.github/workflows/docker-build-workflow.yaml with: - tag: ${{ github.ref_name }} \ No newline at end of file + tag: ${{ github.ref_name }} From f2a02f434ef7154f08d6893b6418a8af1488e8bf Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sat, 15 Jun 2024 12:24:34 -0400 Subject: [PATCH 05/10] =?UTF-8?q?=F0=9F=90=8B=20ci:=20Update=20Docker=20bu?= =?UTF-8?q?ild=20workflow=20to=20use=20dynamic=20image=20tags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-build-workflow.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-build-workflow.yaml b/.github/workflows/docker-build-workflow.yaml index f9b9a713..116bc990 100644 --- a/.github/workflows/docker-build-workflow.yaml +++ b/.github/workflows/docker-build-workflow.yaml @@ -52,11 +52,8 @@ jobs: context: . file: ${{ matrix.file }} push: true - # tags: | - # ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ github.sha }} - # ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ inputs.tag }} tags: | - ghcr.io/denispalnitsky/${{ matrix.image_name }}:${{ github.sha }} - ghcr.io/denispalnitsky/${{ matrix.image_name }}:${{ inputs.tag }} + ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ github.sha }} + ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ inputs.tag }} platforms: linux/amd64,linux/arm64 target: ${{ matrix.target }} \ No newline at end of file From 1d58df520f0962edfb9516f11a49f781ddb8c311 Mon Sep 17 00:00:00 2001 From: Indradeep Biswas Date: Fri, 21 Jun 2024 18:19:15 +0530 Subject: [PATCH 06/10] =?UTF-8?q?=F0=9F=8C=BF=20fix:=20Mongo=20Vector=20St?= =?UTF-8?q?ore=20-=20retrieval=20not=20working=20(#50)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- store_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store_factory.py b/store_factory.py index 35b77fbd..16b81ef6 100644 --- a/store_factory.py +++ b/store_factory.py @@ -25,7 +25,7 @@ def get_vector_store( elif mode == "atlas-mongo": mongo_db = MongoClient(connection_string).get_database() mong_collection = mongo_db[collection_name] - return AtlasMongoVector(collection=mong_collection, embedding=embeddings) + return AtlasMongoVector(collection=mong_collection, embedding=embeddings, index_name=collection_name) else: raise ValueError("Invalid mode specified. Choose 'sync' or 'async'.") From c289c20c620aa8e69439c9676bbde9d35d019748 Mon Sep 17 00:00:00 2001 From: skyking363 Date: Wed, 26 Jun 2024 22:32:53 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=F0=9F=9A=80=20feat:=20Allow=20pptx=20Upl?= =?UTF-8?q?oad=20(#51)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 3 +++ requirements.txt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/main.py b/main.py index ce5b880d..c82b550a 100644 --- a/main.py +++ b/main.py @@ -34,6 +34,7 @@ UnstructuredXMLLoader, UnstructuredRSTLoader, UnstructuredExcelLoader, + UnstructuredPowerPointLoader, ) from models import ( @@ -285,6 +286,8 @@ def get_loader(filename: str, file_content_type: str, filepath: str): loader = UnstructuredRSTLoader(filepath, mode="elements") elif file_ext == "xml": loader = UnstructuredXMLLoader(filepath) + elif file_ext == "pptx": + loader = UnstructuredPowerPointLoader(filepath) elif file_ext == "md": loader = UnstructuredMarkdownLoader(filepath) elif file_content_type == "application/epub+zip": diff --git a/requirements.txt b/requirements.txt index 37cdaa2f..edf53ce5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,3 +26,5 @@ opencv-python-headless==4.9.0.80 pymongo==4.6.3 langchain-mongodb==0.1.3 cryptography==42.0.7 +python-magic==0.4.27 +python-pptx==0.6.23 From 10084b65635136d53f90f268b893545a91cada95 Mon Sep 17 00:00:00 2001 From: Arthur Barrett Date: Wed, 31 Jul 2024 11:37:59 -0400 Subject: [PATCH 08/10] =?UTF-8?q?=F0=9F=94=A7=20fix:=20missing=20python-ma?= =?UTF-8?q?gic=20and=20python-pptx=20in=20requirements.lite.txt=20(#62)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.lite.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.lite.txt b/requirements.lite.txt index 61083069..98e9fb93 100644 --- a/requirements.lite.txt +++ b/requirements.lite.txt @@ -25,3 +25,5 @@ opencv-python-headless==4.9.0.80 pymongo==4.6.3 langchain-mongodb==0.1.3 cryptography==42.0.7 +python-magic==0.4.27 +python-pptx==0.6.23 From b28ca796e624af81d31c309c76068ba599e2c067 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Fri, 30 Aug 2024 19:48:42 +0900 Subject: [PATCH 09/10] =?UTF-8?q?=F0=9F=93=9D=20docs:=20update=20README.md?= =?UTF-8?q?=20(#63)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follw -> Follow --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2605520..e581c6d8 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ The `ATLAS_MONGO_DB_URI` could be the same or different from what is used by Lib } ``` -Follw one of the [four documented methods](https://www.mongodb.com/docs/atlas/atlas-vector-search/create-index/#procedure) to create the vector index. +Follow one of the [four documented methods](https://www.mongodb.com/docs/atlas/atlas-vector-search/create-index/#procedure) to create the vector index. ### Cloud Installation Settings: From de369c22d87dae5ded585ce1ba67e03dbe609c6b Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 30 Aug 2024 06:50:26 -0400 Subject: [PATCH 10/10] =?UTF-8?q?=E2=9A=96=EF=B8=8F=20docs:=20Create=20LIC?= =?UTF-8?q?ENSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..fdd08177 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Danny Avila + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.