Skip to content
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

Open
amaboura opened this issue Oct 25, 2016 · 2 comments
Open

Couldn't return the response #19

amaboura opened this issue Oct 25, 2016 · 2 comments

Comments

@amaboura
Copy link

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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: YeniHRaduRn5dVzhK3L0cLTc2tMeqLaoPNhby3N9Zk6j-PQkOF8lPg==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: JAJeScxuDj-X97YHn_piTfMWNak8XxVvI7EScppuwUgJO4IkwwMo8Q==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>

Note that:

  • I get the json response if the query is assigned to one of the predefined domains (eg: Smalltalk)
  • I'm sending the request from within an HTTP method

Any ideas ?

@sstepashka
Copy link
Contributor

Hi @amaboura,
Please send me example of your code for reproduce an issue and maybe you account email, I'll check your agent...

@amaboura
Copy link
Author

amaboura commented Oct 26, 2016

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:

  • type say my name , should get you a JSON response
  • type say my name out loud, should get you also a JSON response
  • type find nexus, should get you the error i referred to above

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants