<commit_before># 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 = '<KEY>'
auth_token = '<PASSWORD>'
client = Client(account_sid, auth_token)

assistant_sid = 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
# Create a new intent named 'tell_a_joke'
intent = client.preview.understand \
                       .assistants(assistant_sid) \
                       .intents \
                       .create(unique_name='tell-a-joke')

# Provide actions for the new intent
joke_actions = {
    'actions': [
        {'say': 'I was going to look for my missing watch, but I could never find the time.'}
    ]
}

# Update the tell-a-joke intent to use this 'say' action.
client.preview.understand \
    .assistants(assistant_sid) \
    .intents(intent.sid) \
    .intent_actions().update(joke_actions)

print(intent.sid)<commit_msg>Update to use assistant SID inline<commit_after># 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 = '<KEY>'
auth_token = '<PASSWORD>'
client = Client(account_sid, auth_token)

# Create a new intent named 'tell_a_joke'
# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/assistant/list
intent = client.preview.understand \
                       .assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
                       .intents \
                       .create(unique_name='tell-a-joke')

# Provide actions for the new intent
joke_actions = {
    'actions': [
        {'say': 'I was going to look for my missing watch, but I could never find the time.'}
    ]
}

# Update the tell-a-joke intent to use this 'say' action.
client.preview.understand \
    .assistants(assistant_sid) \
    .intents(intent.sid) \
    .intent_actions().update(joke_actions)

print(intent.sid)
{'fraction_non_alphanumeric': 0.10723318158826504, 'fraction_numerical': 0.0, 'mean_word_length': 3.036734693877551, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 3, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7249301', 'n_tokens_mistral': 611, 'n_tokens_neox': 592, 'n_words': 166}