Skip to content

Commit

Permalink
use assistant's api instance for intents and entites comamnds
Browse files Browse the repository at this point in the history
  • Loading branch information
treethought committed Apr 30, 2018
1 parent 2497394 commit 5b0cddf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions api_ai/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ def gen_templates():

def intents():
logger.info('Getting Registered Intents...')
intents = api.agent_intents
filename = file_from_args()
assist = get_assistant(filename)
intents = assist.api.agent_intents
for i in intents:
logger.info(i.name)
return intents


def entities():
logger.info('Getting Registered Entities...')
ents = api.agent_entities
filename = file_from_args()
assist = get_assistant(filename)
ents = assist.api.agent_entities
for i in ents:
logger.info(i.name)
return ents
Expand Down Expand Up @@ -90,7 +94,7 @@ def query():

while True:
q = input('Enter query...\n')
resp = api.post_query(q).json()
resp = assist.api.post_query(q).json()
try:
print('Matched: {}'.format(resp['result']['metadata']['intentName']))
print('Params: {}'.format(resp['result']['parameters']))
Expand Down

0 comments on commit 5b0cddf

Please sign in to comment.