Skip to content

Commit

Permalink
Initial scope of lessons - placeholders added
Browse files Browse the repository at this point in the history
  • Loading branch information
nitya committed Sep 15, 2024
1 parent 911e1eb commit 3a86581
Show file tree
Hide file tree
Showing 35 changed files with 235 additions and 35 deletions.
29 changes: 29 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

# For GitHub Marketplace Deployments
# -----------------------------------------
# These are standardized names (Sep 16, 2024)
# from https://github.com/marketplace/models
# -----------------------------------------
GITHUB_TOKEN=
GITHUB_MODEL_DEPLOYMENT=
SERVERLESS_KEY=${GITHUB_TOKEN}

# For Azure OpenAI Deployments
AZURE_OPENAI_ENDPOINT=
AZURE_OPENAI_KEY=
AZURE_OPENAI_DEPLOYMENT=

# For OpenAI Deployments
OPENAI_ENDPOINT=
OPENAI_KEY=
OPENAI_DEPLOYMENT=
OPENAI_ORGANIZATION=
OPENAI_PROJECT=

# For Azure Serverless Deployments
AZURE_SERVERLESS_ENDPOINT=
AZURE_SERVERLESS_KEY=
AZURE_SERVERLESS_DEPLOYMENT=

# API VERSION
API_VERSION=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
22 changes: 21 additions & 1 deletion docs/1. Core Concepts/01.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# 1. Motivation
# 1. Introduction

Building production-ready generative AI applications involves 3 stages:

- **Ideation** - rapid prototyping, testing apps with simple test prompts.
- **Augmentation** - evaluation, testing quality & safety with larger datasets.
- **Operationalization** - deploying apps and monitoring them for insights.

The challenge is in providing developers with a developer experience and tooling support to streamline these stages - without requiring a massive learning curve in new semantics, model-specific APIs or plaform-specific SDKs.

What if we could make the **prompt** the central unit of development - and build tooling to build agency and observability around it? That's the vision behind Prompty. Watch this Microsoft Build 2024 session for a deeper dive into end-to-end AI development using Prompty and AI Studio.



Using Prompty you can:

- **Design Prompts** - Create & refine prompt templates in an IDE
- **Explore Models** - Configure model parameters, diverse deployments
- **Execute Prompts** - Use built-in tools and custom runtimes to test prompts
- **Observe Traces** - Use built-in features to track and debug execution
- **Compose Apps** - Chain and compose Prompty assets for complex flows
2 changes: 1 addition & 1 deletion docs/2. Prompty Quickstart/01.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Create Prompty
2 changes: 1 addition & 1 deletion docs/2. Prompty Quickstart/02.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Configure Models
2 changes: 1 addition & 1 deletion docs/2. Prompty Quickstart/03.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Create Sample
1 change: 1 addition & 0 deletions docs/2. Prompty Quickstart/04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Run Prompty
2 changes: 1 addition & 1 deletion docs/3. Prompt Engineering/01.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# System Context
2 changes: 1 addition & 1 deletion docs/3. Prompt Engineering/02.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Prompt Instructions
2 changes: 1 addition & 1 deletion docs/3. Prompt Engineering/03.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Model Parameters
1 change: 1 addition & 0 deletions docs/3. Prompt Engineering/04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Add Data
2 changes: 1 addition & 1 deletion docs/4. Model Choice/01.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Open AI
2 changes: 1 addition & 1 deletion docs/4. Model Choice/02.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Azure Open AI
2 changes: 1 addition & 1 deletion docs/4. Model Choice/03.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Azure Serverless
1 change: 1 addition & 0 deletions docs/4. Model Choice/04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# GitHub Marketplace
2 changes: 1 addition & 1 deletion docs/5. Observability/01.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Prompty Tracing
2 changes: 1 addition & 1 deletion docs/5. Observability/02.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Trace Decorators
2 changes: 1 addition & 1 deletion docs/5. Observability/03.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Trace Runs
1 change: 1 addition & 0 deletions docs/5. Observability/04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Open Telemetry
2 changes: 1 addition & 1 deletion docs/6. Testing/01.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Hardcoded Input
2 changes: 1 addition & 1 deletion docs/6. Testing/02.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Sample File
2 changes: 1 addition & 1 deletion docs/6. Testing/03.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Commandline Input
1 change: 1 addition & 0 deletions docs/6. Testing/04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Function Call
2 changes: 1 addition & 1 deletion docs/7. Compostion/01.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Prompty + Data Binding
2 changes: 1 addition & 1 deletion docs/7. Compostion/02.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Prompty + RAG Pattern
2 changes: 1 addition & 1 deletion docs/7. Compostion/03.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Prompty + Evaluation
1 change: 1 addition & 0 deletions docs/7. Compostion/04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Prompty + Multi-Agent
2 changes: 1 addition & 1 deletion docs/8. Evaluation/01.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# AI-Assisted Evaluation
2 changes: 1 addition & 1 deletion docs/8. Evaluation/02.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Evaluation Metrics
2 changes: 1 addition & 1 deletion docs/8. Evaluation/03.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# Evaluation Test Data
1 change: 1 addition & 0 deletions docs/8. Evaluation/04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Evaluation Workflow
49 changes: 36 additions & 13 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
# Welcome

