Feature/flow api 3 (#358)

* Working mux socket

* Change API to incorporate flow

* Add Flow ID to all relevant CLIs, not completely implemented

* Change tg-processor-state to use API gateway

* Updated all CLIs

* New tg-show-flow-state command

* tg-show-flow-state shows classes too
This commit is contained in:
cybermaggedon 2025-05-03 10:39:53 +01:00 committed by GitHub
parent a70ae9793a
commit 3b8b9ea866
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 800 additions and 986 deletions

View file

@ -16,11 +16,11 @@ from trustgraph.api import Api
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
def query(url, template_id, variables):
def query(url, flow_id, template_id, variables):
api = Api(url)
resp = api.prompt(id=template_id, variables=variables)
resp = api.flow(flow_id).prompt(id=template_id, variables=variables)
if isinstance(resp, str):
print(resp)
@ -40,6 +40,12 @@ def main():
help=f'API URL (default: {default_url})',
)
parser.add_argument(
'-f', '--flow-id',
default="0000",
help=f'Flow ID (default: 0000)'
)
parser.add_argument(
'id',
metavar='template-id',
@ -77,6 +83,7 @@ specified multiple times''',
query(
url=args.url,
flow_id=args.flow_id,
template_id=args.id[0],
variables=variables,
)