mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-20 21:05:13 +02:00
Feature / collections (#96)
* Update schema defs for source -> metadata * Migrate to use metadata part of schema, also add metadata to triples & vecs * Add user/collection metadata to query * Use user/collection in RAG * Write and query working on triples
This commit is contained in:
parent
709221fa10
commit
b0f4c58200
31 changed files with 459 additions and 251 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
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,12 @@ class GraphRagClient(BaseClient):
|
|||
output_schema=GraphRagResponse,
|
||||
)
|
||||
|
||||
def request(self, query, timeout=500):
|
||||
def request(
|
||||
self, query, user="trustgraph", collection="default",
|
||||
timeout=500
|
||||
):
|
||||
|
||||
return self.call(
|
||||
query=query, timeout=timeout
|
||||
user=user, collection=collection, query=query, timeout=timeout
|
||||
).response
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue