Skip to content

Commit 848e764

Browse files
committed
modify redis func
1 parent 38f1b8d commit 848e764

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

modelcache/manager/vector_data/redis.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
# -*- coding: utf-8 -*-
22
from typing import List
33

4-
import numpy as np
5-
from typing import List
6-
74
import numpy as np
85
from modelcache.manager.vector_data.base import VectorBase, VectorData
96
from modelcache.utils import import_redis
107
from redis.commands.search.query import Query
118
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
12-
13-
# from modelcache.utils.log import gptcache_log
9+
from modelcache.utils.log import modelcache_log
1410

1511
import_redis()
1612
#
@@ -21,30 +17,6 @@
2117

2218

2319
class RedisVectorStore(VectorBase):
24-
""" vector store: Redis
25-
26-
:param host: redis host, defaults to "localhost".
27-
:type host: str
28-
:param port: redis port, defaults to "6379".
29-
:type port: str
30-
:param username: redis username, defaults to "".
31-
:type username: str
32-
:param password: redis password, defaults to "".
33-
:type password: str
34-
:param dimension: the dimension of the vector, defaults to 0.
35-
:type dimension: int
36-
:param collection_name: the name of the index for Redis, defaults to "gptcache".
37-
:type collection_name: str
38-
:param top_k: the number of the vectors results to return, defaults to 1.
39-
:type top_k: int
40-
41-
Example:
42-
.. code-block:: python
43-
44-
from gptcache.manager import VectorBase
45-
46-
vector_base = VectorBase("redis", dimension=10)
47-
"""
4820
def __init__(
4921
self,
5022
host: str = "localhost",

0 commit comments

Comments
 (0)