You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please provide either the `url`, or `host` and `port`.
23
-
24
-
Args:
25
-
host: host on which `VectorStoreServer </developers/api-docs/pathway-xpacks-llm/vectorstore#pathway.xpacks.llm.vector_store.VectorStoreServer>`_ listens
26
-
port: port on which `VectorStoreServer </developers/api-docs/pathway-xpacks-llm/vectorstore#pathway.xpacks.llm.vector_store.VectorStoreServer>`_ listens
27
-
url: url at which `VectorStoreServer </developers/api-docs/pathway-xpacks-llm/vectorstore#pathway.xpacks.llm.vector_store.VectorStoreServer>`_ listens
28
-
timeout: timeout for the post requests in seconds
29
-
"""# noqa
30
-
31
-
def__init__(
32
-
self,
33
-
host: str|None=None,
34
-
port: int|None=None,
35
-
url: str|None=None,
36
-
timeout: int|None=180,
37
-
additional_headers: dict|None=None,
38
-
):
39
-
err="Either (`host` and `port`) or `url` must be provided, but not both."
40
-
ifurlisnotNone:
41
-
ifhostorport:
42
-
raiseValueError(err)
43
-
self.url=url
44
-
else:
45
-
ifhostisNone:
46
-
raiseValueError(err)
47
-
port=portor80
48
-
self.url=f"http://{host}:{port}"
49
-
50
-
self.timeout=timeout
51
-
self.additional_headers=additional_headersor {}
52
-
53
-
defquery(
54
-
self,
55
-
query: str,
56
-
k: int=3,
57
-
metadata_filter: str|None=None,
58
-
filepath_globpattern: str|None=None,
59
-
) ->list[dict]:
60
-
"""
61
-
Perform a query to the vector store and fetch results.
62
-
63
-
Args:
64
-
query:
65
-
k: number of documents to be returned
66
-
metadata_filter: optional string representing the metadata filtering query
67
-
in the JMESPath format. The search will happen only for documents
68
-
satisfying this filtering.
69
-
filepath_globpattern: optional glob pattern specifying which documents
0 commit comments