mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-26 00:46:22 +02:00
Fix/agent groups broken (#504)
* Fix non-backward-compatible agent changes * Fix broken agents
This commit is contained in:
parent
f22bf13aa6
commit
5867f45c3a
3 changed files with 31 additions and 11 deletions
|
|
@ -132,16 +132,24 @@ class FlowInstance:
|
|||
input
|
||||
)["response"]
|
||||
|
||||
def agent(self, question, user="trustgraph", state="", group=None, history=None):
|
||||
def agent(self, question, user="trustgraph", state=None, group=None, history=None):
|
||||
|
||||
# The input consists of a question and optional context
|
||||
input = {
|
||||
"question": question,
|
||||
"user": user,
|
||||
"state": state,
|
||||
"group": group or [],
|
||||
"history": history or []
|
||||
}
|
||||
|
||||
# Only include state if it has a value
|
||||
if state is not None:
|
||||
input["state"] = state
|
||||
|
||||
# Only include group if it has a value
|
||||
if group is not None:
|
||||
input["group"] = group
|
||||
|
||||
# Always include history (empty list if None)
|
||||
input["history"] = history or []
|
||||
|
||||
return self.request(
|
||||
"service/agent",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue