mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 03:31:02 +02:00
Hacking wth graph rag
This commit is contained in:
parent
5f9481dfed
commit
179285e186
5 changed files with 28 additions and 13 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue