【问题标题】:Alexa - Python, There was an error calling the remote endpoint, which returned HTTP 404 : NOT FOUNDAlexa - Python,调用远程端点时出错,返回 HTTP 404:未找到
【发布时间】:2017-01-26 13:16:44
【问题描述】:

我正在使用带有 python 的烧瓶来开发我的代码,用于获取 Wikipedia 数据的 Alexa 技能。我也在使用 Python 的维基百科库。

每次我尝试测试我的技能时,服务模拟器都会出错。请帮我找出错误。

“调用远程端点时出错,返回 HTTP 404 : NOT FOUND”

from flask import Flask
from flask_ask import Ask, statement, question, session
import json
import requests
import time
import unidecode
import wikipedia


app = Flask(__name__)
ask = Ask(app,"/wiki_reader")

def get_wikisummary(searchitem):
    summ=wikipedia.summary(searchitem,sentences=3)
    sober=[unidecode.unidecode(summ)]
    return sober

@app.route('/')
def homepage():
    return "hi there, how ya doin?"

@ask.launch
    def start_skill():
    welcome_message='Hi, ask me about any country of the World'
    return question(welcome_message)

@ask.intent("AnswerIntent")
def answer(ans):
    summ1=get_wikisummary(ans)
    summ2=[unidecode.unidecode(summ1)]
    return statement("{}",format(summ2))

if __name__=='__main__':
    app.run(debug=True)

我正在使用 ngrok 在我的机器上托管当前托管在 localhost 上的代码。

【问题讨论】:

    标签: python http-status-code-404 alexa ngrok alexa-slot


    【解决方案1】:

    我刚刚发现我试图在一个端口上运行多个代码。这就是它给出未找到错误的原因。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-26
      • 1970-01-01
      • 1970-01-01
      • 2010-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多