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

@ -12,11 +12,11 @@ from trustgraph.api import Api
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
def query(url, system, prompt):
def query(url, flow_id, system, prompt):
api = Api(url)
resp = api.text_completion(system=system, prompt=prompt)
resp = api.flow(flow_id).text_completion(system=system, prompt=prompt)
print(resp)
@ -44,12 +44,12 @@ def main():
nargs=1,
help='LLM prompt e.g. What is 2 + 2?',
)
# parser.add_argument(
# '--pulsar-api-key',
# default=default_pulsar_api_key,
# help=f'Pulsar API key',
# )
parser.add_argument(
'-f', '--flow-id',
default="0000",
help=f'Flow ID (default: 0000)'
)
args = parser.parse_args()
@ -57,6 +57,7 @@ def main():
query(
url=args.url,
flow = args.flow_id,
system=args.system[0],
prompt=args.prompt[0],
)