diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..258f485 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,3 @@ +"Build: Automation": +- changed-files: + - any-glob-to-any-file: ['.github/**'] diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 0000000..4613569 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,22 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +on: [pull_request_target] + +jobs: + label: + + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml new file mode 100644 index 0000000..af6a923 --- /dev/null +++ b/.github/workflows/super-linter.yml @@ -0,0 +1,29 @@ +# This workflow executes several linters on changed files based on languages used in your code base whenever +# you push a code or open a pull request. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/github/super-linter +name: Lint Code Base + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] +jobs: + run-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: "main" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 9a5ac89..c705486 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ pip install -r requirements.txt 3. Run the app using `uvicorn app.main:app --reload` + ```bash uvicorn app.main:app --reload --port 7401 ``` diff --git a/app/__init__.py b/app/__init__.py index f14e81d..4be4e47 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,4 +1,5 @@ # app/__init__.py + from .routers.upload import router as upload_router from .routers.questionGenerate import router as questionGenerate_router diff --git a/app/routers/upload.py b/app/routers/upload.py index 6e3d149..690bbab 100644 --- a/app/routers/upload.py +++ b/app/routers/upload.py @@ -9,6 +9,7 @@ async def upload_pdf(file: UploadFile = None, examid: str = Query(..., description="The ID of the exam related to the uploaded PDF")) -> dict: if file is None: file = File(...) + """Endpoint to upload a PDF and upsert its contents into a Pinecone vector store.""" if file.content_type != 'application/pdf': raise HTTPException(status_code=415, detail="Unsupported file type. Please upload a PDF.")