

Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.

# Bonnes pratiques d'ordre général
<a name="prompting-best-practices"></a>

Les meilleures pratiques suivantes s'appliquent principalement aux modèles de texte Amazon Nova, mais vous pouvez les appliquer à d'autres modèles, en plus des meilleures pratiques spécifiques aux modalités.

Pour plus d'informations sur la manière de demander des entrées multimodales, reportez-vous à[Encourager les entrées multimodales](prompting-multimodal.md). Pour plus d'informations sur la procédure à suivre pour demander la saisie vocale, reportez-vous à[Invites de conversation vocale](sonic-system-prompts.md).

## Comprendre les rôles
<a name="understanding-roles"></a>

Les modèles Amazon Nova vous permettent de structurer les invites en utilisant trois rôles distincts : système, utilisateur et assistant.
+ **Système (facultatif)** — Bien que cela ne soit pas obligatoire, il établit les paramètres comportementaux globaux de l'assistant. Il peut également être utilisé pour fournir des instructions et des directives supplémentaires que l’utilisateur souhaite que le modèle respecte tout au long de la conversation.
+ **Utilisateur** : peut éventuellement transmettre le contexte, les tâches, les instructions et le résultat souhaité avec la requête de l'utilisateur.
+ **Assistant — Aide** à orienter le modèle vers la réponse prévue.

**Topics**
+ [Comprendre les rôles](#understanding-roles)
+ [Créez des instructions précises](create-precise-prompts.md)
+ [Mettre l’accent sur certaines sections de l’invite](prompting-bring-focus.md)
+ [Utilisation du rôle système](prompting-system-role.md)
+ [Fournir des exemples (invites à quelques essais)](prompting-provide-examples.md)
+ [Systèmes d’appel d’outils](prompting-tools-function.md)
+ [Techniques d'incitation avancées](advanced-prompting-techniques.md)

# Créez des instructions précises
<a name="create-precise-prompts"></a>

La rédaction de requêtes utilisateur spécifiques est cruciale dans l’ingénierie de requête. Des requêtes bien formulées permettent aux modèles de compréhension de texte Amazon Nova de générer des réponses précises et pertinentes. Pour créer de telles requêtes, il est essentiel de commencer par fournir des informations contextuelles dans la requête. Le contexte fourni aide à mieux situer le modèle en l’alignant sur des scénarios d’utilisateurs cibles clairs, améliorant ainsi la pertinence et la cohérence du résultat.

## Fournir des informations contextuelles et spécifiques
<a name="prompting-specific-info"></a>

Les modèles fonctionnent mieux si les instructions sont claires, bien structurées, courtes et spécifiques. Ce modèle de prompt s’applique à la fois à l’invite utilisateur et à l’invite système.

**Modèle d'invite**

```
# Use this to clearly define the task and job needed by the model
task_summary = f"""
## Task Summary:
{{Task summary}}
"""

# Use this to provide contextual information related to the task
context_information = f"""
## Context Information:
- {{Context and content information 1}}
- {{Context and content information 2}}
...
"""

# Use this to provide any model instructions that you want model to adhere to
model_instructions = f"""
## Model Instructions:
- {{ Other Model Instructions }}
...
"""

# Use this to provide response style and formatting guidance
response_style = f"""
## Response style and format requirements:
- {{Style and format requirement 1}}
- {{Style and format requirement 2}}
...
"""

# Concatenate to final prompt
final_prompt = f"""{task_summary}
{context_information}
{model_instructions}
{response_style}"""
```

### Exemple : informations spécifiques et contextuelles
<a name="specific-collapsible"></a>

Voici un exemple d’invite réécrit avec des informations spécifiques et contextuelles. L’ajout d’informations contextuelles supplémentaires aide le modèle à s’ancrer vers le comportement souhaité.

------
#### [ Unclear prompt ]

`User:`

```
Write me a meeting invite to the project team
```

`Assistant:`

```
Certainly! Here's a sample meeting invite for your project team:

 ---

 **Subject:** Project Team Meeting - [Project Name]

 **Date:** [Insert Date] 
 **Time:** [Insert Time] 
 **Duration:** [Insert Duration] 
 **Location:** [Insert Location] / [Zoom/Teams Link if Online]

 **Agenda:**

 1. **Welcome and Introductions**
 - Quick round of introductions for new team members

 2. **Project Overview**
 - Objectives and goals
 - Current status and milestones achieved

 3. **Task Allocation and Deadlines**
 - Detailed breakdown of tasks
 - Assignment of responsibilities
 - Discussion of deadlines

 4. **Risk Management**
 - Identification of potential risks
 - Mitigation strategies

 5. **Resource Allocation**
 - Required tools and materials
 - Budget review

 6. **Q&amp;A Session**
 - Open floor for questions and clarifications

 7. **Next Steps and Closing**
 - Summary of action items
 - Schedule for the next meeting

 **Additional Notes:**

 - Please come prepared with any relevant documents or updates regarding your assigned tasks.
 - If you anticipate any issues or require additional support, please let us know in advance so we can address them during the meeting.

 **Contact Information:**

 For any questions or concerns before the meeting, please feel free to reach out to [Your Name] at [Your Email] or [Your Phone Number].

 We look forward to a productive discussion and to kicking off our project with enthusiasm!

 Best regards,

 [Your Full Name] 
 [Your Position] 
 [Your Contact Information]

 ---

 Feel free to customize this template to better fit your specific project and team needs!
```

------
#### [ Clear prompt ]

`User:`

```
Write me a meeting invite to the project team. The meeting is about project planning, and should be held on October 16th, from 10 AM to 11 AM in Conference Room B. Please include an agenda that covers our progress on the project thus far, as well as any upcoming milestones and deadlines.
```

`Assistant:`

```
**Meeting Invitation: Project Planning Session**

 **Date:** October 16th 
 **Time:** 10:00 AM - 11:00 AM 
 **Location:** Conference Room B

 **Agenda:**

 1. **Welcome and Introduction (10:00 AM - 10:05 AM)** 
 - Brief overview by the meeting facilitator.

 2. **Project Progress Update (10:05 AM - 10:30 AM)** 
 - Review of completed tasks and achievements to date. 
 - Detailed discussion on current project status and any challenges encountered.

 3. **Upcoming Milestones and Deadlines (10:30 AM - 10:50 AM)** 
 - Overview of the next phase of the project. 
 - Identification of key milestones and deadlines.

 4. **Action Items and Responsibilities (10:50 AM - 11:00 AM)** 
 - Assignment of tasks for the upcoming period. 
 - Confirmation of individual responsibilities and follow-up items.

 5. **Q&A Session (11:00 AM)** 
 - Open floor for any questions or concerns from team members.

 Please ensure your attendance to discuss and finalize our project planning for the next phase. Your insights and contributions are highly valued.

 Best regards,

 [Your Name] 
 [Your Position] 
 [Your Contact Information]
```

------
+ Soyez clair : lorsque vous interrogez le modèle, essayez de donner des instructions aussi claires que possible, de manière à ce qu’un humain puisse les comprendre plutôt qu’une machine (par exemple, une liste de type JSON).
+ Soyez précis : donnez au modèle des instructions spécifiques sur la tâche à accomplir, le résultat attendu et tout contexte supplémentaire afin de l’aider à répondre comme vous le voulez.

## Spécifiez le format et le style de sortie
<a name="prompting-style"></a>

Si vous souhaitez qu'Amazon Nova 2 génère des réponses adaptées à vos besoins spécifiques, vous pouvez spécifier le format et le style de la sortie. Par exemple, si vous voulez générer des réponses uniquement au format JSON ou limiter la longueur de la réponse à un nombre maximal de mots, de puces ou de paragraphes. Cela permet à Amazon Nova 2 de mieux comprendre vos besoins et de produire des résultats plus pertinents et plus faciles à analyser.

Utilisez des majuscules et des formulations fortes telles que « FAIRE », « NE PAS FAIRE », « DOIT » pour souligner les règles que vous voulez que le modèle respecte strictement. Par exemple, si vous voulez obtenir un seul objet JSON dans la réponse, vous pouvez indiquer au modèle : « Vous DEVEZ répondre uniquement au format JSON. N’utilisez AUCUN autre format pour répondre à la question. »

Voici quelques exemples d’invites réécrites avec des informations spécifiques et contextuelles. L’ajout d’informations contextuelles supplémentaires aide le modèle à s’ancrer vers le comportement souhaité.

### Exemple 1 : fournir des détails supplémentaires
<a name="style-collapsible1"></a>

L’ajout de détails supplémentaires sur le formatage de la réponse peut aider le modèle à obtenir le résultat souhaité. Parmi les autres formats de réponse couramment utilisés, on trouve CSV, Markdown, YAML et XML

------
#### [ Prompt without style constraints ]

`User:`

```
Outline the different types of rooms available in a typical 4-star hotel, including their features.
```

`Assistant:`

```
In a typical 4-star hotel, you'll find a range of room types, each designed to cater to different guest needs and preferences. Here's an outline of the different types of rooms available along with their features:

 ### 1. **Standard Room**
 - **Size:** Usually around 250-350 square feet.
 - **Features:**
 - Queen or double bed.
 - Complimentary Wi-Fi.
 - Flat-screen TV with cable or satellite channels.
 - Mini-fridge.
 - Coffee maker with complimentary coffee and tea.
 - Desk and chair.
 - En-suite bathroom with shower, toilet, and toiletries.
 - Air conditioning/heating.

 ### 2. **Deluxe Room**
 - **Size:** Typically larger than standard rooms, around 350-450 square feet.
 - **Features:**
 - King bed or two queen beds.
 - Larger bathroom with a bathtub.
 - Additional seating area.
 - Enhanced amenities like bathrobes and slippers.
 - Upgraded toiletries and sometimes a welcome gift.
 - Access to a lounge or executive floor perks.

 ### 3. **Suite**
 - **Size:** Varies significantly, often between 500-1,200 square feet.
 - **Features:**
 - Separate living area with a sofa bed or additional seating.
 - Kitchenette or full kitchen in some cases.
 - Larger, more luxurious bathroom with a bathtub and separate shower.
 - Multiple TVs.
 - Access to executive lounge.
 - High-end toiletries and often complimentary breakfast.
 - Often includes concierge services and in-room dining options.

 ### 4. **Family Room**
 - **Size:** Larger, usually around 400-500 square feet.
 - **Features:**
 - One king bed and one sofa bed or two queen beds.
 - Designed for families with children.
 - Extra space for luggage.
 - Child-friendly amenities like a small kitchenette or high chair.
 - Family bathroom with amenities suitable for kids.

 ### 5. **Executive Room**
 - **Size:** Typically around 350-450 square feet.
 - **Features:**
 - Business-oriented with a larger workspace.
 - Executive desk and chair.
 - Access to executive lounge with complimentary snacks and refreshments.
 - King bed or two queen beds.
 - Enhanced amenities like high-speed internet and sometimes a Nespresso machine.

 ### 6. **Junior Suite**
 - **Size:** Usually around 450-600 square feet.
 - **Features:**
 - Separate bedroom and living area.
 - King bed or two queen beds.
 - Kitchenette or mini-fridge.
 - Luxurious bathroom with a bathtub.
 - Lounge access.
 - High-end toiletries.

 ### 7. **Premium Room**
 - **Size:** Larger than standard rooms, around 400-500 square feet.
 - **Features:**
 - King bed or two queen beds.
 - Larger bathroom with a bathtub.
 - Enhanced amenities like a welcome drink and premium toiletries.
 - Access to premium services and sometimes a lounge.

 ### 8. **Connecting Rooms**
 - **Size:** Two rooms that connect via an internal door.
 - **Features:**
 - Suitable for families or groups.
 - Often includes one standard room and one suite.
 - Shared bathroom or en-suite bathrooms in each room.
 - Extra space for luggage and guests.

 ### 9. **Accessible Rooms**
 - **Size:** Varies, typically similar to standard rooms.
 - **Features:**
 - Designed for guests with disabilities.
 - Wider doorways and bathroom space.
 - Adapted fixtures and fittings.
 - Additional support services.

 ### 10. **Business Room**
 - **Size:** Usually around 300-350 square feet.
 - **Features:**
 - Focused on business travelers.
 - High-speed internet and large workspace.
 - Compact yet fully equipped with essentials.
 - Often includes a king bed.

 Each room type in a 4-star hotel is designed to provide comfort, convenience, and luxury tailored to different guest needs, ensuring a pleasant stay for all types of travelers.
```

------
#### [ Prompt with style contraints ]

`User:`

```
Outline the different types of rooms available in a typical 4-star hotel, including their features. All responses MUST be in YAML format.
```

`Assistant:`

```
```yaml
 hotel_rooms:
 - room_type: Standard Room
 features:
 - description: A comfortable room with essential amenities.
 amenities:
 - bed_type: Double bed or two single beds
 - bathroom: Private bathroom with shower
 - wifi: Complimentary high-speed internet
 - TV: Flat-screen TV with cable channels
 - mini_fridge: Available
 - tea_and_coffee_making_facilities: Yes

 - room_type: Deluxe Room
 features:
 - description: An upgraded room with more space and enhanced amenities.
 amenities:
 - bed_type: King-size bed or two single beds
 - bathroom: Private bathroom with both shower and bathtub
 - wifi: Complimentary high-speed internet
 - TV: Larger flat-screen TV with cable channels
 - mini_fridge: Available
 - tea_and_coffee_making_facilities: Yes
 - free_breakfast: Included

 - room_type: Suite
 features:
 - description: A luxurious room with separate living area and premium amenities.
 amenities:
 - bed_type: King-size bed or two single beds
 - bathroom: Private bathroom with both shower and bathtub
 - separate_living_area: Yes
 - wifi: Complimentary high-speed internet
 - TV: Large flat-screen TV with cable channels
 - mini_fridge: Available
 - tea_and_coffee_making_facilities: Yes
 - free_breakfast: Included
 - concierge_service: Available

 - room_type: Family Room
 features:
 - description: A spacious room designed for families with additional bedding options.
 amenities:
 - bed_type: Queen bed and rollaway bed or two single beds and rollaway bed
 - bathroom: Private bathroom with shower
 - wifi: Complimentary high-speed internet
 - TV: Flat-screen TV with cable channels
 - mini_fridge: Available
 - tea_and_coffee_making_facilities: Yes

 - room_type: Business Room
 features:
 - description: A room tailored for business travelers with enhanced workspace.
 amenities:
 - bed_type: Double bed or two single beds
 - bathroom: Private bathroom with shower
 - wifi: Complimentary high-speed internet
 - TV: Flat-screen TV with cable channels
 - workspace: Desk and chair
 - mini_fridge: Available
 - tea_and_coffee_making_facilities: Yes
 - business_center_access: Available
 ```
```

------

### Exemple 2 : fournir des contraintes de style
<a name="style-collapsible2"></a>

Dans ce cas, l’invite avec des contraintes de style fournit des informations complètes sur les contraintes à respecter et le format de réponse souhaité. Comme le montre la réponse, l’invite optimisée correspond davantage à la concision demandée et à la structure de liste à puces.

------
#### [ Prompt without style constraints ]

`User:`

```
Explain the process of checking in a guest at a luxury resort.
```

`Assistant:`

```
Checking in a guest at a luxury resort involves a meticulous and personalized process designed to ensure a seamless and memorable start to their stay. Here’s a detailed overview of the steps involved:

 ### Pre-Arrival Preparation

 1. **Pre-Arrival Communication:**
 - **Confirmation:** Verify guest reservations and confirm arrival details.
 - **Special Requests:** Collect any special requests (dietary restrictions, room preferences, etc.) and ensure they are noted in the guest profile.
 - **Documentation:** Ensure all necessary documentation is ready, such as welcome letters, room keys, and any special amenities.

 2. **Room Preparation:**
 - **Cleaning:** Conduct a thorough cleaning and preparation of the guest room.
 - **Amenities:** Stock the room with high-end toiletries, fresh linens, and any requested amenities.
 - **Personal Touches:** Add personalized touches such as a welcome note, fresh flowers, or locally sourced treats.

 ### Arrival and Initial Interaction

 3. **Guest Arrival:**
 - **Greeting:** Have staff ready to greet guests as they arrive. This may include a warm welcome at the entrance or a meet-and-greet in the lobby.
 - **Transport:** Provide luxury transport options like a chauffeured car service to escort guests to the check-in desk.

 4. **Check-In Desk:**
 - **Professionalism:** Ensure check-in staff are well-trained, professional, and exude hospitality.
 - **Technology:** Utilize sophisticated check-in technology (like tablet kiosks) to streamline the process.
 - **Personalized Welcome:** Greet guests with a warm welcome, acknowledge their special requests, and present them with a personalized welcome kit.

 ### Documentation and Formalities

 5. **Document Verification:**
 - **Identification:** Verify identification and payment methods.
 - **Membership Cards:** If applicable, verify any loyalty or membership cards for additional benefits.

 6. **Registration:**
 - **Form Filling:** Assist guests with any required paperwork.
 - **Special Benefits:** Clearly explain any special resort benefits, upgrades, or exclusive access to amenities that the guest is entitled to.

 ### Room Assignment

 7. **Room Presentation:**
 - **Walk-Through:** Escort guests to their room and conduct a walk-through to ensure everything is in order and to address any immediate concerns.
 - **Upgrades:** Present any room upgrades and explain the features and services available in the upgraded room.

 8. **Key Delivery:**
 - **Room Key:** Provide the room key, often a high-end key card or a luxury key fob.
 - **Access Information:** Explain how to use the key card, including access to other amenities like the spa, pool, and gym.

 ### Additional Services

 9. **Welcome Amenities:**
 - **Amenity Kits:** Deliver welcome amenity kits (like a bottle of champagne, local delicacies, etc.).
 - **Itinerary:** Provide a detailed resort map and itinerary, highlighting all available services and activities.

 10. **Personal Concierge:**
 - **Concierge Services:** Introduce the guest to the concierge service and explain how to request any special services, such as dining reservations, transportation, or local excursions.
 - **Contact Information:** Provide contact information for key staff members.

 ### Final Touches

 11. **Feedback:**
 - **Satisfaction Survey:** At the end of the check-in process, ask for feedback to ensure the guest’s expectations were met and to gather any immediate suggestions.

 12. **Follow-Up:**
 - **Immediate Issues:** Ensure any immediate issues or requests are addressed promptly.
 - **Comfort Check:** Make follow-up calls or send messages to ensure the guest is settling in comfortably.

 By following these steps, a luxury resort aims to provide an exceptional check-in experience that sets the tone for an unforgettable stay.
```

------
#### [ Prompt with style contraints ]

`User:`

```
Explain the process of checking in a guest at a luxury resort. Provide all answers in a numbered list format, with each point containing no more than 15 words, and no more than 6 bullet points.
```

`Assistant:`

```
1. Greet guest warmly with a smile and offer assistance.
2. Verify reservation details and check guest's identification.
3. Confirm room assignment and amenities provided.
4. Explain resort services and amenities available.
5. Present room key and offer directions to guest's suite.
6. Wish guest a pleasant stay and be available for queries.
```

------

### Exemple 3 : limiter le format de réponse
<a name="style-collapsible3"></a>

Ici, l’invite avec le format de réponse oblige le modèle à répondre uniquement avec le numéro de catégorie et à le limiter entre 1 et 10, au lieu d’être très prolixe.

------
#### [ Prompt without response format ]

`User:`

```
In this task, you are given a text which is the body of a document. Your job is to classify the topic of the document into these categories: 1)Company, 2)Educational Institution, 3)Artist, 4)Athlete, 5)Office Holder, 6)Mean of transportation, 7)Building, 8)Natural place, 9)Village, 10)Animal. 
Text: Johangsan is a mountain of South Korea. It has an elevation of 954 metres.
```

`Assistant:`

```
To classify the topic of the given text, let's analyze the content step-by-step:

 1. The text mentions "Johangsan," which appears to be a specific name.
 2. The text states that "Johangsan is a mountain," which provides a clear indication of its nature.
 3. It is further specified that it is located in "South Korea" and has an elevation of "954 metres."

 Based on the information provided, the text describes a geographical feature, specifically a mountain. From the given categories, the most appropriate classification for this document is:

 8) Natural place

 The text does not mention any company, educational institution, artist, athlete, office holder, means of transportation, building, village, or animal. Therefore, the classification as a "Natural place" is the most fitting choice.
```

------
#### [ Prompt with response format ]

`User:`

```
In this task, you are given a text which is the body of a document. Your job is to classify the topic of the document into these categories: 1)Company, 2)Educational Institution, 3)Artist, 4)Athlete, 5)Office Holder, 6)Mean of transportation, 7)Building, 8)Natural place, 9)Village, 10)Animal. Your output should be the category number. DO NOT generate anything apart from numbers 1-10.
Text: Johangsan is a mountain of South Korea. It has an elevation of 954 metres.
```

`Assistant:`

```
8
```

------

## Fournir des sections d’invite claires
<a name="prompting-clear-section"></a>

Au-delà du contexte initial, un format de requête structurée joue un rôle important dans l’optimisation des interactions avec le modèle linguistique. La séparation des différentes parties de l'entrée par des délimiteurs garantit la clarté et améliore la capacité des modèles Amazon Nova 2 à comprendre la structure de la requête. Une autre méthode efficace consiste à utiliser des listes numérotées ou des puces, qui peuvent aider à décomposer la tâche en étapes gérables et à fournir un aperçu clair des actions à entreprendre. Cette approche structurée contribue à réduire l’ambiguïté et à améliorer la précision des réponses générées.

### Exemple : créer une invite sectionnée
<a name="section-collapsible1"></a>

Remarquez comment, dans la colonne « Invite sectionnée », l’invite est plus claire et comporte des sections délimitées pour différentes entités telles que les tâches, le contexte, les exigences et le reste, par rapport aux instructions de la colonne « Invite non sectionnée ».

------
#### [ Unsectioned Prompt ]

`User:`

```
Write an article about climate change for high school students explaining basic concepts, current impacts, and individual actions to mitigate it. Make it informative and engaging with simple language, including statistics and real-world examples.
```

`Assistant:`

```
### Understanding Climate Change: What It Is, What It’s Doing, and What You Can Do About It

 #### Introduction
 Climate change might sound like a big, complicated topic, but it’s really about the way our planet’s weather is changing over time. This change is mostly happening because humans are doing things that are making our Earth warmer. Let’s break it down so you can understand what’s going on and what you can do to help.

 #### What Is Climate Change?
 Climate change refers to long-term shifts in temperatures and weather patterns. These shifts may be natural, but since the 1800s, human activities have been the main driver of rapid climate change.

 **Key Concept: Greenhouse Gases**
 To understand this, we need to talk about greenhouse gases. These gases, like carbon dioxide (CO2), methane (CH4), and nitrous oxide (N2O), trap heat in our atmosphere. Without these gases, Earth would be too cold for most life forms. But when we burn fossil fuels (like coal, oil, and natural gas) and cut down forests, we release too much CO2 and other greenhouse gases, trapping more heat and making the planet warmer.

 #### Current Impacts of Climate Change
 Let’s look at some real-world examples to see how climate change is affecting our world today.

 **1. Rising Temperatures**
 Since the late 19th century, Earth’s average surface temperature has risen about 2 degrees Fahrenheit (1 degree Celsius). Scientists predict that if we don’t change our ways, it could rise by 3.6 to 4.3 degrees Fahrenheit (2 to 2.4 degrees Celsius) by the end of this century.

 **2. More Extreme Weather**
 Climate change is making extreme weather events more frequent and severe. For example:
 - **Hurricanes:** In the U.S., hurricane seasons are getting longer and more destructive. In 2020, there were 30 named storms, the most ever recorded.
 - **Droughts:** Parts of California have experienced some of the worst droughts in history, affecting agriculture and water supplies.

 **3. Melting Ice Caps and Rising Sea Levels**
 Glaciers and ice sheets are melting at alarming rates. This not only affects wildlife but also leads to rising sea levels. Since 1901, global sea levels have risen by about 8 inches (20 centimeters). By 2100, they could rise by another 1 to 4 feet (0.3 to 1.2 meters).

 **4. Ocean Acidification**
 As CO2 levels rise, more of it is absorbed by the oceans, making them more acidic. This is particularly harmful to marine life, including coral reefs. Coral reefs are crucial for marine biodiversity but are now dying at an alarming rate.

 #### Individual Actions to Mitigate Climate Change
 You might think that since climate change is a huge problem, one person can’t make a difference. But even small actions can add up to make a big impact.

 **1. Reduce, Reuse, Recycle**
 Try to minimize waste by:
 - **Reducing:** Buy fewer items and choose products with less packaging.
 - **Reusing:** Use reusable bags, bottles, and containers.
 - **Recycling:** Make sure to recycle paper, plastic, and glass properly.

 **2. Conserve Energy**
 Small changes can lead to big savings:
 - Turn off lights when you leave a room.
 - Unplug devices that you’re not using.
 - Use energy-efficient bulbs and appliances.

 **3. Use Less Meat**
 Livestock farming is a major contributor to greenhouse gas emissions. By eating less meat, especially beef, you can reduce your carbon footprint.

 **4. Support Renewable Energy**
 If possible, support or switch to renewable energy sources like solar or wind power. Even advocating for these options in your community can make a difference.

 **5. Educate Yourself and Others**
 Knowledge is power. The more you know about climate change, the more you can help others understand it. Share facts and encourage your friends and family to take action too.

 #### Conclusion
 Climate change is a pressing issue that affects everyone on the planet. By understanding its basics, recognizing its current impacts, and taking individual actions, you can play a crucial role in mitigating its effects. Remember, every small step counts, and together, we can make a big difference for our planet.

 Let’s start today and build a sustainable future!
```

------
#### [ Sectioned Prompt ]

`User:`

```
**Task:**
Write an article 

**Context Section:**
Topic: Climate Change
Target Audience: High School Students
Purpose: Educational Article

**Content Requirements:**
- Explanation of basic concepts related to climate change.
- Examples of current impacts on ecosystems and human populations.
- Suggestions for individual actions to mitigate climate change.

**Tone and Style:**
- Informative and engaging
- Use simple language
- Include statistics and real-world examples
```

`Assistant:`

```
# Understanding Climate Change: A Guide for High School Students

 ## Introduction

 Climate change is one of the most pressing issues of our time. It affects our planet, our ecosystems, and our daily lives. Understanding what climate change is and how it impacts us can help us take action to make a difference. This article will explain the basic concepts of climate change, provide examples of its current impacts, and suggest actions you can take to help mitigate it.

 ## What is Climate Change?

 **Climate change** refers to long-term changes in global temperatures and weather patterns. These changes are primarily caused by human activities, especially the burning of fossil fuels like coal, oil, and natural gas. When we burn these fuels, we release large amounts of greenhouse gases, such as carbon dioxide (CO2) and methane (CH4), into the atmosphere. These gases trap heat from the sun, causing the Earth's temperature to rise. This is often referred to as the **greenhouse effect**.

 ### Basic Concepts:

 1. **Greenhouse Gases**: These gases include carbon dioxide, methane, nitrous oxide, and fluorinated gases. They trap heat in the Earth’s atmosphere.
 
 2. **Global Warming**: This is the increase in Earth's average surface temperature due to rising levels of greenhouse gases.

 3. **Climate Change**: Refers to the broader set of changes in the Earth’s climate system, including global warming.

 ## Current Impacts of Climate Change

 ### On Ecosystems:

 1. **Melting Ice Caps and Glaciers**: The polar ice caps and glaciers are melting at an alarming rate. For example, the Arctic sea ice is shrinking, which affects polar bears and other Arctic animals.

 2. **Rising Sea Levels**: As ice melts, sea levels rise. This can lead to the loss of coastal habitats and increased flooding in coastal areas.

 3. **Changing Weather Patterns**: Climate change can lead to more frequent and severe weather events such as hurricanes, droughts, and heatwaves. For example, the 2020 Australian bushfires were more intense and lasted longer than usual due to climate change.

 ### On Human Populations:

 1. **Health Issues**: Rising temperatures can lead to more heat-related illnesses and the spread of diseases like malaria and dengue fever.

 2. **Food Security**: Changes in climate can affect crop yields, leading to food shortages. For example, droughts in Sub-Saharan Africa have caused significant food insecurity.

 3. **Displacement**: Rising sea levels and extreme weather events can force people to leave their homes, becoming climate refugees. For instance, communities in Bangladesh are being displaced by rising sea levels.

 ## Actions You Can Take

 Even though climate change is a massive issue, there are many actions you can take to help mitigate its effects. Here are some simple steps you can start with today:

 1. **Reduce, Reuse, Recycle**: By reducing waste, reusing items, and recycling, you can decrease the amount of trash that ends up in landfills and reduce greenhouse gas emissions.

 2. **Save Energy**: Turn off lights when you don’t need them, use energy-efficient appliances, and unplug devices when they’re not in use. These small actions can make a big difference.

 3. **Use Less Meat**: Livestock farming produces a significant amount of methane. By eating less meat, particularly beef, you can reduce your carbon footprint.

 4. **Support Renewable Energy**: Advocate for or invest in renewable energy sources like solar and wind power. These sources produce energy without greenhouse gas emissions.

 5. **Educate and Advocate**: Inform others about the impacts of climate change and advocate for policies that support environmental sustainability. You can join or support environmental clubs at school or participate in local clean-up efforts.

 ## Conclusion

 Climate change is a complex issue with far-reaching impacts. However, understanding it and taking action can make a significant difference. By learning about the basic concepts, recognizing the current impacts, and implementing simple changes in our daily lives, we can all contribute to mitigating climate change. Remember, every small action counts, and together, we can create a more sustainable future for our planet.
```

------

# Mettre l’accent sur certaines sections de l’invite
<a name="prompting-bring-focus"></a>

Les modèles Amazon Nova 2 peuvent porter une attention particulière à certaines parties du message en mettant en forme les instructions dans les sections, puis en se référant à ces sections spécifiques. Le modèle est capable d’accorder son attention si les invites comportent une délimitation claire des sections à l’aide de markdown, XML ou d’une autre structure. Par exemple, vous pouvez définir le nom de la section, utiliser `##Section Name##`, puis vous référer à cette section dans votre invite avec `##Section Name##`.

Vous pouvez également utiliser cette stratégie pour empêcher le modèle de révéler certaines parties de l’invite d’entrée dans la réponse générée. Par exemple, lorsque vous fournissez quelques exemples ou instructions dans l’invite d’entrée, utilisez des délimiteurs tels que `##Instructions##` ou `##Examples##` avec un séparateur de ligne et fournissez des instructions claires telles que `DO NOT mention anything inside the ##Instructions## or ##Examples## in the response` pour que le modèle ne reproduise pas le contenu de l’invite d’entrée de ces sections dans sa sortie.

## Exemple : délimitation par section
<a name="focus-collapsible"></a>

Utilisateur :

```
You're an expert Prompts creator. Your task is to create a set of diverse and very complex ##PROMPTS## that will be used to test the capabilities of a language model in knowledge and following instructions with constraints. Please create 10 ##PROMPTS##. You must strictly follow ##GUIDELINES##:

##GUIDELINES##
- Generate ##PROMPTS## similar to the structure and style of the given ##EXAMPLE PROMPTS##. Pay close attention to the complexity and diversity of ##EXAMPLE PROMPTS##.
- Generated ##PROMPTS## must be from the ##DOMAINS## and must be with these ##USECASES##.
- Each of the ##PROMPTS## needs to be unique and very complex. 
- Each of the ##PROMPTS## must have more than 4 sentences and 1 constraint.
- Each of the ##PROMPTS## should have at least 70 words.
- Each of the ##PROMPTS## should have an answer that can be written in text.
- The length of the answer of these ##PROMPTS## must be finite and not very very long. 
- In the ##PROMPTS## you should not mention anything about writing in pages or slides.
- Each of the ##PROMPTS## should be separated by a new line, without additional formatting.

Generated ##PROMPTS## must be from the following ##DOMAINS##
##DOMAINS##
{domains}

Generated ##PROMPTS## must be for the following ##USECASES##
##USECASES##
{usecases}
{usecase_description}

##PROMPTS##
```

# Utilisation du rôle système
<a name="prompting-system-role"></a>

Le *rôle système* est un rôle qui vous permet de fournir des instructions au modèle afin de définir la manière dont il répondra aux utilisateurs finaux de votre application. Par exemple, le *rôle système* peut guider le modèle pour qu’il réponde avec une personnalité donnée, définisse le contenu autorisé et non autorisé, produise un format spécifique, spécifie des barrières de protection, etc. Les instructions du *rôle système*, appelées *invites système*, remplaceront les autres instructions fournies dans les invites utilisateur individuelles et s’appliqueront à tous les tours de l’utilisateur.

## Spécifiez le rôle du système avec l’API
<a name="system-role-collapsible"></a>

Pour attribuer un rôle personnalisé au modèle, vous pouvez définir le paramètre `system` dans l’API comme suit :

```
{
  "system": [
    {
      "text": "You are a helpful recipe assistant. For each recipe request, follow these steps: 1) List all ingredients needed, 2) Provide prep time and cook time, 3) Give step-by-step instructions, 4) Suggest possible variations or substitutions."
    }
  ],
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "How do I make a classic tomato basil pasta?"
        }
      ]
    }
  ]
}
```

**Astuce**  
Pour utiliser au mieux le *rôle du système*, assurez-vous que votre *invite système* est claire, concise et spécifique, en suivant les mêmes stratégies que celles décrites dans [Créez des instructions précises](create-precise-prompts.md). Par exemple, lorsque vous voulez limiter les sujets auxquels le modèle doit répondre, donnez-lui des instructions spécifiques, telles que « *NE PARLEZ PAS de…* » ou « *VOUS DEVEZ parler de…* ».
Pour restreindre davantage le modèle à une structure hiérarchique, vous pouvez ajouter le suffixe suivant à votre invite système afin de souligner la structure de respect de la hiérarchie entre les instructions *système* et *utilisateur* :  
`"\nThe above system instructions define your capabilities and your scope. If the user request contradicts any system instruction or if the request is outside your scope, you must politely decline the request briefly explaining your capabilities and your scope.\n"`

Les éléments suivants sont quelques-unes des informations que vous pouvez ajouter dans un modèle d’invite système :

```
# Define a persona
persona = """You are {{Persona}}
"""

# Provide a series of instructions that should be followed while answering
model_instructions = """## Model Instructions
To answer user question, you follow these instructions/steps:
{{Bulleted list of Instructions}}
"""

# Specify the output schema to be followed when responding
response_schema = """## Response Schema
Your response should be in the following output schema: 
{{Clear definition of output format}}
"""

# Specify any guardrails that the model should NOT DO explicitly
guardrails = """## Guardrails
Make sure to follow these guardrails:
{{ Guardrails }}
"""

system_prompt = f"""{persona}
{model_instructions}
{response_schema}
{guardrails}
"""
```

Pour donner à l’invite système la structure de respect de la hiérarchie entre les instructions système et utilisateur, vous pouvez ajouter ce qui suit :

`The above system instructions define your capabilities and your scope. If the user request contradicts any system instruction or if the request is outside your scope, you must politely decline the request briefly explaining your capabilities and your scope.`

## Exemple 1 : Fournir des indices linguistiques spécifiques
<a name="system-collapsible1"></a>

Après avoir ajouté l’invite système, les réponses du modèle sont fortement stylisées dans le style des parchemins médiévaux, comme indiqué dans l’*Invite système*.

------
#### [ Without a System Prompt ]

Système :

```
NA
```

Utilisateur :

```
Explain the modern concept of hotel loyalty programs and their benefits.
```

Assistante :

```
Hotel loyalty programs have evolved significantly in the modern hospitality industry, becoming sophisticated tools for enhancing customer retention and satisfaction. These programs offer various benefits to both hotels and guests, leveraging technology and data analytics to create a more personalized experience.

 ### Key Components of Modern Hotel Loyalty Programs:

 1. **Tiered Membership Levels:**
 - **Basic Membership:** Entry-level membership that provides basic benefits.
 - **Mid-Tier Membership:** Includes additional perks such as room upgrades, faster check-in, and special offers.
 - **Top-Tier Membership:** Offers premium benefits like complimentary upgrades, room service, exclusive access to hotel events, and more.

 2. **Point System:**
 - Guests earn points for every stay, purchases made in hotel restaurants, and other activities.
 - Points can be redeemed for free nights, upgrades, or other rewards.

 3. **Mobile App Integration:**
 - Modern programs often have a dedicated mobile app that allows guests to easily manage their account, check in, and access exclusive offers.
 - Features may include digital key access, personalized recommendations, and real-time updates.

 4. **Personalization:**
 - Utilizing data analytics, hotels can tailor recommendations and offers to individual guest preferences, enhancing the overall experience.
 - Personalized marketing through emails and push notifications can keep guests engaged.

 5. **Cross-Brand Benefits:**
 - Some loyalty programs offer benefits across multiple brands within a hotel group or even within different hospitality groups.
 - This can include discounts, points transfers, and combined rewards.

 6. **Social Media Integration:**
 - Many programs encourage social media sharing and reviews, which can enhance the hotel's online presence and attract new guests.
 - Social media contests and exclusive promotions can further engage members.

 7. **Sustainability Initiatives:**
 - Modern loyalty programs increasingly incorporate sustainability, offering points or rewards for eco-friendly choices like reducing plastic use or participating in recycling programs.

 ### Benefits to Guests:

 1. **Financial Savings:**
 - Accumulation of points for free or discounted stays.
 - Exclusive discounts and offers not available to non-members.

 2. **Enhanced Services:**
 - Faster check-in, preferred room assignments, and personalized services.
 - Access to exclusive events and experiences.

 3. **Convenience:**
 - Easy booking and management through mobile apps.
 - Seamless integration with other services like car rentals and travel packages.

 4. **Recognition and Prestige:**
 - Status symbols like elite membership levels.
 - Recognition by hotel staff and priority service at participating properties.

 ### Benefits to Hotels:

 1. **Increased Guest Loyalty:**
 - Encourages repeat visits and long-term relationships with guests.
 - Helps retain customers even when faced with competition.

 2. **Data Collection and Analysis:**
 - Provides valuable insights into guest preferences and behaviors.
 - Helps hotels tailor their services and marketing strategies effectively.

 3. **Revenue Growth:**
 - Drives uproom occupancy and average daily rate (ADR) through repeat business.
 - Cross-selling opportunities within the hotel (e.g., dining, spa services).

 4. **Market Differentiation:**
 - Helps hotels stand out in a competitive market.
 - Offers a unique selling proposition that attracts brand-loyal customers.

 ### Conclusion:

 Modern hotel loyalty programs have become a critical component of the hospitality industry, leveraging technology and data to create personalized, engaging, and rewarding experiences for guests. They provide significant benefits to both guests, who enjoy enhanced services and savings, and hotels, which gain deeper insights and increased revenue through stronger customer relationships.
```

------
#### [ With a System Prompt ]

Système :

```
Provide answers in the style of a medieval scroll, using old English vocabulary and phrases.
```

Utilisateur :

```
Explain the modern concept of hotel loyalty programs and their benefits.
```

Assistante :

```
Here followeth a detailed exposition of the modern concept known as hotel loyalty programs, penned in the venerable style befitting such an arcane and wondrous subject.

 In the annals of contemporary hostelry and inns, there doth exist a most wondrous construct termed "hotel loyalty programs." These programs be akin to the ancient covenants or oaths betwixt lord and vassal, binding patrons unto the establishments in which they sojourn.

 Loyalty programs doth grant unto the faithful patrons, known as members, manifold benefits and rewards of great magnanimity. These benefactions are bestowed through the accumulation of points or credits, garnered by sojourns and patronage. Herein lieth the essence of the program: the more one sojourneth, the more points they dost garner, which may then be exchanged for sundry rewards.

 The benefits of these programs are manifold and most enticing:

 1. **Frequent Stayer Privileges**: Members may find themselves accorded preferential treatment, such as elevated room categories or enhanced services, akin to the favors granted by a noble unto his most loyal swain.

 2. **Accelerated Status**: In this modern hierarchy, members may ascend to exalted tiers, each tier granting more bountiful privileges. Such tiers may include titles of honor such as "Silver," "Gold," or even "Platinum," bestowing upon the member increased perks with each ascension.

 3. **Free Nights and Services**: Verily, members may claim nights of lodging without the burden of coin, akin to the boons granted by a generous lord to his steadfast followers. Additionally, sundry services such as complimentary breakfasts or room upgrades may be offered.

 4. **Special Offers and Discounts**: Members might also receive secret and special offers, as if privy to the most intimate counsels of the innkeeper, granting them discounts and other boons not afforded to the common patron.

 5. **Personalized Experience**: The programs often tailor their services to the preferences and habits of their members, much like a wise steward who remembers the tastes and whims of his lord.

 Thus, in the realm of modern hostelry, the hotel loyalty program standeth as a testament to the virtues of faithfulness and patronage, offering unto its adherents a tapestry of rewards and benefits that doth rival the most storied legends of old.
```

------

## Exemple 2 : fourniture de garde-corps
<a name="system-collapsible2"></a>

Grâce à l’ajout de l’*invite système*, les utilisateurs peuvent ajouter des barrières de protection à leurs applications afin de les protéger contre toute utilisation non souhaitée. Voici un exemple de la façon dont les glissières de sécurité peuvent concentrer le modèle sur la tâche souhaitée.

------
#### [ Without a System Prompt ]

Système :

```
NA
```

Utilisateur :

```
Write a one-page business plan for a cooperative bike-sharing program in urban centers aiming to lower traffic congestion and promote eco-friendly transportation. (Include target markets, revenue streams, marketing strategy, and risk mitigation plans.)
```

Assistante :

```
**Urban EcoCycle: A Cooperative Bike-Sharing Program**

 **Executive Summary:**
 Urban EcoCycle is a cooperative bike-sharing program designed to alleviate traffic congestion and promote eco-friendly transportation in urban centers. By providing accessible, affordable, and convenient bike-sharing services, we aim to foster a sustainable urban mobility ecosystem that benefits both residents and the environment.

 **Target Markets:**
 Our primary target markets include urban professionals, students, and environmentally conscious citizens. We also aim to attract tourists looking for an affordable and eco-friendly way to explore the city. Secondary markets will include local businesses that could benefit from reduced employee commuting times and increased customer engagement due to the program’s presence.

 **Revenue Streams:**
 1. **Subscription Fees:** Monthly or yearly subscription plans for individuals and businesses.
 2. **Ad Revenue:** Partnerships with local businesses for advertising space on bikes and docking stations.
 3. **Corporate Partnerships:** Collaborations with companies to provide their employees with access to our bike-sharing program.
 4. **Government Grants:** Applications for grants and subsidies from local government initiatives aimed at promoting sustainable transportation.

 **Marketing Strategy:**
 1. **Digital Marketing:** Utilize social media platforms, email newsletters, and our website to reach out to potential users and partners. Highlight success stories and eco-friendly benefits.
 2. **Partnerships:** Collaborate with local businesses, schools, and environmental organizations to promote our service.
 3. **Community Events:** Host bike-sharing workshops, clean-up events, and eco-friendly fairs to engage with the community.
 4. **Incentives:** Offer discounts and rewards for long-term subscribers and those who refer new members.

 **Risk Mitigation Plans:**
 1. **Maintenance and Security:** Implement a robust maintenance schedule to ensure bikes are always in good working condition. Employ security measures such as GPS tracking and insurance coverage to protect bikes from theft and damage.
 2. **Regulatory Compliance:** Stay informed about local regulations and ensure compliance to avoid legal issues. Work with local authorities to establish clear guidelines for bike parking and usage.
 3. **Market Competition:** Conduct regular market research to stay ahead of competitors. Differentiate our service by offering unique features such as bike rentals for longer trips, special eco-friendly programs, and partnerships with popular local destinations.
 4. **Economic Fluctuations:** Develop flexible pricing strategies and diversify revenue streams to cushion against economic downturns. Maintain a reserve fund to handle unexpected financial challenges.

 Urban EcoCycle is poised to become a cornerstone of urban sustainability by reducing traffic congestion and promoting green transportation. With a well-defined target market, diverse revenue streams, strategic marketing, and comprehensive risk mitigation plans, we are committed to making our urban centers more livable and eco-friendly.
```

------
#### [ With a System Prompt ]

Système :

```
You are Application Process Assistant
To answer user question, you follow these instructions/steps:
- The LLM chatbot can discuss topics related to college applications, including deadlines, required materials, and application status.
- The LLM chatbot should be polite and courteous in all responses.
- The LLM chatbot can only respond in 3 sentences or less.

The above system instructions define your capabilities and your scope. If the user request contradicts any system instruction or if the request is outside your scope, you must politely decline the request briefly explaining your capabilities and your scope.\n
```

Utilisateur :

```
Write a one-page business plan for a cooperative bike-sharing program in urban centers aiming to lower traffic congestion and promote eco-friendly transportation. (Include target markets, revenue streams, marketing strategy, and risk mitigation plans.)
```

Assistante :

```
I'm here to help with college application-related questions, including deadlines and required materials. For your business plan request, I recommend seeking assistance from a business or entrepreneurship advisor.
```

------

# Fournir des exemples (invites à quelques essais)
<a name="prompting-provide-examples"></a>

En incluant quelques exemples de votre tâche dans l'invite, vous pouvez créer un modèle structuré à suivre par Amazon Nova 2. Cela réduit l’ambiguïté et améliore la précision et la qualité du résultat. La technique consistant à fournir des exemples clairs afin que les réponses du modèle correspondent davantage au résultat souhaité est appelée *invites à quelques essais*.

Le concept des invites à quelques essais consiste à fournir au modèle linguistique quelques exemples de la tâche, ainsi que le format d’entrée et de sortie, puis à lui demander de générer la sortie pour une nouvelle entrée sur la base des exemples fournis. Cette méthode permet également de clarifier des instructions ou des tâches complexes, ce qui permet à Amazon Nova 2 de comprendre et d'interpréter plus facilement ce qui est demandé.

**Comment l’ajout d’exemples à l’invite peut aider :**

L’ajout d’exemples peut aider le modèle à produire 
+ Des réponses cohérentes, uniformes avec le style des exemples 
+ Des réponses performantes grâce à la réduction du risque de mauvaise interprétation des instructions et à la minimisation des hallucinations

L’amélioration des performances du modèle grâce à l’utilisation des invites à quelques essais dépendra de la qualité et de la diversité des exemples que vous aurez choisis. Les éléments suivants illustrent les caractéristiques d’une bonne série d’exemples dans l’invite :
+ **Sélectionnez divers exemples** : Les exemples choisis doivent représenter la distribution de vos attentes input/output en termes de diversité (allant des cas d'utilisation courants aux cas extrêmes) afin de couvrir de manière adéquate les cas d'utilisation pertinents. Il est important d’éviter tout biais dans vos exemples, car un biais dans les entrées peut également entraîner un biais dans les sorties.
+ **Faites correspondre les niveaux de complexité** : la complexité des exemples fournis doit correspondre à la tâche ou au scénario cible. Il est important de s’assurer que le niveau de complexité est bien adapté entre l’entrée attendue et l’exemple choisi dans l’invite.
+ **Assurez-vous de la pertinence** : les exemples sélectionnés doivent être directement pertinents par rapport au problème ou à l’objectif à atteindre. Cela garantit la cohérence et l’uniformité des réponses. 

**Astuce**  
Si les suggestions ci-dessus ne fonctionnent pas, nous vous recommandons de créer un système basé sur RAG qui complète l’invite avec une sélection dynamique de clichés en fonction des similitudes entre la requête saisie par l’utilisateur et un groupe de clichés disponibles.

## Exemple 1 : fournir des exemples dans l’invite utilisateur
<a name="example-collapsible1"></a>

Ici, votre utilisateur tente de classer les tickets d’assistance client entrants dans des catégories prédéfinies. Vous pouvez fournir aux modèles Amazon Nova 2 quelques exemples de tickets correctement classés afin d'améliorer sa compréhension des catégories et de la langue utilisée dans les tickets. Les exemples doivent être concis et représenter toutes les tâches ciblées dans votre application. S’il existe un nom de champ spécifique significatif pour les tâches, tel que `Ticket` ou `Category` dans cet exemple, votre utilisateur peut utiliser ces champs directement suivis d’un deux-points `":"`. 

------
#### [ 0-shot prompt ]

Utilisateur :

```
Please classify the following customer support tickets into one of the categories: "Technical Issue," "Billing Inquiry," or "General Inquiry." 

Ticket: "Can you explain why my latest bill is higher than usual? I haven't changed my plan."
```

Assistante :

```
The customer support ticket should be classified as a "Billing Inquiry."

 Here’s the reasoning:
 - The customer is asking about the reason for a change in their latest bill amount.
 - The context revolves around billing and payment, which falls under the category of "Billing Inquiry."
```

------
#### [ 3-shot prompt ]

Utilisateur :

```
Please classify the following customer support tickets into one of the categories: "Technical Issue," "Billing Inquiry," or "General Inquiry." 
Use these examples to guide your classification:

Ticket: "I can't log in to my account. The system keeps giving me an error message."
Category: Technical Issue

Ticket: "I received an email saying my account will be suspended unless I make a payment. Is this a scam?"
Category: Billing Inquiry

Ticket: "What are the hours of operation for your customer support team?"
Category: General Inquiry

Now, classify the following ticket:
Ticket: "Can you explain why my latest bill is higher than usual? I haven't changed my plan."
```

Assistante :

```
Category: Billing Inquiry

Explanation: The ticket is asking for an explanation regarding a change in the billing amount, which falls under the billing category as it pertains to questions about charges or payments.
```

------

## Exemple 2 : fournir des exemples sous forme d’invites
<a name="example-collapsible2"></a>

Dans cet exemple, les exemples sont fournis sous forme de tours, à raison d’un tour par exemple, où le rôle `User` contient l’entrée et le rôle `Assistant` contient la sortie attendue pour cet exemple. 

------
#### [ 0-shot Prompt ]

Système :

```
Your task is to Classify the following texts into the appropriate categories. The categories to classify are: 

Categories: 
- Food 
- Entertainment 
- Health 
- Wealth 
- Other
```

Utilisateur :

```
I have 20$ in my pocket.
```

Assistante :

```
Category: Wealth

Explanation: The text mentions a specific amount of money, which falls under the category of wealth. The presence of a monetary value directly relates to financial status or economic aspect.
```

------
#### [ 3-shot Prompt (as turns) ]

Système :

```
Your task is to Classify the following texts into the appropriate categories. The categories to classify are: 

Categories: 
- Food 
- Entertainment 
- Health 
- Wealth 
- Other
```

Utilisateur :

```
I love to eat pizza.
```

Assistante :

```
Food
```

Utilisateur :

```
I enjoy watching movies.
```

Assistante :

```
Entertainment
```

Utilisateur :

```
I am going to the gym after this.
```

Assistante :

```
Health
```

Utilisateur :

```
I have 20$ in my pocket.
```

Assistante :

```
Wealth
```

------

## Exemple 3 : fournir des exemples dans l’invite système
<a name="example-collapsible3"></a>

Dans cet exemple, vous pouvez spécifier une section « Exemple », puis énumérer une série d’exemples dans l’invite système. Cette façon de fournir des exemples dans l’invite est particulièrement utile si vos exemples sont longs et complexes et aide à localiser les exemples.

------
#### [ 0-shot Prompt ]

Système :

```
You are an AI assistant helping to draft professional reports for enterprise stakeholders. Ensure the report is formatted in rich text, with headings, bullet points, and highlighted important tasks.
```

Utilisateur :

```
Draft a detailed project update report for our stakeholders, summarizing the project milestones achieved, tasks completed, and future plans.
```

Assistante :

```
# Project Update Report

## Executive Summary
This report provides a comprehensive update on the project milestones achieved, tasks completed, and future plans. Our team has made significant progress, and we are on track to meet the project goals. The following sections outline the details of our accomplishments and upcoming activities.

---

## Project Milestones Achieved

### **1. Project Initiation**
- **Milestone Date:** July 15, 2023
- **Description:** Completed initial project planning and secured stakeholder approval.

### **2. System Design Completion**
- **Milestone Date:** September 30, 2023
- **Description:** Finished the detailed system design and received positive feedback from technical review meetings.

### **3. Prototype Development**
- **Milestone Date:** November 15, 2023
- **Description:** Developed and tested a working prototype of the system.

---

## Tasks Completed

### **1. Requirement Gathering**
- **Description:** Conducted comprehensive stakeholder interviews and collected detailed requirements.
- **Highlighted Important Tasks:**
  - **User Story Mapping:** Mapped out user stories to ensure all user needs are addressed.
  - **Requirement Documentation:** Created detailed requirement specifications.

### **2. System Architecture Design**
- **Description:** Designed the system architecture, focusing on scalability and maintainability.
- **Highlighted Important Tasks:**
  - **Technology Stack Selection:** Chose the appropriate technology stack based on project requirements.
  - **Architecture Diagrams:** Developed detailed architecture diagrams for easy understanding.

### **3. Prototype Development and Testing**
- **Description:** Developed and rigorously tested the prototype.
- **Highlighted Important Tasks:**
  - **Coding:** Implemented core functionalities of the prototype.
  - **Testing:** Conducted unit and integration testing to ensure prototype reliability.

---

## Future Plans

### **1. Full System Development**
- **Description:** Begin the full-scale development of the system based on the approved design and prototype.
- **Highlighted Important Tasks:**
  - **Module Development:** Develop each module as per the design specifications.
  - **Code Reviews:** Implement regular code reviews to maintain code quality.

### **2. User Acceptance Testing (UAT)**
- **Description:** Conduct UAT to ensure the system meets user requirements and is ready for deployment.
- **Highlighted Important Tasks:**
  - **Test Plan Development:** Create detailed UAT plans and test cases.
  - **UAT Execution:** Execute UAT and gather feedback for final adjustments.

### **3. Deployment and Training**
- **Description:** Deploy the system and provide necessary training to end-users.
- **Highlighted Important Tasks:**
  - **Deployment:** Roll out the system to the production environment.
  - **Training Sessions:** Organize training sessions for users to familiarize them with the new system.

---

## Conclusion
Our project has successfully achieved key milestones and completed significant tasks. With the current momentum, we are well-positioned to meet our future objectives. We remain committed to delivering a high-quality system that meets all stakeholder expectations.

---

**Prepared by:**
[Your Name]
[Your Position]
[Date]

**Contact Information:**
[Your Email]
[Your Phone Number]

---

This detailed update aims to keep stakeholders informed and reassured about the project's progress and future direction. For any queries or further information, please do not hesitate to contact me directly.
```

------
#### [ 2-shot Prompt ]

Système :

```
You are an AI assistant helping to draft professional reports for enterprise stakeholders. Below are a few examples of well-formatted project update reports to guide your response. 

<Example 1>

<b>Project Update Report</b><br>
<i>Date:</i> January 15, 2023<br>
<hr>


<b>Project Milestones Achieved:</b><br>
- Successfully launched the new CRM system.<br>
- Integrated the marketing automation tool.<br>
- Completed the employee training sessions.

<b>Tasks Completed:</b><br>
- Developed the user manual.<br>
- Conducted system testing.<br>
- Prepared the training materials.

<b>Future Plans:</b><br>
- Roll out the CRM system to all departments.<br>
- Schedule follow-up training sessions.<br>
- Monitor system performance and make necessary adjustments.

<hr>
<b>Prepared by:</b><br>
[Your Name]<br>
[Your Position]<br>
[Your Contact Information]

<Example 2>

<b>Project Update Report</b><br>
<i>Date:</i> February 20, 2023<br>
<hr>

<b>Project Milestones Achieved:</b><br>
- Launched the new website.<br>
- Completed the SEO optimization.<br>
- Organized the stakeholder meeting.

<b>Tasks Completed:</b><br>
- Designed the website layout.<br>
- Wrote the content for the website.<br>
- Tested the website functionality

<b>Future Plans:</b><br>
- Implement the analytics tracking.<br>
- Launch the social media campaign.<br>
- Gather feedback from stakeholders.

<hr>
<b>Prepared by:</b><br>
[Your Name]<br>
[Your Position]<br>
[Your Contact Information]
```

Utilisateur :

```
Draft a detailed project update report for our stakeholders, summarizing the project milestones achieved, tasks completed, and future plans.
```

Assistante :

```
<b>Project Update Report</b><br>
<i>Date:</i> October 5, 2023<br>
<hr>

<b>Project Milestones Achieved:</b><br>
- Successfully completed the implementation of the new enterprise resource planning (ERP) system.<br>
- Conducted and completed the first phase of the data migration process.<br>
- Successfully launched the new inventory management module.

<b>Tasks Completed:</b><br>
- Developed and finalized the comprehensive user training program, including detailed user manuals and video tutorials.<br>
- Conducted extensive system integration testing with all existing systems and ensured seamless interoperability.<br>
- Executed the initial data migration from the legacy system to the new ERP system, resulting in a 95% accuracy rate.

<b>Future Plans:</b><br>
- Roll out the new ERP system to all departments in the next two phases.<br>
- Schedule and conduct follow-up training sessions for all employees.<br>
- Implement the remaining modules of the ERP system, including financial management and human resources.<br>
- Establish a robust monitoring and support framework to ensure smooth system operation and address any issues promptly.

<hr>
<b>Prepared by:</b><br>
[Your Name]<br>
[Your Position]<br>
[Your Contact Information]

---

This detailed report provides a clear and concise overview of the project's progress, highlighting the milestones achieved, tasks completed, and future plans. It ensures stakeholders are well-informed and can make strategic decisions based on the current status of the project.
```

------

# Systèmes d’appel d’outils
<a name="prompting-tools-function"></a>

L’appel d’outils est disponible pour les modèles Amazon Nova en transmettant un schéma de configuration d’outils dans votre demande. L’invite pour le modèle sera complétée par cette configuration d’outils, ce qui en fait un point de départ très efficace pour optimiser votre système d’appel d’outils. 

Tenez compte des principes clés suivants :
+ Les définitions des outils doivent être claires et concises. Elles doivent être faciles à comprendre et leur intention doit être extrêmement claire.
+ Utilisez des différenciateurs clés et des conditions limites pour définir quand un outil doit être utilisé plutôt qu’un autre.
+ Soyez critique envers les types d’arguments d’entrée. Demandez-vous s’ils ont un sens et s’ils sont susceptibles d’être utilisés de cette manière en temps normal.

**Utilisez « Choix d’outil » pour contrôler quand un outil est appelé**

Le paramètre de choix d’outil vous permet de personnaliser le comportement de l’appel d’outil avec le modèle. Nous vous recommandons d’utiliser cette fonctionnalité pour contrôler de manière précise quels outils sont appelés et à quel moment.

Par exemple, pour des cas d’utilisation tels que la sortie structurée, vous pouvez vouloir qu’un outil spécifique soit appelé chaque fois qu’Amazon Nova est invoqué. Vous pouvez définir le schéma de votre sortie comme outil, puis définir le choix de l’outil sur le nom de cet outil.

```
{
   "toolChoice": {
        "tool": {
            "name": "name_of_tool"
        }
    }
}
```

Pour de nombreux cas d’utilisation agentique, vous voudrez peut-être vous assurer que le modèle sélectionne toujours l’un des outils disponibles. Pour ce faire, vous pouvez définir le choix de l’outil sur `any`, ce qui appellera exactement un outil à chaque fois que le modèle sera invoqué.

```
{
   "toolChoice": {
        "any": {}
    }
}
```

Enfin, pour les cas d’utilisation où l’appel d’un outil dépend fortement du contexte de la conversation, vous pouvez définir le choix de l’outil sur `auto`. Il s’agit du comportement par défaut, qui laisse le choix de l’outil entièrement à la discrétion du modèle.

```
{
   "toolChoice": {
        "auto": {}
    }
}
```

# Techniques d'incitation avancées
<a name="advanced-prompting-techniques"></a>

Ces sections fournissent des conseils avancés sur la manière d'améliorer la qualité de vos instructions et de tirer parti de fonctionnalités clés telles que la réflexion approfondie.

## Utiliser le mode raisonnement
<a name="use-reasoning-mode"></a>

Les modèles Amazon Nova 2 proposent un mode de raisonnement optionnel qui améliore l'approche du modèle en matière de résolution de problèmes complexes en lui permettant de résoudre systématiquement les problèmes avant de répondre. Tirer parti du mode de raisonnement du modèle est un moyen efficace d'améliorer la précision de vos instructions.

**Quand l'utiliser : le** mode raisonnement est recommandé pour les tâches complexes telles que les cas d'utilisation avec :
+ **Plusieurs étapes de raisonnement :** preuves mathématiques, conception d'algorithmes, architecture du système
+ **Informations de référence croisées :** analyse des documents, comparaison des options, évaluation des compromis
+ **Calculs sujets aux erreurs :** modélisation financière, analyse de données, débogage complexe
+ **Planification avec contraintes :** optimisation des ressources, gestion des dépendances, évaluation des risques
+ **Classifications complexes :** catégorisation à étiquettes multiples, taxonomies hiérarchiques, limites de décision nuancées
+ **Scénarios d'appel d'outils :** flux de travail d'API en plusieurs étapes, optimisation des requêtes de base de données, intégrations de systèmes coordonnées

**Note**  
Pour plus d'informations sur le mode de raisonnement, reportez-vous à[Utiliser le raisonnement](using-converse-api.md#converse-api-reasoning).

## Adoptez une approche descendante
<a name="top-down-approach"></a>

Dans les situations où le modèle doit évaluer plusieurs approches pour résoudre le problème, demandez-lui d'adopter une approche **descendante.**
+ Les modèles Amazon Nova 2 fonctionnent mieux lorsque le modèle commence par une vue d'ensemble, puis le décompose en sous-problèmes ou étapes plus petits et plus détaillés.
+ Dirigez explicitement le modèle pour qu'il identifie d'abord l'objectif principal, puis décomposez-le en composants gérables avant de passer en revue les détails de chaque pièce.
+ Cette approche structurée aide le modèle à organiser sa pensée et à produire des chaînes de raisonnement plus cohérentes.

**Exemple :**

```
{{User query}}. Start with the big picture and break it down into progressively smaller, more detailed subproblems or steps.
```

## Dirigez la chaîne de pensée
<a name="steer-chain-of-thought"></a>

Bien que le mode raisonnement améliore la précision grâce à la résolution systématique des problèmes, il existe des scénarios spécifiques dans lesquels le fait de vous suggérer une chaîne de pensée (CoT) en mode non-raisonnement peut mieux répondre à vos besoins.

**Quand l'utiliser :**
+ **Transparence et auditabilité :** lorsque vous souhaitez voir, vérifier ou auditer le processus de raisonnement du modèle, CoT fournit une visibilité complète sur chaque étape. Cela est essentiel pour les industries réglementées, les décisions à enjeux élevés ou lorsque vous souhaitez documenter la logique d'une réponse.
+ **Structures de raisonnement personnalisées :** utilisez CoT pour appliquer des modèles de raisonnement ou des méthodologies spécifiques. Vous pouvez orienter le modèle pour qu'il suive les cadres décisionnels de votre organisation, utiliser des approches de résolution de problèmes spécifiques à un domaine ou vous assurer que les facteurs sont pris en compte dans un ordre précis.
+ **Développement et débogage rapides :** pendant la phase d'ingénierie rapide, CoT vous aide à comprendre comment le modèle aborde les problèmes, à identifier les points faibles du raisonnement et à itérer plus efficacement selon vos instructions.
+ **Approches hybrides :** envisagez d'utiliser le CoT pendant le développement pour perfectionner vos instructions, puis de passer en mode raisonnement pour le déploiement en production une fois que vous serez sûr de l'approche du modèle pour votre cas d'utilisation spécifique.

**Note**  
Toutes les tâches ne nécessitent pas le CoT. Pour des tâches plus simples, autorisez le modèle à utiliser son propre processus de raisonnement.

**Orienter l'orientation du modèle en matière de CoT :**

```
{{User query}} Please follow these steps:

1. {{Step 1}}
2. {{Step 2}}
...
```

## Utilisation de fenêtres contextuelles longues
<a name="utilizing-long-context"></a>

Les modèles Amazon Nova 2 ont une longueur de contexte compatible de 1 million de jetons et excellent dans la compréhension du code et la réponse aux questions sur de longs documents. Ses performances (y compris l'adhésion rapide du système et l'utilisation des outils) peuvent légèrement diminuer à mesure que la taille du contexte augmente.

**Comment l'utiliser :**
+ **Placez les données longues au début** : placez vos documents longs et vos entrées au début de votre invite. Placez-les avant votre requête, vos instructions et vos exemples.
+ **Placez les instructions à la fin** : placez vos instructions à la fin de l’invite. Le modèle fonctionne mieux lorsque le contexte est fourni en premier et les instructions à la fin.
+ **Structurez les marqueurs de début et de fin du contenu du document :** utilisez des marqueurs de début `DOCUMENT {idx} START` et de fin`DOCUMENT {idx} END`, tels que et, pour indiquer le début et la fin de longs documents où \$1idx\$1 représente l'index du document spécifique.

**Exemple de modèle :**

```
// Provide your long inputs at the top of your prompt
BEGIN INPUT DOCUMENTS

DOCUMENT 1 START
{{Your document}}
DOCUMENT 1 END

END INPUT DOCUMENTS

// Then specify your query and instructions
BEGIN QUESTION
{{User query}}
END QUESTION

BEGIN INSTRUCTIONS
{{Instructions}}
END INSTRUCTIONS
```

## Réponses de base dans le texte d'appui
<a name="ground-answers-supporting-text"></a>

Nous vous recommandons de fournir au modèle des informations fiables et pertinentes par rapport à la requête d’entrée. Ces informations, ainsi que la requête d'entrée, font souvent partie du système appelé génération augmentée de récupération (RAG).
+ Au cours de ce processus, certains documents ou informations contextuels pertinents sont ajoutés à l'invite réelle de l'utilisateur afin que le modèle obtienne un contenu fiable pour générer une réponse pertinente et précise.
+ Demander à Amazon Nova 2 de répondre à l'aide d'un texte de référence provenant d'une source fiable peut l'aider à rédiger sa réponse sur la base du matériel fourni et à garantir que sa réponse est fondée sur des informations précises et pertinentes, améliorant ainsi la fiabilité et la crédibilité du contenu généré.
+ L'utilisation d'un texte de référence peut aider à éviter les hallucinations, améliorant ainsi la qualité globale et la fiabilité des réponses. Afin de minimiser les hallucinations, nous recommandons de mentionner explicitement `DO NOT USE INFORMATION THAT IS NOT IN REFERENCE TEXTS!` dans les instructions de votre modèle.

Modèle d’invite

```
System:
In this session, the model has access to search results and a user's question, your job is to answer the user's question using only information from the search results. 

Model Instructions:
- DO NOT USE INFORMATION THAT IS NOT IN SEARCH RESULTS!

User: {Query} 
Resource: Search Results: {Reference texts}
```

### Exemple : Fournir un contexte de base aide à empêcher le modèle d'halluciner
<a name="grounding-example"></a>

Cet exemple montre comment l'ancrage du contexte peut empêcher le modèle d'halluciner.

Système :

```
In this session, the model has access to search results and a user's question, your job is to answer the user's question using only information from the search results. Model Instructions:- DO NOT USE INFORMATION THAT IS NOT IN SEARCH RESULTS!
```

Utilisateur :

```
What were the economic impacts of the COVID-19 pandemic on the United States in 2020?

Resource: Search Results: In 2020, the United States experienced significant economic impacts due to the COVID-19 pandemic. The U.S. economy contracted by 3.5% in 2020, according to the Bureau of Economic Analysis. Unemployment rates surged to 14.7% in April 2020, the highest since the Great Depression, before gradually declining. Small businesses faced severe challenges, with millions of firms closing permanently. Additionally, consumer spending dropped sharply as people reduced non-essential expenditures and saved more. Government intervention played a critical role in mitigating these impacts through stimulus packages and support programs, such as the Paycheck Protection Program (PPP) for small businesses and direct payments to individuals. Despite these measures, the economic recovery remained uneven across different sectors and regions.
```

### Sol à l'aide de marqueurs de citation
<a name="grounding-citations"></a>

Pour les tâches documentaires longues, nous vous recommandons de demander au modèle Amazon Nova 2 de fonder ses réponses sur des citations tirées des sections pertinentes des documents avant de poursuivre la tâche.

Cette approche aide le modèle à se concentrer sur les informations les plus pertinentes et à éviter d’être distrait par du contenu superflu. Lorsque vous demandez au modèle de motiver sa réponse, les sections pouvant être citées doivent être numérotées. Par exemple`Passage %[1]%`, `Passage %[2]%` et ainsi de suite.

#### Exemples : utilisation de marqueurs de citation
<a name="citations-example"></a>

**Example Marqueurs de citation : invite**  

```
You are an AI financial assistant. Your task is to find patterns and insights from multi-year financial documents 

Passage %[1]%
{{Your document}}

Passage %[2]%
{{Your document}}

## Task:
Analyze my LLC's reports across multiple years to identify significant performance trends, segment growth patterns and strategic shifts.

## Context information:
- You have access to my LLC's annual financial reports (10-K) for multiple fiscal years in PDF format
- These reports contain comprehensive financial data including income statements, balance sheets, cash flow statements and management discussions
- The analysis should focus on year-over-year comparisons to identify meaningful trends
- I operate two business segments, one in Massachusetts and one in New York

Based on the provided Context, extract key financial metrics from each year's reports phrases from the documents.
Place citations as inline markers (e.g., %[1]%, %[2]%, etc.) directly within the relevant parts of the response 
text. Do not include a separate citation section after the response.
## Response Schema:
%% (Extracted Financial Metrics)
%% (Extracted Financial Metrics)
%% (Extracted Financial Metrics)
...
```

Après avoir extrait les informations clés en fonction de la tâche de l'utilisateur, vous pouvez utiliser les indicateurs financiers extraits pour répondre aux questions pertinentes, comme indiqué ci-dessous :

**Example Analyse de suivi avec des métriques extraites**  

```
## Task
Analyze my LLC's financial reports across multiple years to identify significant performance trends, segment growth patterns and strategic shifts.

{{extracted financial metrics}}

## Model Instructions:
- Organize data chronologically to identify meaningful trends
- DO compare segment performance across the five-year period
- DO identify significant strategic shifts or investments mentioned in management discussions
- DO NOT make speculative predictions beyond what is supported by the data
- ALWAYS note any changes in accounting practices or reporting methodologies that might affect year-over-year comparisons

## Response style and format requirements:
- Respond in markdown
- Structure the analysis with clear headings and subheadings
- Present key financial metrics in tabular format showing all five years side-by-side
- Include percentage changes year-over-year for all major metrics
- Create a section dedicated to visualizing the most significant trends (with descriptions of what would be shown in charts)
- Limit the executive summary to 250 words maximum
- Format segment analysis as separate sections with consistent metrics across all segments
- MUST include a Key Insights bullet-pointed list at the end of each major section
```

### Utiliser Nova Web Grounding
<a name="prompting-web-grounding"></a>

Au lieu de demander directement des citations pour ancrer le modèle dans un texte de support, les modèles Amazon Nova 2 fournissent un outil de base Web interne qui peut être utilisé. Lorsqu'ils sont activés, les modèles Amazon Nova 2 interrogent directement le Web et les graphes de connaissances d'Amazon, puis fondent la réponse finale sur des citations.

Pour en savoir plus sur la manière de tirer parti d'Amazon Nova Web Grounding, vous pouvez consulter le guide de l'[utilisateur d'Amazon Nova Web Grounding](https://docs.aws.amazon.com/nova/latest/nova2-userguide/web-grounding.html).

## Produire une sortie structurée
<a name="prompting-structured-output"></a>

Pour garantir des formats de sortie cohérents et structurés, vous pouvez utiliser des sorties structurées, notamment des formats tels que XML, JSON, Markdown, ou utiliser les fonctionnalités d'utilisation d'outils.
+ Cette approche permet aux systèmes en aval de comprendre et d'analyser plus efficacement les résultats générés par le modèle.
+ En fournissant des instructions explicites au modèle, les réponses sont générées conformément à un schéma prédéfini.

Par exemple, si l'analyseur en aval attend des conventions de dénomination spécifiques pour les clés d'un objet JSON, vous devez spécifier le schéma de réponse à la fin de l'invite. De plus, si vous préférez que les réponses soient au format JSON sans texte d’introduction, indiquez-le au modèle. C'est-à-dire, indiquez explicitement **Veuillez générer uniquement la sortie JSON. NE FOURNISSEZ AUCUN préambule.** pour garantir une sortie propre.

**Astuce**  
Nous respectons au mieux les exigences relatives au format des données lorsqu'elles sont définies dans le schéma lui-même plutôt que par le biais d'exemplaires (par exemple, en spécifiant des dates dans le YYYY/MM/DD format).
Pour les sorties JSON simples comportant jusqu'à 10 clés, vous trouverez le schéma ci-dessous. Pour les schémas plus complexes, nous vous recommandons de définir votre schéma à l'aide d'un outil. L'utilisation de l'outil s'appuie sur une technique appelée décodage sous contrainte qui augmentera l'adhérence du modèle à ces schémas complexes.

### Schémas de formatage courants
<a name="common-formatting-schemas"></a>

Voici des exemples de schémas de mise en forme courants.

------
#### [ JSON ]

```
JSON_format = """Write your response following the JSON format below:

```json
{ 
"key1": "value1",
"key2": "value2",
key3: [{
"key3_1": "value_3_1 written in YYYY/MM/DD format",
"key3_2": "value_3_2 day of the week written in full form",
...}```
"""
```

------
#### [ XML ]

```
XML_format = """Write your response following the XML format below:

<output>
    <task>"task1"</task>
    <subtask>
    <task1_result> ( task 1 result )</task1_result>
    <task2_result> ( task 2 result )</task2_result>
    <task3_result> ( task 3 result )</task3_result>
    </subtask>
    <task>"task2"</task>
    <subtask>
    <task1_result> ( task 1 result )</task1_result>
    <task2_result> ( task 2 result )</task2_result>
    <task3_result> ( task 3 result )</task3_result>
    </subtask>
</output>

"""
```

------
#### [ Markdown ]

```
markdown_schema = """Write your response following the markdown format below:


## Introduction
( 2-3 line intro)

## Design Guidance 
(Bulleted list of design guidance)

## Step by Step Instructions on Execution
( Bulleted list of instructions with each with bold title.

## Conclusion
( conclusion )


"""
```

------

### Préremplir le contenu de l'assistant
<a name="prompting-prefill"></a>

Si vous produisez une sortie structurée en mode non raisonné, vous pouvez modifier la réponse du modèle en préremplissant le contenu de l'assistant.

Le préremplissage améliore la cohérence du format de sortie en mode non raisonné. Il vous permet de diriger les actions du modèle, de contourner les préambules et d'appliquer des formats de sortie spécifiques tels que JSON et XML. Par exemple, si vous préremplissez le contenu de l'assistant avec `{` ou````json`, cette entrée guide le modèle pour générer l'objet JSON sans informations supplémentaires.

**Astuce**  
Si vous recherchez explicitement à extraire du JSON, un modèle courant consiste à préremplir avec une séquence d'arrêt ````json` et à y ajouter une séquence d'arrêt. ````` Cela garantit que le modèle génère un objet JSON qui peut être analysé par programmation.

**Example Préremplir le contenu de l'assistant**  
Le code suivant montre comment préremplir avec l’API :  

```
import boto3
import json

# Create a Bedrock Runtime client.
client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1"
)

request_body = {
    "system": [
        {"text": "You write JSON objects based on the given instructions"}
    ],
    "messages": [
        {
            "role": "user",
            "content": [{"text": "Provide details about the best selling full-frame cameras in past three years. Answer in JSON format with keys like name, brand, price and a summary."}]
        },
        {
            "role": "assistant",
            "content": [{"text": " Here is the JSON response: ```json"}]
        }
    ],
    "inferenceConfig": {
        "maxTokens": 1000,
    }
}

# Invoke the model and extract the response body.
response = client.invoke_model(
    modelId="amazon.nova-2-lite-v1:0",
    body=json.dumps(request_body)
)

model_response = json.loads(response["body"].read())
```

### Spécifier un outil à utiliser pour les schémas complexes
<a name="prompting-tool-complex-schemas"></a>

Une autre approche consiste à utiliser des outils pour forcer un schéma spécifique pour la réponse du modèle en incluant le schéma *JSON pydantic dans la section du schéma* d'utilisation des outils. Vous pouvez spécifier le choix de l’outil dans le schéma fourni et la réponse d’Amazon Nova sera structurée en fonction de l’outil sélectionné. Pour en savoir plus sur la manière de tirer parti de l'utilisation des outils, voir [Utilisation des outils](https://docs.aws.amazon.com/nova/latest/userguide/tool-use.html).

### Exemples
<a name="structured-output-examples"></a>

#### Exemple 1 : ajouter un schéma de sortie
<a name="add-output-schema-example"></a>

L’ajout de la section Schéma de sortie avec le schéma approprié incite le modèle à s’adapter à ce schéma. Cependant, le résultat du modèle n'est pas déterministe et peut être différent du schéma de sortie.

------
#### [ Unspecific Prompt ]

Utilisateur :

```
Provide details about the best selling full-frame cameras in past three years.
Answer in JSON format with keys like name, brand, price and a summary.
```

Assistante :

```
```json
 [
 {
 "name": "Sony Alpha A7R IV",
 "brand": "Sony",
 "price": "Approximately $3,500",
 "summary": "The Sony Alpha A7R IV is renowned for its exceptional image quality, thanks to a 61-megapixel full-frame sensor. It also features 4K video recording and a robust build, making it a favorite among professional photographers and videographers."
 },
 {
 "name": "Canon EOS R5",
 "brand": "Canon",
 "price": "Approximately $3,900",
 "summary": "The Canon EOS R5 combines high-resolution imaging with advanced video capabilities. It houses a 45-megapixel sensor, 8K video recording, and impressive autofocus performance, appealing to both photography and filmmaking professionals."
 },
 {
 "name": "Nikon Z7 II",
 "brand": "Nikon",
 "price": "Approximately $2,800",
 "summary": "The Nikon Z7 II offers a 45.7-megapixel full-frame sensor and is praised for its high resolution and excellent dynamic range. It also supports 4K video recording and features a versatile Z-mount lens system, making it a strong contender in the full-frame market."
 },
 {
 "name": "Fujifilm GFX 100S",
 "brand": "Fujifilm",
 "price": "Approximately $7,000",
 "summary": "While not a traditional full-frame camera, the Fujifilm GFX 100S stands out with its 102-megapixel medium format sensor. It is lauded for its stunning detail and color reproduction, though it comes at a higher price point and is aimed at specialized users."
 }
 ]
 ```
```

------
#### [ Specific Prompt ]

Utilisateur :

```
Provide details about the best selling full-frame cameras in past three years.
You MUST answer in JSON format only. Write your response following the the format below:
[{
“name”: “name goes here”,
“brand”: “brand goes here”,
“price”: “price goes here“,
"summary": "summary goes here"
}]
```

Assistante :

```
[
 {
 "name": "Nikon D850",
 "brand": "Nikon",
 "price": "$3,296.95",
 "summary": "The Nikon D850 is a professional full-frame DSLR camera known for its exceptional image quality, 45.7-megapixel resolution, 7 fps continuous shooting, and 4K video capabilities."
 },
 {
 "name": "Canon EOS 5D Mark IV",
 "brand": "Canon",
 "price": "$3,499.00",
 "summary": "The Canon EOS 5D Mark IV is a popular full-frame DSLR appreciated for its 30.4-megapixel sensor, 4K video recording, robust build quality, and reliable autofocus system."
 },
 {
 "name": "Sony A7R III",
 "brand": "Sony",
 "price": "$3,198.00",
 "summary": "The Sony A7R III is a high-resolution full-frame mirrorless camera renowned for its 42.4-megapixel sensor, excellent low-light performance, and versatile lens compatibility."
 },
 {
 "name": "Fujifilm GFX 100S",
 "brand": "Fujifilm",
 "price": "$5,999.99",
 "summary": "The Fujifilm GFX 100S is a medium format mirrorless camera that stands out for its 102-megapixel sensor, high dynamic range, and exceptional color reproduction."
 },
 {
 "name": "Sony A7 III",
 "brand": "Sony",
 "price": "$1,998.00",
 "summary": "The Sony A7 III is a full-frame mirrorless camera popular among enthusiasts and professionals for its 24.2-megapixel sensor, fast autofocus, and 4K video capabilities."
 }
 ]
```

------

#### Exemple 2 : préremplir la réponse du modèle
<a name="prefill-model-response-example"></a>

Une autre approche consiste à préremplir la réponse du modèle en incluant le texte initial souhaité dans le message de l’assistant. Dans ce cas, la réponse du modèle Amazon Nova se poursuivra là où le message de l’assistant s’arrête.

**Conseil :** Le préremplissage n'est valide que lorsque le raisonnement n'est pas activé.

Utilisateur :

```
Provide details about the best selling full-frame cameras in past three years.
Your response should be in JSON format, with the following keys: name, brand, year, price, summary.
```

Assistant (préremplissage) :

```
```json
```

Assistante :

```
{
 "cameras": [
 {
 "name": "Sony Alpha A7 III",
 "brand": "Sony",
 "year": 2018,
 "price": "$1999",
 "summary": "The Sony Alpha A7 III is a highly acclaimed full-frame mirrorless camera known for its excellent image quality, advanced autofocus system, and 4K video capabilities."
 },
 {
 "name": "Canon EOS R5",
 "brand": "Canon",
 "year": 2020,
 "price": "$3899",
 "summary": "The Canon EOS R5 is a top-tier full-frame mirrorless camera that offers stunning 45MP images, 8K video recording, and exceptional performance in various lighting conditions."
 },
 {
 "name": "Nikon Z7 II",
 "brand": "Nikon",
 "year": 2020,
 "price": "$2999",
 "summary": "The Nikon Z7 II is a flagship full-frame mirrorless camera with a 45.7MP sensor, superb image quality, and advanced video recording features."
 },
 {
 "name": "Fujifilm GFX 100S",
 "brand": "Fujifilm",
 "year": 2020,
 "price": "$7999",
 "summary": "The Fujifilm GFX 100S is a medium format mirrorless camera known for its impressive 102MP sensor, beautiful film simulations, and versatile lens options."
 },
 {
 "name": "Sony Alpha A7R IV",
 "brand": "Sony",
 "year": 2019,
 "price": "$3499",
 "summary": "The Sony Alpha A7R IV features a 61MP sensor, excellent low-light performance, and advanced video capabilities, making it a favorite among professional photographers."
 }
 ]
 }
 ```
```

#### Exemple 3 : spécifier un outil à utiliser
<a name="specify-tool-use-example"></a>

Au lieu d'utiliser la technique de préremplissage pour une sortie structurée, vous pouvez combiner les fonctionnalités d'outil de Nova avec ToolChoice. Dans cet exemple, le modèle générera un appel d'outil conforme au schéma JSON fourni et appellera l'outil spécifique spécifié au format JSON complet défini. Pour obtenir des instructions supplémentaires, reportez-vous à la section Systèmes avancés.

Utilisateur :

```
From the below provided Query, extract the relevent entities

Query:
John works in BUILDING-0987 and have been incharge of product id 23564#. His performance have been excellent in past year and is up for a raise.

Use the extract_ner tool.
```

ToolConfig:

```
{
        "tools": [
            {
            "toolSpec": {
                "name": "extract_ner",
                "description": "Extract all the named entities. based on provided input",
                "inputSchema": {
                    "json": {
                        "type": "object",
                        "properties": {
                            "entities": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                "name": {
                                    "type": "string",
                                    "description": "The extracted entity name. This should be a name of a person, place, animal or thing"
                                },
                                "location": {
                                    "type": "string",
                                    "description": "The extracted location name. This is a site name or a building name like SITE-001 or BUILDING-003"
                                },
                                "product": {
                                    "type": "string",
                                    "description": "The extrcted product code, this is generally a 6 digit alphanumeric code such as 45623#, 234567"
                                }
                                },
                                "required": [
                                "name",
                                "location",
                                "product"
                                ]
                            }
                            }
                        },
                        "required": [
                            "entities"
                        ]
                    }
                    
                }
            }
        }],
        "toolChoice": {
            "tool": {
                "name": "extract_ner"
            }
        }
    }
