将 AWS Lex 集成到网站(lambda 在 python 运行时实现)

Integrate AWS Lex to website(lambda implemented in python runtime)

我正在开发一个机器人,想为我的项目集成到一个网站上。我的机器人功能齐全,在 python 运行时编码的 lambda 实现。我看到 example 如何集成在 javascript(lambda 节点运行时)中实现的机器人,但找不到 python 实现的帮助。

我的机器人是否需要在 javascript(lambda 节点运行时)中实施才能与网站集成?

我对 UI 的东西不是很熟悉,如果能帮助我入门,我将不胜感激。

您的机器人可以用任何语言编写,并且仍然可以与网站集成。

您可以使用 AWS SDK 访问机器人或 HTTPS 调用。

来自 documentationHTTPS 调用:

POST /bot/botName/alias/botAlias/user/userId/text HTTP/1.1
Content-type: application/json

{
   "inputText": "string",
   "requestAttributes": { 
      "string" : "string" 
   },
   "sessionAttributes": { 
      "string" : "string" 
   }
}

或者您可以使用 SDK。这可以通过 UI 层使用 JavaScript SDK; or through the website back-end, using the SDK that matches your backend. Here's the list of SDKs.

来完成

您将致电 these methods from the Lex SDK 以使用您的机器人。 PostContent发送语音,PostText发送文字。 response 将包含机器人响应。

希望对您有所帮助