File tree Expand file tree Collapse file tree 1 file changed +1
-29
lines changed
modelcache/manager/vector_data Expand file tree Collapse file tree 1 file changed +1
-29
lines changed Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
22from typing import List
33
4- import numpy as np
5- from typing import List
6-
74import numpy as np
85from modelcache .manager .vector_data .base import VectorBase , VectorData
96from modelcache .utils import import_redis
107from redis .commands .search .query import Query
118from 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
1511import_redis ()
1612#
2117
2218
2319class 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" ,
You can’t perform that action at this time.
0 commit comments