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 1
1
# -*- coding: utf-8 -*-
2
2
from typing import List
3
3
4
- import numpy as np
5
- from typing import List
6
-
7
4
import numpy as np
8
5
from modelcache .manager .vector_data .base import VectorBase , VectorData
9
6
from modelcache .utils import import_redis
10
7
from redis .commands .search .query import Query
11
8
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
14
10
15
11
import_redis ()
16
12
#
21
17
22
18
23
19
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
- """
48
20
def __init__ (
49
21
self ,
50
22
host : str = "localhost" ,
You can’t perform that action at this time.
0 commit comments