System messages for email assistant
Redwood Consulting handles C-suite clients who expect fast and clear emails. The new AI email assistant you're developing must use a concise tone, always include a subject, be brief, and close with actionable steps. Setting these rules once in a system message will save hundreds of keystrokes, and keep the brand voice rock-solid.
The anthropic library, client, and email_request prompt are pre-loaded.
Este exercício faz parte do curso
Introduction to Claude Models
Instruções do exercício
- Write a system message that defines the email assistant's behavior as professional and limits it to 150 words.
- Pass in the
system_msgas a parameter. - Pass the complete
messagesarray to the API call.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Create system message for email assistant behavior
system_msg = ____
messages = [
{"role": "user", "content": email_request}]
# Make API call with system message applied
response = client.messages.create(
model="claude-3-7-sonnet-latest", max_tokens=75, system=____,
# Pass in the messages array
messages=____)
print(response.content[0].text)