from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

phrases = [
    'hello',
    'hi',
    'Hello',
    'Hi there'
]

# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/autopilot/list
# Replace 'UDXXX...' with the SID for the task you just created.
for phrase in phrases:
    sample = client.autopilot \
        .assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
        .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
        .samples \
        .create(language='en-us', tagged_text=phrase)

    print(sample.sid)

from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

phrases = [
    'hello',
    'hi',
    'Hello',
    'Hi there'
]

# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/autopilot/list
for phrase in phrases:
    sample = client.autopilot \
        .assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
        .tasks('hello-world') \
        .samples \
        .create(language='en-us', tagged_text=phrase)

    print(sample.sid)

Update to use unique_name for task update
Update to use unique_name for task update
  from twilio.rest import Client
  
  # Your Account Sid and Auth Token from twilio.com/console
  account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  auth_token = 'your_auth_token'
  client = Client(account_sid, auth_token)
  
  phrases = [
      'hello',
      'hi',
      'Hello',
      'Hi there'
  ]
  
  # Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/autopilot/list
- # Replace 'UDXXX...' with the SID for the task you just created.
  for phrase in phrases:
      sample = client.autopilot \
          .assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
-         .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
+         .tasks('hello-world') \
          .samples \
          .create(language='en-us', tagged_text=phrase)
  
      print(sample.sid)
  
Update to use unique_name for task update
## Code Before:
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

phrases = [
    'hello',
    'hi',
    'Hello',
    'Hi there'
]

# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/autopilot/list
# Replace 'UDXXX...' with the SID for the task you just created.
for phrase in phrases:
    sample = client.autopilot \
        .assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
        .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
        .samples \
        .create(language='en-us', tagged_text=phrase)

    print(sample.sid)

## Instruction:
Update to use unique_name for task update
## Code After:
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

phrases = [
    'hello',
    'hi',
    'Hello',
    'Hi there'
]

# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/autopilot/list
for phrase in phrases:
    sample = client.autopilot \
        .assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
        .tasks('hello-world') \
        .samples \
        .create(language='en-us', tagged_text=phrase)

    print(sample.sid)
