Improvements to Graph Memory (#1779)

This commit is contained in:
Prateek Chhikara
2024-08-29 22:17:08 -07:00
committed by GitHub
parent 28bc4fe05b
commit 822a8acedb
10 changed files with 246 additions and 79 deletions

View File

@@ -78,3 +78,66 @@ NOOP_TOOL = {
}
}
}
ADD_MESSAGE_TOOL = {
"type": "function",
"function": {
"name": "add_query",
"description": "Add new entities and relationships to the graph based on the provided query.",
"strict": True,
"parameters": {
"type": "object",
"properties": {
"entities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source_node": {"type": "string"},
"source_type": {"type": "string"},
"relation": {"type": "string"},
"destination_node": {"type": "string"},
"destination_type": {"type": "string"}
},
"required": ["source_node", "source_type", "relation", "destination_node", "destination_type"],
"additionalProperties": False
}
}
},
"required": ["entities"],
"additionalProperties": False
}
}
}
SEARCH_TOOL = {
"type": "function",
"function": {
"name": "search",
"description": "Search for nodes and relations in the graph.",
"strict": True,
"parameters": {
"type": "object",
"properties": {
"nodes": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of nodes to search for."
},
"relations": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of relations to search for."
}
},
"required": ["nodes", "relations"],
"additionalProperties": False
}
}
}