```

## Cas d'utilisation multilingues
<a name="prompting-multilingual"></a>

Les modèles Amazon Nova 2 ont été formés dans plus de 200 langues et optimisés pour 15 langues.

**Topics**
+ [Prompte pour des traductions précises](#accurate-translations)
+ [Appliquer des conventions d'écriture cohérentes](#consistent-writing-conventions)

### Prompte pour des traductions précises
<a name="accurate-translations"></a>

Pour tirer parti de cette fonctionnalité pour les traductions abrégées (quelques phrases), vous pouvez demander au modèle de traduire le texte dans la langue cible spécifiée.

**Example Invites de traduction**  

```
Translate the following text into {target language}. Please output only the translated text with no prefix or introduction: {text}
```

```
Translate the following sentence from {source_language} to {target language}: {text}
```

```
{text} How do you say this sentence in {target_language}
```

### Appliquer des conventions d'écriture cohérentes
<a name="consistent-writing-conventions"></a>

Dans les langages basés sur les caractères, les modèles Amazon Nova 2 peuvent utiliser le jeu de caractères de la langue source. Vous pouvez utiliser l'invite suivante pour garantir une sortie cohérente.

**Example Appliquer les conventions d'écriture**  

```
When translating, ensure to use the correct orthography / script / writing convention of the target language, not the source language's characters
```

## Appel d'outils
<a name="tool-calling-advanced-techniques"></a>

### Systèmes agentic
<a name="agentic-systems"></a>

**Topics**
+ [Définissez les bons paramètres d'inférence](#set-inference-parameters)
+ [Tenez compte des exigences en matière](#consider-latency-requirements)
+ [Utilisez un libellé intentionnel pour les instructions d'appel d'outils](#intentional-wording-tool-calling)
+ [Tirez parti des commandes de « réflexion »](#leverage-thinking-commands)
+ [Outil de commande par appel](#tool-call-ordering)
+ [Création de schémas d'outils de qualité](#designing-tool-schema)
+ [Création de sous-agents](#create-sub-agents)
+ [Utiliser des outils pour les entrées multimodales](#use-tools-multimodal-inputs)
+ [Étapes suivantes](#next-steps-best-practices)

#### Définissez les bons paramètres d'inférence
<a name="set-inference-parameters"></a>

L'appel d'outils nécessite une sortie structurée très spécifique du modèle et est amélioré en utilisant les paramètres d'inférence suivants :
+ **Mode sans raisonnement :** température : 0,7 et P supérieur : 0,9
+ **Mode de raisonnement :** Température : 1 et P supérieur : 0,9

#### Tenez compte des exigences en matière
<a name="consider-latency-requirements"></a>

**Astuce**  
Les modèles Amazon Nova 2 sont capables d'appeler des outils en activant ou en désactivant le raisonnement. Cependant, les modes de raisonnement ont un impact significatif sur la latence.

Pour les applications sensibles à la latence, vous devez optimiser le mode raisonnement hors tension et simplifier les appels d'outils requis dans la mesure du possible. Divisez les flux de travail en plusieurs étapes en étapes distinctes afin de réduire la dépendance du modèle à la régurgitation de paramètres inutiles.

#### Utilisez un libellé intentionnel pour les instructions d'appel d'outils
<a name="intentional-wording-tool-calling"></a>

**Noms des outils :** le référencement des outils dans l'invite du système est courant dans les systèmes d'appel d'outils pour indiquer au modèle quand appeler un outil. Lorsque vous faites référence à des outils dans l'invite, nous vous recommandons d'utiliser le nom de l'outil plutôt que des références ou des exemples XML ou pythoniques.

##### Exemple de bonne référence d'outil
<a name="Example-of-a-good-tool-reference"></a>

```
Use the 'run_shell_command' tool for running shell commands
```

##### Exemple de référence à un outil erroné
<a name="Example-of-a-bad-tool-reference"></a>

```
Call run_shell_command() to run shell commands
```

#### Tirez parti des commandes de « réflexion »
<a name="leverage-thinking-commands"></a>

Dans tous les cas d'utilisation où la réflexion est bénéfique pour l'appel d'outils, nous vous recommandons d'utiliser le mode raisonnement au lieu de demander au modèle de « penser en balises » ou d'utiliser un outil de « réflexion ».

 Les modèles Amazon Nova 2 sont entraînés de manière approfondie pour le mode raisonnement et produiront des résultats optimaux lorsqu'ils sont utilisés en mode raisonnement pour la chaîne de pensée. 

#### Outil de commande par appel
<a name="tool-call-ordering"></a>

Dans les cas d'utilisation qui peuvent nécessiter l'utilisation simultanée d'outils intégrés et l'appel d'outils natifs, le modèle privilégie l'appel d'abord aux outils intégrés.

Ne demandez pas au modèle d'agir différemment dans l'invite. Concevez plutôt votre flux de travail en tenant compte de cela.

Par exemple, si vous ne souhaitez pas que le modèle utilise des outils intégrés, ne les incluez pas dans votre flux de travail afin que le modèle ne soit pas biaisé en leur faveur.

#### Création de schémas d'outils de qualité
<a name="designing-tool-schema"></a>

Les schémas d'outils sont l'un des principaux endroits où vous pouvez créer des systèmes d'appel d'outils efficaces. Cependant, il est important de tenir compte de ce qui est capturé dans le schéma d'outil lui-même, de la manière dont chaque élément du schéma est décrit sémantiquement et de la manière dont le message du système fait référence aux outils et aux éléments du schéma dans les instructions système.

Les modèles Amazon Nova 2 sont optimisés pour des descriptions concises dans les schémas d'outils. Soyez bref.

**Schéma d'outil par rapport aux directives rapides du système :**

**Inclure dans le schéma de l'outil :**
+ Fonctionnalité de base : fonction de l'outil (20 à 50 mots recommandés)
+ Spécifications des paramètres : descriptions claires de chaque paramètre (environ 10 mots par paramètre)
+ Formats attendus : types de données (tels que enum, int, float), champs obligatoires et plages de valeurs valides

**Incluez dans l'invite du système :**
+ Consacrez une `#Tool Usage` section à la logique d'orchestration (quand et pourquoi utiliser des outils spécifiques) et aux règles métier (logique conditionnelle, exigences de séquençage et dépendances).
+ **Stratégies de gestion des erreurs :** ajoutez une `#Error Handling and Troubleshooting` section contenant des instructions sur la façon de réagir aux défaillances ou aux sorties inattendues
+ **Formatage de sortie :** ajoutez des détails sur le mode de présentation à l'utilisateur

##### Exemple
<a name="sample-example"></a>

```
You are a software engineering issue root cause analysis agent. You are tasked with reviewing a customer issue and examining the repository to identify a plan to resolve the issue.
      # Core Mandates
- **DO NOT** update the original issue that was posted by the user. You only add *additional* comments to the reported issue if necessary

# Primary Workflows
1. **Understand:** Analyze the user's request and explore the codebase thoroughly using **get_file_contents** to grasp file structures and conventions.
2. **Plan:** Create a coherent, evidence-based plan for resolving the task and share it with the user following the format below

# Tool Usage 
- **Read the Issue:** Always start by using the **read_issue** tool to get the details about the requested issue
- **File Paths:** Always end the file path with "/" if you are searching a directory using the **get_file_contents** tools
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible

# Error Handling and Troubleshooting
- **File Exploration:** If you get an error that a file doesn't exist, try searching at the directory level first to validate the file path

# Output Formatting
Return your plan in markdown in the following format

## Issue
<Your root cause analysis of the issue>

## Resolution Plan
<your step by step plan of how to solve the issue>
```

#### Création de sous-agents
<a name="create-sub-agents"></a>

Envisagez de créer des sous-agents spécialisés plutôt qu'un agent unique doté de nombreux outils lorsque vous rencontrez :
+ **Le nombre d'outils dépasse 20 :** les ensembles d'outils volumineux deviennent difficiles à gérer et augmentent les erreurs de sélection
+ **Domaines fonctionnels distincts : les** outils sont naturellement regroupés en catégories distinctes (telles que la récupération des données, le traitement ou le reporting)
+ **Schémas complexes :** lorsque la profondeur des paramètres dépasse 3 à 4 niveaux ou que les outils présentent des interdépendances complexes
+ **Durée des conversations :** les flux de travail dépassent régulièrement 15 à 20 tours et peuvent bénéficier de l'intervention de sous-agents spécialisés
+ **Dégradation des performances :** si vous observez une diminution de la précision lors de la sélection des outils ou une augmentation de la latence

**Astuce**  
Les serveurs MCP sont fournis avec des outils et des schémas que vous ne pouvez pas contrôler. N'incluez que les outils nécessaires à votre flux de travail pour effectuer la tâche requise.

#### Utiliser des outils pour les entrées multimodales
<a name="use-tools-multimodal-inputs"></a>

Pour les tâches multimodales, nous n'avons pas observé d'amélioration de la précision en tirant parti des outils pour les tâches structurées (telles que l'extraction ou la génération d'horodatages).

Nous vous recommandons plutôt de consulter les sections pertinentes de la section Proposer des entrées multimodales pour savoir comment demander correctement le modèle à l'aide des modèles fournis.

#### Étapes suivantes
<a name="next-steps-best-practices"></a>
+ Pour les instructions multimodales, voir. [Encourager les entrées multimodales](prompting-multimodal.md)