4. Providing context and assigning roles

One of the most effective ways to improve responses: providing relevant context and assigning a specific role.

The power of context

AIs work better when they understand the full picture. Context lets them adjust the technical level, use an appropriate tone, and prioritize relevant information.

Assigning roles

Without a role:

How can I improve my business's sales?

With a role:

Act as a business consultant with 20 years of experience in fashion retail. I have a women's clothing boutique in the center of a mid-sized city. Sales have dropped 30% over the last six months. What strategies do you recommend?

Types of effective roles

Professional roles:

Act as a lawyer specializing in intellectual property... You are a software architect with experience in distributed systems...

Teaching roles:

You are a patient tutor teaching math to high school students... Act as a language teacher specializing in practical conversation...

Combining a role with specific characteristics

Basic role:

Act as a personal trainer.

Detailed role:

Act as a certified personal trainer with 15 years of experience working with people over 50. Your specialty is helping busy clients stay fit with 30-minute routines. Your approach prioritizes injury prevention over quick results.

Complete example

Act as a personal financial advisor. I'm 28 years old, I work as a freelance designer with variable income (€1,500-3,000 per month), no debt but no savings either. I want to save to buy an apartment in 5 years. What saving and investment strategy do you recommend given the irregularity of my income?

Providing rich context and assigning specific roles transforms responses from generic to personalized. The AI adjusts its technical level, tone, and approach when it understands who you are and what situation you're in.

Now that you have mastered clarity, context, and roles, it is time to structure your prompts to avoid confusion. When you work with external data or content you want to process, keeping it separate from your instructions makes the difference between precision and chaos. That is exactly what we will look at next.

Building SPAs with Django and HTML Over the Wire: Learn to build real-time single page applications with Python

Building SPAs with Django and HTML Over the Wire: Learn to build real-time single page applications with Python

The HTML over WebSockets approach simplifies single-page application (SPA) development and lets you bypass learning a JavaScript rendering framework such as React, Vue, or Angular, moving the logic to Python. This web application development book provides you with all the Django tools you need to simplify your developments with real-time results.

Buy the book

Help me keep writing

Every coffee gives me a push toward the next article.

Comments

There are no comments yet.