# 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
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

# Provide actions for your assistant: say something and listen for a repsonse.
update_action = {
    'actions': [
        {'say': 'Hi there, I\'m your virtual assistant! How can I help you?'},
        {'listen': True}
    ]
}

# Update the default intent to use your new actions.
# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/assistant/list
client.preview.understand \
    .assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
    .intents('hello-world') \
    .intent_actions().update(update_action)

print("Intent actions updated")

# 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
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

assistant_sid = 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

# Provide actions for your assistant: say something and listen for a repsonse.
update_action = {
    'actions': [
        {'say': 'Hi there, I\'m your virtual assistant! How can I help you?'},
        {'listen': True}
    ]
}

# Update the default intent to use your new actions.
client.preview.understand \
    .assistants(assistant_sid) \
    .intents('hello-world') \
    .intent_actions().update(update_action)

print("Intent actions updated")

--- 
+++ 
@@ -5,8 +5,6 @@
 account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
 auth_token = 'your_auth_token'
 client = Client(account_sid, auth_token)
-
-assistant_sid = 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
 
 # Provide actions for your assistant: say something and listen for a repsonse.
 update_action = {
@@ -17,8 +15,9 @@
 }
 
 # Update the default intent to use your new actions.
+# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/assistant/list
 client.preview.understand \
-    .assistants(assistant_sid) \
+    .assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
     .intents('hello-world') \
     .intent_actions().update(update_action)
 
Update intent actions to use assistant SID inline

Maintaining consistency with the auto-generated code samples for Understand, which 
don't allow for our variable-named placeholder values