Extend use of user + collection fields (#503)

* Collection+user fields in structured query

* User/collection in structured query & agent
This commit is contained in:
cybermaggedon 2025-09-08 18:28:38 +01:00 committed by GitHub
parent a92050c411
commit f22bf13aa6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 122 additions and 45 deletions

View file

@ -132,11 +132,15 @@ class FlowInstance:
input
)["response"]
def agent(self, question):
def agent(self, question, user="trustgraph", state="", group=None, history=None):
# The input consists of a question
# The input consists of a question and optional context
input = {
"question": question
"question": question,
"user": user,
"state": state,
"group": group or [],
"history": history or []
}
return self.request(
@ -456,20 +460,24 @@ class FlowInstance:
return response
def structured_query(self, question):
def structured_query(self, question, user="trustgraph", collection="default"):
"""
Execute a natural language question against structured data.
Combines NLP query conversion and GraphQL execution.
Args:
question: Natural language question
user: Cassandra keyspace identifier (default: "trustgraph")
collection: Data collection identifier (default: "default")
Returns:
dict with data and optional errors
"""
input = {
"question": question
"question": question,
"user": user,
"collection": collection
}
response = self.request(