-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Couldn't return the response #19
Comments
Hi @amaboura, |
Here's the snippet that i have tried #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, request
import os.path
import sys
try:
import apiai
except ImportError:
sys.path.append(
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
)
import apiai
app = Flask(__name__)
CLIENT_ACCESS_TOKEN = "d8996d6ab4c541f29dc0fcb869c868bf"
def handle_query(query):
ai = apiai.ApiAI(CLIENT_ACCESS_TOKEN)
request = ai.text_request()
request.lang = 'en'
request.query = query
response = request.getresponse()
print (response.read())
#if __name__ == '__main__':
# handle_query("say my name")
# query example : find <something>
@app.route("/echo")
def hello():
query = request.args.get("q")
handle_query(query)
return "Echo back"
if __name__ == "__main__":
app.run(debug=True) @sstepashka FYI I've got few intents for my agent, here are the steps to reproduce the issue:
Note that the above queries work fine in the API console. here is a screen capture from my terminal : https://asciinema.org/a/2ab0imh7lbfmf35nbaezwmfic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
There is a weird response behavior that i could't understand, when i try to send a query that matches one of my custom intents, i get the following error
Note that:
Any ideas ?
The text was updated successfully, but these errors were encountered: