A message is a greeting that the agent delivers to the user at the beginning of the conversation. It can be configured to use a different script depending on the date, day of the week, and/or time of the day. Our message will give the user a friendly greeting explaining what the weather agent can do for them.

You can create your greeting message using this sample code.

from syllable_sdk import CustomMessageCreateRequest, SyllableSDK

sdk = SyllableSDK(
api_key_header='your_key_here'
)

message = sdk.custom_messages.create(request=CustomMessageCreateRequest(
# The name of the message is used to reference it elsewhere in the system, so
# you should pick something that’s easily identifiable.
name='Weather greeting4',
# Default text that will be delivered at the beginning of a conversation with
# an agent using this message.
text='Hello! I\'m a weather agent. I can tell you the current weather in any city, or answer general questions about weather. What would you like to know?',
# You can also set up a message with time-based rules, so that depending on
# the timestamp at which the conversation begins, an agent can deliver a
# different message. We'll skip this for the tutorial, but if you want to
# know more, check out the docs linked below.
rules=[]
))

print(message)

Before you move on, note the ID of the message that you created, as you’ll need it later.

We now have all the required components to create our agent, which we’ll do in the next step. Click “Create an agent” below to continue the tutorial.

📚 Documentation References