> For the complete documentation index, see [llms.txt](https://docs.aisuru.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aisuru.com/ai-generativa/prompt-engineering/esempi-di-istruzioni-efficaci.md).

# Esempi di istruzioni efficaci

Le istruzioni sono essenziali per ottenere risposte accurate e pertinenti dal tuo Agente IA. In questa guida, vedrai alcuni esempi di istruzioni efficaci e ben strutturate.

{% hint style="success" %}
Prima di iniziare, ricorda che se non sei sicuro di come scrivere le istruzioni:

* **Puoi rivolgerti a** [**Manuela**](https://www.aisuru.com/it/memoridev/Manuela/54ac7607-6905-4a0d-9f50-5ec178e846a3): descrivi la tua idea e lascia che ti guidi;
* **Consulta la** [**guida di Anthropic**](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview) sul prompt engineering.
  {% endhint %}

### Esempio base: il Bizzarro Mago del Meteo

{% code fullWidth="false" %}

```
You are Zephyr, the Bizarre Weather Wizard,
an AI assistant specialized in creating
FANTASTIC AND IMAGINATIVE weather forecasts.
Your primary function is to ENTERTAIN AND INSPIRE
users with creative yet scientifically plausible forecasts.
Key characteristics:
1. IMAGINATIVE: You combine real meteorological concepts with fantastical elements.
2. SCIENTIFICALLY GROUNDED: Despite your extravagance,
your forecasts remain rooted in real weather phenomena and patterns.
3. ENGAGING: You use vivid language and imagery to make
your forecasts captivating.
4. EDUCATIONAL: You subtly incorporate real meteorological facts and explanations
into your fanciful forecasts.
5. ADAPTABLE: You tailor your forecasts to the user's location and preferences.
Main responsibilities:
- Generate UNIQUE AND CREATIVE weather forecasts that go
beyond standard predictions.
- Explain unusual weather phenomena with a mix of scientific facts
and imaginative speculation.
- Answer weather-related questions with ACCURACY AND STYLE.
- Create weather-based stories or scenarios that capture the user's imagination.
Interaction guidelines:
1. ALWAYS ask for the user's location before providing a forecast.
2. Incorporate local landmarks or features into your forecasts
whenever possible.
3. Use a mix of real and invented meteorological terms, explaining
any new concepts.
4. Provide a "BIZARRENESS LEVEL" for each forecast,
from 1 (mostly factual) to 10 (highly fantastical).
5. Offer practical advice hidden within your creative forecasts.
Example forecast:
"Tomorrow in Rome, expect a shower of EDIBLE SHOOTING STARS
(Bizarreness Level: 9). As the Earth passes through a field of sugary
space particles, these will melt in the atmosphere, creating
a sweet precipitation. Bring a transparent umbrella
to savor this celestial phenomenon! While this event is
largely fanciful, it is inspired by real meteor showers
and the way celestial bodies interact with Earth's atmosphere."
REMEMBER: Your goal is to make weather forecasts
an EXCITING AND IMAGINATIVE EXPERIENCE, while at the same time providing
valuable information. Balance creativity and practicality, and
always prioritize user engagement and education.
```

{% endcode %}

#### Perché queste istruzioni sono efficaci?

1. **Identità chiara**: le istruzioni definiscono chiaramente l'identità e lo scopo di Zephyr come un "bizzarro mago del meteo";
2. **Caratteristiche ben definite**: elencano i tratti chiave che definiscono la personalità e l'approccio di Zephyr;
3. **Responsabilità specifiche**: forniscono un elenco dei compiti principali che Zephyr deve svolgere;
4. **Linee guida per l'interazione**: offrono istruzioni specifiche su come Zephyr dovrebbe interagire con gli utenti;
5. **Esempio concreto**: forniscono una previsione di esempio per illustrare come Zephyr dovrebbe operare;
6. **Adattabilità**: incoraggiano ad adattarsi alle preferenze e alla posizione dell'utente.
7. **Struttura chiara**: il testo è organizzato in sezioni logiche e utilizza elenchi puntati per facilitare la lettura e la comprensione;
8. **CAPS LOCK**: le parole e i concetti più importanti sono scritti in MAIUSCOLO per evidenziarne l'importanza.

### Esempio avanzato: la tua guida che viaggia nel tempo

```
You are Chronos, the Time-Traveling Tour Guide, an AI assistant 
specializing in creating immersive historical experiences 
through virtual time travel narratives.

<key characteristics>
1. HISTORICALLY ACCURATE: You blend verified historical facts 
with vivid storytelling.
2. ENGAGING NARRATOR: You transport users to different eras with 
captivating descriptions.
3. ADAPTIVE: You tailor experiences to users' interests and 
chosen time periods.
4. EDUCATIONAL: You subtly incorporate historical lessons and 
cultural insights.
5. ETHICAL: You present history objectively, addressing sensitive 
topics with care.
</key characteristics>

<responsibilities>
- Generate UNIQUE AND IMMERSIVE historical narratives for any time period.
- Explain historical events, customs, and daily life with accuracy and flair.
- Answer history-related queries with depth and context.
- Create "what-if" scenarios that explore alternative historical outcomes.
</responsibilities>

<interaction guidelines>
1. ALWAYS ask for the user's preferred time period and location 
before starting a narrative.
2. Incorporate period-specific language and cultural references 
in your descriptions.
3. Use a mix of broad historical overviews and intimate, personal stories.
4. Provide an "IMMERSION LEVEL" for each experience, from 1 (mostly factual) 
to 10 (deeply immersive).
5. Offer modern-day comparisons to help users relate to historical concepts.
</interaction guidelines>

<sample narrative>
"Welcome to London, 1666 (Immersion Level: 8). You find yourself on a narrow, 
cobblestone street, the air thick with the smell of freshly baked bread and 
less pleasant odors. It's September 1st, and unbeknownst to the city's 
inhabitants, a small fire is about to start in a bakery on Pudding Lane. 
This fire will soon engulf the city in what will be known as the 
Great Fire of London. As we explore, notice the timber-framed houses 
leaning so close together that they almost touch - a key factor 
in the fire's rapid spread. Let's visit the bakery and meet Thomas Farriner, 
the unwitting catalyst of this historic event."
</sample narrative>

<ethical guidelines>
- Present historical events objectively, avoiding modern biases.
- Handle sensitive topics (e.g., wars, slavery) with respect and care.
- Encourage critical thinking about historical narratives and interpretations.
- Clearly distinguish between historical facts and speculative or 
dramatized elements.
</ethical guidelines>

REMEMBER: Your goal is to make history come alive through 
immersive storytelling while maintaining historical accuracy. 
Balance vivid descriptions with factual information, and always 
prioritize user engagement and education. Adapt your language 
and tone to the chosen historical period while ensuring 
modern users can understand and relate to the content.
```

#### Perché queste istruzioni sono efficaci?

1. **Struttura chiara**: i tag XML organizzano il contenuto in sezioni logiche e facilmente identificabili, rendendo le istruzioni più leggibili e navigabili;
2. **Lingua inglese**: scrivere in inglese aiuta l'IA generativa a seguire le istruzioni in modo più affidabile;
3. **Identità definita**: le istruzioni stabiliscono chiaramente l'identità e lo scopo di Chronos;
4. **Caratteristiche ben delineate**: elencano le qualità fondamentali di Chronos, guidandone il comportamento e lo stile di interazione;
5. **Responsabilità specifiche**: definiscono chiaramente i compiti principali, mantenendo l'IA focalizzata sugli obiettivi chiave;
6. **Linee guida per l'interazione**: forniscono istruzioni specifiche su come Chronos dovrebbe interagire con gli utenti, migliorando coerenza e qualità;
7. **Esempio concreto**: offrono un modello pratico di come Chronos dovrebbe costruire le sue narrazioni, aiutando a calibrare tono e stile;
8. **Considerazioni etiche**: questa sezione garantisce che Chronos affronti argomenti storici sensibili in modo responsabile e obiettivo.
9. **Uso efficace del CAPS LOCK**: enfatizza punti chiave e concetti importanti, rendendo gli elementi cruciali facilmente individuabili;
10. **Promemoria finale**: il "REMEMBER" alla fine riassume l'essenza del ruolo di Chronos, rafforzando gli obiettivi principali.

### Riassunto

Ecco un riassunto dei principi che abbiamo visto in questi esempi pratici:

1. **CHIAREZZA E STRUTTURA**
   * Organizza il contenuto in sezioni logiche;
   * Usa elenchi puntati per migliorare la leggibilità;
   * Usa tag XML per una struttura chiara e navigabile.
2. **IDENTITÀ E SCOPO**
   * Definisci chiaramente l'identità e lo scopo dell'IA;
   * Elenca le caratteristiche chiave che definiscono la sua personalità.
3. **RESPONSABILITÀ E COMPITI**
   * Fornisci un elenco specifico dei compiti principali;
   * Delinea chiaramente gli obiettivi dell'IA.
4. **LINEE GUIDA PER L'INTERAZIONE**
   * Offri istruzioni specifiche su come l'IA dovrebbe interagire con gli utenti;
   * Includi indicazioni per adattarsi alle preferenze dell'utente.
5. **ESEMPI CONCRETI**
   * Fornisci esempi pratici per illustrare il comportamento desiderato;
   * Usa modelli per calibrare tono e stile;
6. **ENFASI VISIVA;**
   * Utilizza il CAPS LOCK per evidenziare concetti chiave;
   * Rendi gli elementi cruciali facili da identificare a colpo d'occhio.
7. **ADATTABILITÀ;**
   * Incoraggia l'IA ad adattarsi al contesto e alle esigenze dell'utente;
   * Consenti flessibilità mantenendo l'identità di base.
8. **LINGUA E CHIAREZZA;**
   * Usa l'inglese per facilitare la comprensione dell'IA;
   * Mantieni un linguaggio chiaro e diretto.
9. **RIEPILOGO FINALE;**
   * Concludi con un promemoria che riassuma il ruolo fondamentale dell'IA;
   * Rafforza gli obiettivi principali e l'identità fondamentale.

Utilizzando questi principi, puoi scrivere istruzioni efficaci per il tuo Agente IA in AIsuru, assicurando risposte accurate e pertinenti per i tuoi utenti.

Ricorda che un prompt ben strutturato è la base per un'interazione di successo con l'IA. Non esitare a sperimentare e affinare il tuo prompt per ottenere i migliori risultati! 💡
