【问题标题】:Twilio Autopilot Python quickstart tutorialTwilio Autopilot Python 快速入门教程
【发布时间】:2019-06-30 20:40:08
【问题描述】:

我正在尝试遵循以下 Twilio Autopilot 教程https://www.twilio.com/docs/autopilot/quickstart/python?code-sample=code-create-your-first-assistant-with-autopilot-7&code-language=Python&code-sdk-version=6.x

我正在尝试使用自动驾驶仪以及我自己的 account_sid 和 auth_token 创建我的第一个助手。

# Download the helper library from 
https://www.twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/console
# DANGER! This is insecure. See http://twil.io/secure
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

assistant = client.autopilot \
              .assistants \
              .create(
                   friendly_name='Quickstart Assistant',
                   unique_name='quickstart-assistant'
               )

print(assistant.sid) 

但是当我尝试执行脚本时收到以下错误。

【问题讨论】:

    标签: python twilio


    【解决方案1】:

    这里是 Twilio 开发者宣传员。

    您是否偶然多次运行此脚本? unique_name 必须是唯一的,因此如果您运行脚本两次而不更改该值,则第二次尝试将失败。

    我尝试运行您发布的代码示例(使用我自己的帐户凭据),它第一次运行,但第二次失败,出现与您收到的完全相同的错误消息 (35002)。将unique_name的值改为quickstart-assistant-2,脚本再次运行成功。

    如果您可以登录 Twilio,您应该能够看到 list of autopilot assistants you have created,它会告诉您是否能够在第一次尝试时成功创建助手。

    如果您有任何其他问题或问题,请告诉我。

    【讨论】:

      猜你喜欢
      • 2011-04-18
      • 2023-03-31
      • 1970-01-01
      • 2013-04-10
      • 1970-01-01
      • 2017-04-26
      • 2010-09-08
      • 1970-01-01
      • 2018-04-26
      相关资源
      最近更新 更多