[Prompty](https://prompty.ai) is a new type of **executable asset** that provides agency with observability during the **ideation** phase of your generative AI application development lifecycle.
By [definition](https://prompty.ai), Prompty is _a new asset class and format for LLM prompts that aims to provide observability, understandability, and portability for developers._ In this workshop, we explore what this means from core concepts to prompty prototyping in a series of hands-on labs.

Using Prompty you can:
## Learning Objectives

- **Design Prompts** - Create & refine prompt templates in an IDE
- **Explore Models** - Configure model parameters, diverse deployments
- **Execute Prompts** - Use built-in tools and custom runtimes to test prompts
- **Observe Traces** - Use built-in features to track and debug execution
- **Compose Apps** - Chain and compose Prompty assets for complex flows
The workshop is structured as a series of hands-on labs taking you from core concepts to prompt evaluation and composition, with code. On completion, you should be able to describe:

1. What Prompty is and the benefits it offers
2. How to create and execute a simple Prompty asset
4. How to choose and configure models for your prompt
3. How to engineer prompts for different scenarios
5. How to instrument Prompty assets for observability
6. How to evaluate prompts to assess quality and safety
7. How to compose Prompty assets for complex flows

## Learning Objectives
## Pre-Requisites

To complete these labs you will need:

1. A personal GitHub account (create one [for free](https://github.com/signup))
1. A Microsoft Azure account (create one [for free](https://azure.microsoft.com/free/))
1. Basic familiarity with Python syntax and tools
1. Basic familiarity with Generative AI concepts
1. Basic familiarity with Visual Studio Code tooling


## Learning Modules

By the end of the workshop, you should be able to have a better understanding of the following:
The workshop is organized into modules, each focused on one topic and containing a series of hands-on lab units. Click the module title to see details of the units.

??? note "1. Core Concepts"
- Prompty Specification
Expand Down Expand Up @@ -68,8 +82,17 @@ By the end of the workshop, you should be able to have a better understanding of
- By running evaluators with adversarial data
- By assessing safety with adversarial data

## Related Resources
## Learning Resources

Bookmark and explore these resources:

- [Documentation](https://prompty.ai/) - official documentation, in-progress.
- [Repository](https://github.com/microsoft/prompty) - open-source repository.
- [Prompty in Promptflow](https://microsoft.github.io/promptflow/tutorials/prompty-quickstart.html#) - with [examples](https://github.com/microsoft/promptflow/tree/main/examples/prompty)


Watch the Microsoft Build 2024 session for a practical tour of end-to-end usage.

<iframe width="800" height="450" src="https://www.youtube.com/embed/HALMFU7o9Gc" title="Practical End-to-End AI Development using Prompty and AI Studio | BRK114" frameborder="0" allowfullscreen></iframe>


- Prompty Documentation
- Prompty Templates
- Prompty Videos
40 changes: 40 additions & 0 deletions src/02-prompty-quickstart/00-azure-openai.prompty
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: ExamplePrompt
description: A prompt that uses context to ground an incoming question
authors:
- Seth Juarez
model:
api: chat
configuration:
type: azure_openai
azure_endpoint: ${env:AZURE_OPENAI_ENDPOINT}
azure_deployment: <your-deployment>
api_version: 2024-07-01-preview
parameters:
max_tokens: 3000
sample:
firstName: Seth
context: >
The Alpine Explorer Tent boasts a detachable divider for privacy,
numerous mesh windows and adjustable vents for ventilation, and
a waterproof design. It even has a built-in gear loft for storing
your outdoor essentials. In short, it's a blend of privacy, comfort,
and convenience, making it your second home in the heart of nature!
question: What can you tell me about your tents?
---

system:
You are an AI assistant who helps people find information. As the assistant,
you answer questions briefly, succinctly, and in a personable manner using
markdown and even add some personal flair with appropriate emojis.

# Customer
You are helping {{firstName}} to find answers to their questions.
Use their name to address them in your responses.

# Context
Use the following context to provide a more personalized response to {{firstName}}:
{{context}}

user:
{{question}}
40 changes: 40 additions & 0 deletions src/02-prompty-quickstart/00-azure-serverless.prompty
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Azure Serverless Prompty
description: Basic chat prompt using n
authors:
- Nitya Narasimhan
model:
api: chat
configuration:
type: azure_serverless
azure_endpoint: ${env:AZURE_SERVERLESS_ENDPOINT}
azure_deployment: ${env:AZURE_SERVERLESS_DEPLOYMENT:gpt-4}
api_version: ${env:API_VERSION}
parameters:
max_tokens: 3000
sample:
firstName: Seth
context: >
The Alpine Explorer Tent boasts a detachable divider for privacy,
numerous mesh windows and adjustable vents for ventilation, and
a waterproof design. It even has a built-in gear loft for storing
your outdoor essentials. In short, it's a blend of privacy, comfort,
and convenience, making it your second home in the heart of nature!
question: What can you tell me about your tents?
---

system:
You are an AI assistant who helps people find information. As the assistant,
you answer questions briefly, succinctly, and in a personable manner using
markdown and even add some personal flair with appropriate emojis.

# Customer
You are helping {{firstName}} to find answers to their questions.
Use their name to address them in your responses.

# Context
Use the following context to provide a more personalized response to {{firstName}}:
{{context}}

user:
{{question}}
40 changes: 40 additions & 0 deletions src/02-prompty-quickstart/00-github-serverless.prompty
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: ExamplePrompt
description: A prompt that uses context to ground an incoming question
authors:
- Seth Juarez
model:
api: chat
configuration:
type: serverless
endpoint: https://models.inference.ai.azure.com
model: Mistral-small
key: ${env:SERVERLESS_KEY:KEY}
parameters:
max_tokens: 3000
sample:
firstName: Nitya
context: >
The Alpine Explorer Tent boasts a detachable divider for privacy,
numerous mesh windows and adjustable vents for ventilation, and
a waterproof design. It even has a built-in gear loft for storing
your outdoor essentials. In short, it's a blend of privacy, comfort,
and convenience, making it your second home in the heart of nature!
question: What can you tell me about tents?
---

system:
You are an AI assistant who helps people find information. As the assistant,
you answer questions briefly, succinctly, and in a personable manner using
markdown and even add some personal flair with appropriate emojis.

# Customer
You are helping {{firstName}} to find answers to their questions.
Use their name to address them in your responses.

# Context
Use the following context to provide a more personalized response to {{firstName}}:
{{context}}

user:
{{question}}

0 comments on commit 3a86581

Please sign in to comment.