mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-17 09:11:03 +02:00
Use user/collection in RAG
This commit is contained in:
parent
ac91df91d0
commit
44b1d43989
9 changed files with 182 additions and 136 deletions
|
|
@ -38,8 +38,12 @@ class GraphEmbeddingsClient(BaseClient):
|
|||
output_schema=GraphEmbeddingsResponse,
|
||||
)
|
||||
|
||||
def request(self, vectors, limit=10, timeout=300):
|
||||
def request(
|
||||
self, vectors, user="trustgraph", collection="default",
|
||||
limit=10, timeout=300
|
||||
):
|
||||
return self.call(
|
||||
user=user, collection=collection,
|
||||
vectors=vectors, limit=limit, timeout=timeout
|
||||
).entities
|
||||
|
||||
|
|
|
|||
|
|
@ -48,11 +48,18 @@ class TriplesQueryClient(BaseClient):
|
|||
|
||||
return Value(value=ent, is_uri=False)
|
||||
|
||||
def request(self, s, p, o, limit=10, timeout=60):
|
||||
def request(
|
||||
self,
|
||||
s, p, o,
|
||||
user="trustgraph", collection="default",
|
||||
limit=10, timeout=60,
|
||||
):
|
||||
return self.call(
|
||||
s=self.create_value(s),
|
||||
p=self.create_value(p),
|
||||
o=self.create_value(o),
|
||||
user=user,
|
||||
collection=collection,
|
||||
limit=limit,
|
||||
timeout=timeout,
|
||||
).triples
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ graph_embeddings_store_queue = topic('graph-embeddings-store')
|
|||
class GraphEmbeddingsRequest(Record):
|
||||
vectors = Array(Array(Double()))
|
||||
limit = Integer()
|
||||
user = String()
|
||||
collection = String()
|
||||
|
||||
class GraphEmbeddingsResponse(Record):
|
||||
error = Error()
|
||||
|
|
@ -56,6 +58,8 @@ class TriplesQueryRequest(Record):
|
|||
p = Value()
|
||||
o = Value()
|
||||
limit = Integer()
|
||||
user = String()
|
||||
collection = String()
|
||||
|
||||
class TriplesQueryResponse(Record):
|
||||
error = Error()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue