Skip to content

Commit

Permalink
Merge branch 'dev' into support-for-Weaviate
Browse files Browse the repository at this point in the history
  • Loading branch information
sunilkumardash9 authored Jul 7, 2023
2 parents 9c90089 + 2852a41 commit 8460083
Show file tree
Hide file tree
Showing 17 changed files with 586 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Nightly_CI_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@main

- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_dev_python_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@v2.3.1
uses: actions/setup-python@v4
with:
python-version: 3.8
# - name: Get history and tags for SCM versioning
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_dev_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@v2.3.1
uses: actions/setup-python@v4
with:
python-version: 3.8
# - name: Get history and tags for SCM versioning
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_release_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@v2.3.1
uses: actions/setup-python@v4
with:
python-version: 3.8
# - name: Get history and tags for SCM versioning
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
steps:
- uses: actions/checkout@v3.0.0
- name: Setup Python
uses: actions/setup-python@v3.0.0
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Python pylint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_test_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@main

- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
Expand Down
2 changes: 1 addition & 1 deletion gptcache/manager/scalar_data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def get_ids(self, deleted=True):
pass

@abstractmethod
def count(self):
def count(self, state: int = 0, is_all: bool = False):
pass

def flush(self):
Expand Down
9 changes: 9 additions & 0 deletions gptcache/manager/scalar_data/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ def get(name, **kwargs):
username=kwargs.get("username"),
password=kwargs.get("password")
)
elif name == "redis":
from gptcache.manager.scalar_data.redis_storage import RedisCacheStorage

return RedisCacheStorage(
host=kwargs.pop("redis_host", "localhost"),
port=kwargs.pop("redis_port", 6379),
global_key_prefix=kwargs.pop("global_key_prefix", TABLE_NAME),
**kwargs
)
else:
raise NotFoundError("cache store", name)
return cache_base
9 changes: 5 additions & 4 deletions gptcache/manager/scalar_data/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

import_mongodb()

from mongoengine import Document # pylint: disable=wrong-import-position
from mongoengine import fields # pylint: disable=wrong-import-position
import mongoengine as me # pylint: disable=wrong-import-position
# pylint: disable=C0413
from mongoengine import Document
from mongoengine import fields
import mongoengine as me


def get_models():
Expand Down Expand Up @@ -253,7 +254,7 @@ def list_sessions(self, session_id=None, key=None):
if session_id:
query["session_id"] = session_id
if key:
query["_id"] = key
query["question_id"] = key

return self._session.objects(__raw__=query)

Expand Down
Loading

0 comments on commit 8460083

Please sign in to comment.