Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Users to Read/Write from Custom Vector DB Caches #29

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
44bd2af
v1
ishaan-jaff Jul 12, 2023
a5b5613
feat(improvements): add base improvements to the project - bit on the…
grski Jul 13, 2023
ad8d822
chore(formatting): apply formatting
grski Jul 13, 2023
3b36db7
refactor(naming): move tests to separate directory and rename files t…
grski Jul 14, 2023
91fde0c
refactor(cleanup): deleted files that shouldn't be in the repo - dist…
grski Jul 14, 2023
f94b104
fix linting
hkorzeniewski Jul 14, 2023
17627fa
refactor(cleanup): update the ci/cd
grski Jul 14, 2023
9caefd2
Merge pull request #2 from th33ngineers/renaming
grski Jul 14, 2023
029edff
refactor(imports): fix imports in tests mainly
grski Jul 14, 2023
e43fada
Merge pull request #3 from th33ngineers/renaming
grski Jul 14, 2023
68673ce
Merge pull request #1 from th33ngineers/formatting
grski Jul 14, 2023
a515389
fix linting
hkorzeniewski Jul 14, 2023
df5d156
Merge branch 'base-improvements' into renaming
hkorzeniewski Jul 14, 2023
16cc687
resolve confilcts
hkorzeniewski Jul 14, 2023
db6bde8
Merge pull request #4 from th33ngineers/renaming
hkorzeniewski Jul 14, 2023
fb4f7b1
Merge pull request #30 from th33ngineers/base-improvements
ishaan-jaff Jul 14, 2023
ba85e8b
chore(formatting): fix isort
grski Jul 15, 2023
da50f6f
feat(redis-cache): allow custom cache storage - redis
grski Jul 15, 2023
a4d64a7
feat(generic-cache): refactor current cache code and add generic cach…
grski Jul 15, 2023
5b161f9
fix(tests): fix the tests - missing import, etc.
grski Jul 21, 2023
90f0d5a
merge
grski Jul 21, 2023
e06ad1d
merge(main)
grski Jul 21, 2023
faab313
Merge pull request #33 from th33ngineers/ishaan-allow-custom-vectorDBs
krrishdholakia Aug 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
rebase-strategy: "disabled"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
rebase-strategy: "disabled"
42 changes: 42 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Continuous Delivery

on: [pull_request]

jobs:

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Run pre-commit
uses: pre-commit/[email protected]

test:
permissions:
pull-requests: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.3.2
- name: Install dependencies
run: poetry install --all-extras
- name: Static code checks
run: |
pip install flake8
make lint
- name: Run tests
run: make test
250 changes: 249 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,250 @@
.env
files/*
files/*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea
.idea/
.ruff
.ruff/

.python-version

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

/.ruff_cache/
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3.10

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.274'
hooks:
- id: ruff
args: ["--fix"]
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PATH := $(PATH)
SHELL := /bin/bash

black:
poetry run black .

ruff:
poetry run ruff check . --fix

isort:
poetry run isort .


lint:
make black
make ruff

pre-commit:
pre-commit run --all-files

test:
poetry run pytest tests --color=yes
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,37 @@ You own your keys, and can delete them whenever you want.
## Support
Reach out to us on [Discord](https://discord.gg/WXFfTeEXRh) or Email us at [email protected] & [email protected]

## Development
The suggested setup is to go with pyenv and poetry.


### Local development setup

Prerequisites:

* [Python version 3.10]()
* [poetry](https://python-poetry.org/docs/#installation)
* [pyenv]

```bash
pyenv install 3.10
pyenv local 3.10
python -m pip install poetry
python -m poetry install

```

### Style & Formatting

Style & formatting checks are run on every commit as part of the CI Pipeline

On the python side the project is setup to use the following linting and formatting tools:
- [black](https://black.readthedocs.io/)
- [ruff](https://beta.ruff.rs/docs/)

If you have this project up and running locally, you can run these checks:
```bash
make lint
```

There's pre-commit package being used in this project.
Loading
Loading