Hacking wth graph rag

This commit is contained in:
Cyber MacGeddon 2025-04-21 18:52:52 +01:00
parent 5f9481dfed
commit 179285e186
5 changed files with 28 additions and 13 deletions

View file

@ -38,6 +38,18 @@ class PromptClient(RequestResponse):
variables = { "text": text }
)
async def kg_prompt(self, query, kg, timeout=600):
return await self.prompt(
id = "kg-prompt",
variables = {
"query": query,
"knowledge": [
{ "s": v[0], "p": v[1], "o": v[2] }
for v in kg
]
}
)
class PromptClientSpec(RequestResponseSpec):
def __init__(
self, request_name, response_name,