Feature/knowledge load (#372)

* Switch off retry in Cassandra until we can differentiate retryable errors

* Fix config getvalues

* Loading knowledge cores works
This commit is contained in:
cybermaggedon 2025-05-08 00:41:45 +01:00 committed by GitHub
parent fdd9a9a9ae
commit 31b7ade44d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 356 additions and 548 deletions

View file

@ -39,3 +39,29 @@ class Knowledge:
self.request(request = input)
def load_kg_core(self, id, user="trustgraph", flow="0000",
collection="default"):
# The input consists of system and prompt strings
input = {
"operation": "load-kg-core",
"user": user,
"id": id,
"flow": flow,
"collection": collection,
}
self.request(request = input)
def unload_kg_core(self, id, user="trustgraph", flow="0000"):
# The input consists of system and prompt strings
input = {
"operation": "unload-kg-core",
"user": user,
"id": id,
"flow": flow,
}
self.request(request = input)

View file

@ -25,14 +25,22 @@ from . graph import Triples, GraphEmbeddings
class KnowledgeRequest(Record):
# get-kg-core, delete-kg-core, list-kg-cores, put-kg-core
# load-kg-core, unload-kg-core
operation = String()
# list-kg-cores, delete-kg-core, put-kg-core
user = String()
# get-kg-core, list-kg-cores, delete-kg-core, put-kg-core
# get-kg-core, list-kg-cores, delete-kg-core, put-kg-core,
# load-kg-core, unload-kg-core
id = String()
# load-kg-core
flow = String()
# load-kg-core
collection = String()
# put-kg-core
triples = Triples()
graph_embeddings = GraphEmbeddings()