Add Flow ID to all relevant CLIs, not completely implemented

This commit is contained in:
Cyber MacGeddon 2025-05-03 00:17:07 +01:00
parent 4e8f004410
commit 031da4842d
12 changed files with 75 additions and 14 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, system, prompt):
api = Api(url)
resp = api.text_completion(system=system, prompt=prompt)
resp = api.flow(flow).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],
)