mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-27 17:36:23 +02:00
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:
parent
a70ae9793a
commit
3b8b9ea866
23 changed files with 800 additions and 986 deletions
|
|
@ -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],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue