Skip to content

Commit

Permalink
add sections in preparation for the exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
jmservera committed May 23, 2024
1 parent 0f9dde2 commit 007e26d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion web/_site/feed.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2024-05-23T01:12:52+02:00</updated><id>http://localhost:4000/feed.xml</id><title type="html">Demos and labs</title><subtitle>Demos of tools and Azure services.</subtitle></feed>
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2024-05-23T12:12:57+02:00</updated><id>http://localhost:4000/feed.xml</id><title type="html">Demos and labs</title><subtitle>Demos of tools and Azure services.</subtitle></feed>
20 changes: 15 additions & 5 deletions web/_site/prompt-engineering.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h1 class="post-title">Prompt Engineering Hands-on Lab</h1>

<p>&amp; Juan Manuel Servera - Cloud Solution Architect App Inno - Microsoft</p>

<h2 id="prompt-engineering-hands-on-lab-an-introduction">Prompt Engineering Hands-on Lab: An Introduction</h2>
<h2 id="introduction">Introduction</h2>

<p>Welcome to the Prompt Engineering Hands-on Lab!</p>

Expand All @@ -72,6 +72,8 @@ <h2 id="exercise-1--warmup-with-basic-prompts">Exercise 1 – Warmup with Basic

<p><img src="./img/Copilot%20in%20desktop.png" alt="Screenshot showing Copilot on the web." /></p>

<h3 id="seed-text-prompt">Seed Text Prompt</h3>

<p>Write the following prompt in the “Ask me anything…” textbox:</p>

<pre><code class="language-prompt">The space is
Expand All @@ -96,11 +98,15 @@ <h2 id="exercise-1--warmup-with-basic-prompts">Exercise 1 – Warmup with Basic

<p>You will get a shorter, more concise answer.</p>

<h3 id="conditional-prompt">Conditional Prompt</h3>

<p>Next, we have <strong>conditional prompts</strong>. You use these to tell the AI to create content based on certain rules or conditions. Try this one:</p>

<pre><code class="language-prompt">Draft a story about a new company building a spaceship to fly to Mars, founded by an astronaut, a few former NASA and ESA engineers, and an awarded cook.
</code></pre>

<h3 id="multiple-choice-prompt">Multiple Choice Prompt</h3>

<p>In <strong>multiple choice prompts</strong> you present the AI with several options from which it must choose or recommend the most appropriate one based on the context or criteria provided.</p>

<pre><code class="language-prompt">What do we need to fly to Mars?
Expand All @@ -111,6 +117,8 @@ <h2 id="exercise-1--warmup-with-basic-prompts">Exercise 1 – Warmup with Basic
D) a private jet
</code></pre>

<h3 id="zero-shot-prompt-classification-example">Zero-shot Prompt: classification example</h3>

<p>The previous examples are simple <strong>Zero-shot prompts</strong>. In these prompts we do not provide any example, we directly instruct the model to answer a question and we rely on the training data to obtain the answer. (Keep in mind that nowadays Bing chat has access to the internet, and it is also using some other techniques like meta-prompting, function calling, content filtering and RAG, so this is not completely true, but for this exercise we will just ignore this).</p>

<pre><code class="language-prompt">Classify the text into neutral, negative, or positive.
Expand All @@ -127,6 +135,8 @@ <h2 id="exercise-1--warmup-with-basic-prompts">Exercise 1 – Warmup with Basic

<p>Now Copilot must have given this a second thought and understood the nuances.</p>

<h3 id="exercise-1-conclusion">Exercise 1 Conclusion</h3>

<blockquote>
<p>Excellent job on completing the first exercise! Remember, there is no ‘one-size-fits-all’ approach to using AI. Feel free to experiment with different types of prompts to see what results you get. The more you experiment, the more you will understand how to guide Copilot effectively. If you need some more examples for each type of prompt, check the <a href="#some-more-example-prompts">example guide</a> at the end of this document.</p>
</blockquote>
Expand All @@ -137,7 +147,7 @@ <h2 id="exercise-2--create-your-own-space-startup">Exercise 2 – Create your ow
<p>As we dive into the second exercise, keep in mind that this is your opportunity to get creative and experiment. Try different prompt techniques, adjust your instructions, and see how Copilot responds. Remember, there is no right or wrong way to do this – the goal is to learn and have fun!</p>
</blockquote>

<h3 id="introduction">Introduction</h3>
<h3 id="copilot-details">Copilot details</h3>

<p>You may have noticed by now that Copilot can give you up to thirty answers in a session:</p>

Expand All @@ -149,9 +159,9 @@ <h3 id="introduction">Introduction</h3>

<h3 id="step-1-set-the-context">Step 1: Set the context</h3>

<p>Usually, Large Language Model (LLM) chat apps use a System Message and some templates to set the rules of the generation. We cannot change the system message for Copilot, but we can provide our own context for the session as a first message.</p>
<p>Usually, Large Language Model (LLM) chat apps use a <strong>System Message</strong> (usually hidden to you) and templates to set the rules of the generation. We cannot change the system message for Copilot, but we can provide a message to define our own context for the session.</p>

<p>In this exercise, we want you to be the CEO of a new spaceship startup, so Copilot will be your executive assistant, which will help you shape your ideas. Write a prompt like this to set the context, but remember to tailor it to your own preferences (i.e.: you do not need to be an awarded cook 😉):</p>
<p>In this exercise, we want you to be the CEO of a new spaceship startup, and Copilot will be your executive assistant, which will help you shape your ideas. Write a prompt like this to set the context, but remember to <strong>tailor it to your own preferences</strong> (i.e.: you do not need to be an awarded cook 😉):</p>

<pre><code class="language-prompt">You are an executive assistant to an awarded cook that now is the CEO of a cutting-edge spaceship startup; your role is multifaceted and pivotal. You possess a deep understanding of aerospace engineering, which allows you to contribute significantly to the design and logistics of human spaceships bound for Mars. Your strategic planning skills enable you to assist in setting long-term goals, allocating resources effectively, and ensuring that every project milestone aligns with the company’s ambitious vision.

Expand All @@ -160,7 +170,7 @@ <h3 id="step-1-set-the-context">Step 1: Set the context</h3>
Your personal traits are what make you extraordinary. Your passion for space, visionary outlook, and proactive nature equips you to anticipate challenges and address them with resilience. Detail-oriented and adaptable, you maintain composure under pressure, making you an indispensable asset to the CEO and the entire organization as you collectively strive to achieve the monumental task of shipping a human spaceship to Mars.
</code></pre>

<p>This was again a zero-Shot prompt, but we are just establishing the context.</p>
<p>This was again a <strong>zero-Shot prompt</strong>, but we are just establishing the context.</p>

<h3 id="step-2-generate-a-name-for-your-space-startup">Step 2: Generate a name for your space startup</h3>

Expand Down
20 changes: 15 additions & 5 deletions web/promptlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ By Florian Follonier - Cloud Solution Architect Data & AI - Microsoft

& Juan Manuel Servera - Cloud Solution Architect App Inno - Microsoft

## Prompt Engineering Hands-on Lab: An Introduction
## Introduction

Welcome to the Prompt Engineering Hands-on Lab!

Expand All @@ -31,6 +31,8 @@ For this exercise we are going to use Microsoft Copilot, your everyday AI compan

![Screenshot showing Copilot on the web.](./img/Copilot%20in%20desktop.png)

### Seed Text Prompt

Write the following prompt in the “Ask me anything…” textbox:

```prompt
Expand All @@ -57,12 +59,16 @@ The space is

You will get a shorter, more concise answer.

### Conditional Prompt

Next, we have **conditional prompts**. You use these to tell the AI to create content based on certain rules or conditions. Try this one:

```prompt
Draft a story about a new company building a spaceship to fly to Mars, founded by an astronaut, a few former NASA and ESA engineers, and an awarded cook.
```

### Multiple Choice Prompt

In **multiple choice prompts** you present the AI with several options from which it must choose or recommend the most appropriate one based on the context or criteria provided.

```prompt
Expand All @@ -74,6 +80,8 @@ C) a spaceship
D) a private jet
```

### Zero-shot Prompt: classification example

The previous examples are simple **Zero-shot prompts**. In these prompts we do not provide any example, we directly instruct the model to answer a question and we rely on the training data to obtain the answer. (Keep in mind that nowadays Bing chat has access to the internet, and it is also using some other techniques like meta-prompting, function calling, content filtering and RAG, so this is not completely true, but for this exercise we will just ignore this).

```prompt
Expand All @@ -92,13 +100,15 @@ Are you sure? What if the word cool was factual in this sentence?

Now Copilot must have given this a second thought and understood the nuances.

### Exercise 1 Conclusion

> Excellent job on completing the first exercise! Remember, there is no 'one-size-fits-all' approach to using AI. Feel free to experiment with different types of prompts to see what results you get. The more you experiment, the more you will understand how to guide Copilot effectively. If you need some more examples for each type of prompt, check the [example guide](#some-more-example-prompts) at the end of this document.
## Exercise 2 – Create your own space startup

> As we dive into the second exercise, keep in mind that this is your opportunity to get creative and experiment. Try different prompt techniques, adjust your instructions, and see how Copilot responds. Remember, there is no right or wrong way to do this – the goal is to learn and have fun!
### Introduction
### Copilot details

You may have noticed by now that Copilot can give you up to thirty answers in a session:

Expand All @@ -110,9 +120,9 @@ In this exercise, you will use Copilot to generate various elements of your own

### Step 1: Set the context

Usually, Large Language Model (LLM) chat apps use a System Message and some templates to set the rules of the generation. We cannot change the system message for Copilot, but we can provide our own context for the session as a first message.
Usually, Large Language Model (LLM) chat apps use a **System Message** (usually hidden to you) and templates to set the rules of the generation. We cannot change the system message for Copilot, but we can provide a message to define our own context for the session.

In this exercise, we want you to be the CEO of a new spaceship startup, so Copilot will be your executive assistant, which will help you shape your ideas. Write a prompt like this to set the context, but remember to tailor it to your own preferences (i.e.: you do not need to be an awarded cook 😉):
In this exercise, we want you to be the CEO of a new spaceship startup, and Copilot will be your executive assistant, which will help you shape your ideas. Write a prompt like this to set the context, but remember to **tailor it to your own preferences** (i.e.: you do not need to be an awarded cook 😉):

```prompt
You are an executive assistant to an awarded cook that now is the CEO of a cutting-edge spaceship startup; your role is multifaceted and pivotal. You possess a deep understanding of aerospace engineering, which allows you to contribute significantly to the design and logistics of human spaceships bound for Mars. Your strategic planning skills enable you to assist in setting long-term goals, allocating resources effectively, and ensuring that every project milestone aligns with the company’s ambitious vision.
Expand All @@ -122,7 +132,7 @@ Your creative input is crucial in ideating innovative solutions and designing a
Your personal traits are what make you extraordinary. Your passion for space, visionary outlook, and proactive nature equips you to anticipate challenges and address them with resilience. Detail-oriented and adaptable, you maintain composure under pressure, making you an indispensable asset to the CEO and the entire organization as you collectively strive to achieve the monumental task of shipping a human spaceship to Mars.
```

This was again a zero-Shot prompt, but we are just establishing the context.
This was again a **zero-Shot prompt**, but we are just establishing the context.

### Step 2: Generate a name for your space startup

Expand Down

0 comments on commit 007e26d

Please sign in to comment.