Skip to content

Commit 21def89

Browse files
authored
Merge pull request #42 from sdgilley/sdg-ai-rag-tutorial
expand to three-part series for RAG tutorial
2 parents bc74eff + b2e5e0d commit 21def89

File tree

8 files changed

+395
-276
lines changed

8 files changed

+395
-276
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: include file
3+
description: include file
4+
author: sdgilley
5+
ms.reviewer: sgilley
6+
ms.author: esgiley
7+
ms.service: azure-ai-studio
8+
ms.topic: include
9+
ms.date: 08/29/2024
10+
ms.custom: include
11+
---
12+
13+
You install the Azure CLI and sign in from your local development environment, so that you can use your user credentials to call the Azure OpenAI service.
14+
15+
In most cases you can install the Azure CLI from your terminal using the following command:
16+
# [Windows](#tab/windows)
17+
18+
```powershell
19+
winget install -e --id Microsoft.AzureCLI
20+
```
21+
22+
# [Linux](#tab/linux)
23+
24+
```bash
25+
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
26+
```
27+
28+
# [macOS](#tab/macos)
29+
30+
```bash
31+
brew update && brew install azure-cli
32+
```
33+
34+
---
35+
36+
You can follow instructions [How to install the Azure CLI](/cli/azure/install-azure-cli) if these commands don't work for your particular operating system or setup.
37+
38+
After you install the Azure CLI, sign in using the ``az login`` command and sign-in using the browser:
39+
```
40+
az login
41+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: include file
3+
description: include file
4+
author: sdgilley
5+
ms.reviewer: sgilley
6+
ms.author: sgilley
7+
ms.service: azure-ai-studio
8+
ms.topic: include
9+
ms.date: 08/29/2024
10+
ms.custom: include
11+
---
12+
13+
Use pip to install the prompt flow SDK into the virtual environment that you created.
14+
```
15+
pip install promptflow
16+
pip install azure-identity
17+
```
18+
19+
The prompt flow SDK takes a dependency on multiple packages, that you can choose to separately install if you don't want all of them:
20+
* ```promptflow-core```: contains the core prompt flow runtime used for executing LLM code
21+
* ```promptflow-tracing```: lightweight library used for emitting OpenTelemetry traces in standards
22+
* ```promptflow-devkit```: contains the prompt flow test bed and trace viewer tools for local development environments
23+
* ```openai```: client libraries for using the Azure OpenAI service
24+
* ```python-dotenv```: used to set environment variables by reading them from ```.env``` files
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: include file
3+
description: include file
4+
author: sdgilley
5+
ms.reviewer: sgilley
6+
ms.author: esgiley
7+
ms.service: azure-ai-studio
8+
ms.topic: include
9+
ms.date: 08/29/2024
10+
ms.custom: include
11+
---
12+
13+
First we need to create a new Python environment we can use to install the prompt flow SDK packages. DO NOT install packages into your global python installation. You should always use a virtual or conda environment when installing python packages, otherwise you can break your global install of Python.
14+
15+
### If needed, install Python
16+
17+
We recommend using Python 3.10 or later, but having at least Python 3.8 is required. If you don't have a suitable version of Python installed, you can follow the instructions in the [VS Code Python Tutorial](https://code.visualstudio.com/docs/python/python-tutorial#_install-a-python-interpreter) for the easiest way of installing Python on your operating system.
18+
19+
### Create a virtual environment
20+
21+
If you already have Python 3.10 or higher installed, you can create a virtual environment using the following commands:
22+
23+
# [Windows](#tab/windows)
24+
25+
```bash
26+
py -3 -m venv .venv
27+
.venv\scripts\activate
28+
```
29+
30+
# [Linux](#tab/linux)
31+
32+
```bash
33+
python3 -m venv .venv
34+
source .venv/bin/activate
35+
```
36+
37+
# [macOS](#tab/macos)
38+
39+
```bash
40+
python3 -m venv .venv
41+
source .venv/bin/activate
42+
```
43+
44+
---
45+
46+
Activating the Python environment means that when you run ```python``` or ```pip``` from the command line, you then use the Python interpreter contained in the ```.venv``` folder of your application.
47+
48+
> [!NOTE]
49+
> You can use the ```deactivate``` command to exit the python virtual environment, and can later reactivate it when needed.

articles/ai-studio/quickstarts/get-started-code.md

Lines changed: 3 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -66,94 +66,19 @@ To grant yourself access to the Azure AI Services resource that you're using:
6666

6767
## Install the Azure CLI and sign in
6868

69-
You install the Azure CLI and sign in from your local development environment, so that you can use your user credentials to call the Azure OpenAI service.
70-
71-
In most cases you can install the Azure CLI from your terminal using the following command:
72-
# [Windows](#tab/windows)
73-
74-
```powershell
75-
winget install -e --id Microsoft.AzureCLI
76-
```
77-
78-
# [Linux](#tab/linux)
79-
80-
```bash
81-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
82-
```
83-
84-
# [macOS](#tab/macos)
85-
86-
```bash
87-
brew update && brew install azure-cli
88-
```
89-
90-
---
91-
92-
You can follow instructions [How to install the Azure CLI](/cli/azure/install-azure-cli) if these commands don't work for your particular operating system or setup.
93-
94-
After you install the Azure CLI, sign in using the ``az login`` command and sign-in using the browser:
95-
```
96-
az login
97-
```
69+
[!INCLUDE [Install the Azure CLI](../includes/install-cli.md)]
9870

9971
Now we create our app and call the Azure OpenAI Service from code.
10072

10173
## Create a new Python environment
10274

103-
First we need to create a new Python environment we can use to install the prompt flow SDK packages. DO NOT install packages into your global python installation. You should always use a virtual or conda environment when installing python packages, otherwise you can break your global install of Python.
104-
105-
### If needed, install Python
106-
107-
We recommend using Python 3.10 or later, but having at least Python 3.8 is required. If you don't have a suitable version of Python installed, you can follow the instructions in the [VS Code Python Tutorial](https://code.visualstudio.com/docs/python/python-tutorial#_install-a-python-interpreter) for the easiest way of installing Python on your operating system.
108-
109-
### Create a virtual environment
110-
111-
If you already have Python 3.10 or higher installed, you can create a virtual environment using the following commands:
112-
113-
# [Windows](#tab/windows)
114-
115-
```bash
116-
py -3 -m venv .venv
117-
.venv\scripts\activate
118-
```
119-
120-
# [Linux](#tab/linux)
121-
122-
```bash
123-
python3 -m venv .venv
124-
source .venv/bin/activate
125-
```
126-
127-
# [macOS](#tab/macos)
128-
129-
```bash
130-
python3 -m venv .venv
131-
source .venv/bin/activate
132-
```
133-
134-
---
135-
136-
Activating the Python environment means that when you run ```python``` or ```pip``` from the command line, you then use the Python interpreter contained in the ```.venv``` folder of your application.
137-
138-
> [!NOTE]
139-
> You can use the ```deactivate``` command to exit the python virtual environment, and can later reactivate it when needed.
75+
[!INCLUDE [Install Python](../includes/install-python.md)]
14076

14177
## Install the prompt flow SDK
14278

14379
In this section, we use prompt flow to build our application. [Prompt flow](https://microsoft.github.io/promptflow) is a suite of development tools designed to streamline the end-to-end development cycle of LLM-based AI applications, from ideation, prototyping, testing, evaluation to production deployment and monitoring.
14480

145-
Use pip to install the prompt flow SDK into the virtual environment that you created.
146-
```
147-
pip install promptflow
148-
pip install azure-identity
149-
```
150-
151-
The prompt flow SDK takes a dependency on multiple packages, that you can choose to separately install if you don't want all of them:
152-
* ```promptflow-core```: contains the core prompt flow runtime used for executing LLM code
153-
* ```promptflow-tracing```: lightweight library used for emitting OpenTelemetry traces in standards
154-
* ```promptflow-devkit```: contains the prompt flow test bed and trace viewer tools for local development environments
155-
* ```openai```: client libraries for using the Azure OpenAI service
156-
* ```python-dotenv```: used to set environment variables by reading them from ```.env``` files
81+
[!INCLUDE [Install prompt flow](../includes/install-promptflow.md)]
15782

15883
## Configure your environment variables
15984

articles/ai-studio/toc.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ items:
2929
items:
3030
- name: Deploy an enterprise chat web app
3131
href: tutorials/deploy-chat-web-app.md
32-
- name: Build your own copilot with the prompt flow SDK
32+
- name: Build a custom chat app with the prompt flow SDK
3333
items:
34-
- name: "Part 1: Build a custom copilot that implements RAG"
34+
- name: "Part 1: Set up resources"
35+
href: tutorials/copilot-sdk-create-resources.md
36+
displayName: code,sdk
37+
- name: "Part 2: Add data retrieval to a chat app"
3538
href: tutorials/copilot-sdk-build-rag.md
3639
displayName: code,sdk
37-
- name: "Part 2: Evaluate and deploy your custom copilot"
40+
- name: "Part 3: Evaluate and deploy a chat app"
3841
href: tutorials/copilot-sdk-evaluate-deploy.md
3942
displayName: code,sdk
4043
- name: How-to

0 commit comments

Comments
 (0)