Skip to content

Commit 022ae2a

Browse files
authored
Merge pull request #8 from Azure-Samples/bethany-fixes
updates and fixes on quests
2 parents 1c9c82e + e8d2d5d commit 022ae2a

16 files changed

+150
-105
lines changed

.github/steps/0-welcome.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ Click on a quest and follow the instructions to get started.
4242

4343
[![Static Badge](https://img.shields.io/badge/Quest-I_want_to_integrate_external_data_using_RAG-purple)](../../issues/new?title=Quest:+I+want+to+create+my+first+AI+app+with+RAG&labels=quest&body=%F0%9F%93%9A+I%27m+diving+into+RAG+and+building+my+first+retrieval-augmented+AI+app%21+Let%27s+do+this%21%0A%0A**Please+wait+about+15+seconds.+This+issue+will+automatically+close+and+the+README+will+update+with+your+next+instructions.**)
4444

45-
[![Static Badge](https://img.shields.io/badge/Quest-I_want_to_build_an_AI_Agent-violet)](../../issues/new?title=Quest:+I+want+to+build+an+agent&labels=quest&body=%F0%9F%A4%96+Let%27s+build+an+AI+agent+that+can+help+and+interact+with+users%21+Excited+for+this+step%21%0A%0A**Please+wait+about+15+seconds.+This+issue+will+automatically+close+and+the+README+will+update+with+your+next+instructions.**)
46-
4745
[![Static Badge](https://img.shields.io/badge/Quest-I_want_to_explore_frameworks-yellow)](../../issues/new?title=Quest:+I+want+to+explore+frameworks&labels=quest&body=🛠️+Let%27s+explore+frameworks+and+build+something+amazing%21+Excited+to+learn+and+experiment%21%0A%0A**Please+wait+about+15+seconds.+This+issue+will+automatically+close+and+the+README+will+update+with+your+next+instructions.**)
4846

47+
[![Static Badge](https://img.shields.io/badge/Quest-I_want_to_build_an_AI_Agent-violet)](../../issues/new?title=Quest:+I+want+to+build+an+agent&labels=quest&body=%F0%9F%A4%96+Let%27s+build+an+AI+agent+that+can+help+and+interact+with+users%21+Excited+for+this+step%21%0A%0A**Please+wait+about+15+seconds.+This+issue+will+automatically+close+and+the+README+will+update+with+your+next+instructions.**)
48+
4949
[![Static Badge](https://img.shields.io/badge/Quest-I_want_to_use_MCP_tools-cyan)](../../issues/new?title=Quest:+I+want+to+use+MCP+tools&labels=quest&body=🔧+Time+to+dive+into+MCP+tools%21+Let%27s+get+started%21%0A%0A**Please+wait+about+15+seconds.+This+issue+will+automatically+close+and+the+README+will+update+with+your+next+instructions.**)
5050

51+
[![Static Badge](https://img.shields.io/badge/Quest-I_want_to_automate_code_reviews-crimson)](../../issues/new?title=Quest:+I+want+to+automate+code+reviews&labels=quest&body=📄+Let%27s+use+AI+to+review+your+code%21%0A%0A**Please+click+on+Create+below,+then+wait+about+15+seconds.+This+issue+will+automatically+close+and+the+README+will+update+with+your+next+instructions.**)
52+
5153
[![Static Badge](https://img.shields.io/badge/Quest-I_want_to_create_templates-pink)](../../issues/new?title=Quest:+I+want+to+create+templates&labels=quest&body=📄+Let%27s+create+templates+to+streamline+future+projects%21+Excited+to+design+and+build%21%0A%0A**Please+wait+about+15+seconds.+This+issue+will+automatically+close+and+the+README+will+update+with+your+next+instructions.**)
5254

53-
[![Static Badge](https://img.shields.io/badge/Quest-I_want_to_automate_code_reviews-crimson)](../../issues/new?title=Quest:+I+want+to+automate+code+reviews&labels=quest&body=📄+Let%27s+use+AI+to+review+your+code%21%0A%0A**Please+click+on+Create+below,+then+wait+about+15+seconds.+This+issue+will+automatically+close+and+the+README+will+update+with+your+next+instructions.**)
5455

5556

.github/steps/1-genai-prototype.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ With GitHub Models, you can use GitHub Personal Access Tokens (PAT) to authentic
2222

2323
1. Right click [GitHub Models](https://github.com/marketplace/models) and open in a new tab
2424

25-
‼️ Open the link IN A NEW TAB so you can keep this page open for reference.‼️
25+
> [!NOTE]
26+
> Open the link IN A NEW TAB so you can keep this page open for reference.
2627
2728
2. Click on **explore the full model catalog** to see the available models.
2829

.github/steps/2-to-azure.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,27 @@ In this step, you will learn how to deploy your AI model to Azure AI Foundry aft
2020

2121
- You have already completed the previous steps in this project and have opened the **model playground on GitHub Models.**
2222

23-
## 🧠 GitHub Models to Azure AI Foundry
23+
> [!IMPORTANT]
24+
> If you have done the previous quest, ensure you pull your changes from GitHub using `git pull` before continuing with this project to update the project README.
2425
25-
‼️ The following steps on GitHub Models should be in A SEPARATE BROWSER TAB. Keep this tab open for reference.
26+
## 🧠 GitHub Models to Azure AI Foundry
27+
> [!Note]
28+
> The following steps on GitHub Models should be in A SEPARATE BROWSER TAB. Keep this tab open for reference.
2629
2730
1. On the separate tab on the GitHub models playground, click on **Use this model** and select **Language: JavaScript** and **SDK: Azure AI Inference SDK**.
2831

29-
![Use model](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/use-this-model-button.png?raw=true)
32+
![Use model](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/use-this-model-button.png?raw=true)
3033

3134
2. Under **Create a personal access token**, select **Get production key** and this will take you to ai.azure.com and prompt you to:-
3235
- Sign in to your Azure account
3336
- Select your Azure subscription
3437
- Deploy model
3538

36-
![Select subscription](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/ai-foundry-select-subscription.png?raw=true)
39+
![Select subscription](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/ai-foundry-select-subscription.png?raw=true)
3740

3841
3. The model you selected will be pre-populated in the **Deployment name** field. You can optionally click on **Customize** to change the default configuration on deployment type, model version, tokens per minute (TPM) rate limit etc.
3942

40-
![Customize model for deployment](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/deploy-model.png?raw=true)
43+
![Customize model for deployment](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/deploy-model.png?raw=true)
4144

4245
## 🧰 AI Foundry VS Code Extension
4346

@@ -47,15 +50,15 @@ To continue working with your deployed model in VS Code, you will need to instal
4750

4851
2. Once installed, click on the **AI Foundry** icon in the left sidebar and click on **Set Default Project**. Select your project and expand the **Models** section. You should see your deployed model(s) listed there.
4952

50-
![Set default project](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/set-default-project.png?raw=true)
53+
![Set default project](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/set-default-project.png?raw=true)
5154

5255
3. Click on the model name to open the model details view, where you can see the model's metadata, including the model version, deployment status, and TPM rate limit.
5356

54-
![List of models](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/model-list.png?raw=true)
57+
![List of models](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/model-list.png?raw=true)
5558

5659
4. Right click on your model and select **Open in Playground**. This will open a tab in VS Code with a chat Playground, where you can test your deployed model.
5760

58-
![AI Foundry playground](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/ai-foundry-playground.png?raw=true)
61+
![AI Foundry playground](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/ai-foundry-playground.png?raw=true)
5962

6063
5. You can also use the **Compare** feature to compare the performance of your deployed model with other models for manual evaluation. Once you are happy with the performance of your deployed model, right click on the model and select **Open Code File**, then:
6164
- Select **SDK**: Azure AI Inference SDK/ Azure OpenAI SDK
@@ -89,7 +92,7 @@ To continue working with your deployed model in VS Code, you will need to instal
8992

9093
8. Finally, run `node ai-foundry.js` and observe the output in the terminal. You should see the response from your deployed model.
9194

92-
![AI Foundry sample code](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/run-ai-foundry-sample.png?raw=true)
95+
![AI Foundry sample code](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/run-ai-foundry-sample.png?raw=true)
9396

9497

9598
## ✅ Activity: Push `ai-foundry.js` code to your repository

.github/steps/3-add-chat-ui.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ In this step, you will learn how to add a simple chat interface to your AI appli
2020

2121
- The `ai-foundry.js` file being referenced in this step is a script created in the previous step, _moving AI prototye to Azure_. However, if you have not completed the previous step, this shouldn't block you from completing this quest.
2222

23+
> [!IMPORTANT]
24+
> If you have done the previous quest, ensure you pull your changes from GitHub using `git pull` before continuing with this project to update the project README.
25+
2326
## Step 1️⃣ : Initialize a new Vite project
2427

2528
### Introduction to Azure Developer CLI (azd)
@@ -75,7 +78,7 @@ npm run dev
7578

7679
Navigate to `http://localhost:5173` in your browser to see the chat interface.
7780

78-
![AI Chat Interface](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/vite-lit-ai-chat-interface.png?raw=true)
81+
![AI Chat Interface](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/vite-lit-ai-chat-interface.png?raw=true)
7982

8083
## Step 2️⃣: Add your AI model to the chat interface
8184

@@ -215,7 +218,7 @@ Rename the `_mockAiCall` function to `_apiCall` and update the `sendMessage` met
215218

216219
With the server running, navigate to `http://localhost:5173` in your browser. You should be able to send messages to the AI model and receive responses.
217220

218-
![AI Chat Interface AI Foundry](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/ai-chat-interface-ai-foundry.png?raw=true)
221+
![AI Chat Interface AI Foundry](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/ai-chat-interface-ai-foundry.png?raw=true)
219222

220223
## Step 4️⃣: Deploy to Azure
221224

@@ -302,7 +305,7 @@ To deploy the application,
302305
- Select your Azure subscription,
303306
- Select a location for the resources.
304307

305-
![azd up](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/azd-up.png?raw=true)
308+
![azd up](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/azd-up.png?raw=true)
306309

307310

308311
## ✅ Activity: Push deployment infra code to your repository

.github/steps/4-add-rag.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ In this step, you will learn how to add RAG (**R**etrieval-**A**ugmented **G**en
2020

2121
- You have completed the previous steps and have a working AI app that can answer questions. If you haven't, please click the **Reset Progress** button above to select the _Add a simple chat interface_ quest.
2222

23+
> [!IMPORTANT]
24+
> If you have done the previous quest, ensure you pull your changes from GitHub using `git pull` before continuing with this project to update the project README.
2325
2426
To complete this step, you will need to get a sample dataset in any format (e.g., PDF, CSV, JSON) to work with.
2527

26-
An an example, will use a [sample Contoso Electronics Employee Handbook PDF](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/employee_handbook.pdf) file. **You can bring any file of your choice**, but make sure it contains relevant information that you want your AI app to use for RAG. The code provided here will work with any text-based file.
28+
An example, will use a [sample Contoso Electronics Employee Handbook PDF](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/employee_handbook.pdf) file. **You can bring any file of your choice**, but make sure it contains relevant information that you want your AI app to use for RAG. The code provided here will work with any text-based file.
2729

2830
- Create a new folder `data` in the root of your project and move the file in it. To search and read your PDF, you will need to extract the text from it. You can use any PDF parser library of your choice, but for this example, we will use the `pdf-parse` library.
2931

@@ -364,24 +366,24 @@ Open your browser to use the app, usually at `http://localhost:5123`.
364366
2. Ask a question related to the employee handbook, such as _"What is our company's mission statement?"_
365367
- The expected outcome is that the AI will respond with an answer based on the content of the employee handbook PDF, and the relevant excerpts will be displayed below the response.
366368

367-
![AI Foundry RAG with context](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/ai-app-with-rag.png?raw=true)
369+
![AI Foundry RAG with context](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/ai-app-with-rag.png?raw=true)
368370

369371
3. Now ask a question not covered in the employee handbook, such as _"What's the company's stock price?"_
370372
- The expected outcome is that the AI will respond saying it doesn't have the information, and no excerpts will be displayed.
371373
372-
![AI Foundry RAG out of scope](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/ai-app-with-rag-outofscope.png?raw=true)
374+
![AI Foundry RAG out of scope](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/ai-app-with-rag-outofscope.png?raw=true)
373375
374376
### Test with RAG OFF 🔴
375377
1. **Clear chat and uncheck the "Use Employee Handbook" checkbox**.
376378
2. Ask a question related to the employee handbook, such as _"What is our company's mission statement?"_
377379
- The expected outcome is that the AI will respond with a generic answer, and likely ask for more context, and no excerpts will be displayed.
378380
379-
![AI Foundry no RAG no context](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/no-rag-company.png?raw=true)
381+
![AI Foundry no RAG no context](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/no-rag-company.png?raw=true)
380382
381383
3. Now ask any general question, such as _"What is the capital of Morocco?"_
382384
- The expected outcome is that the AI will respond with the correct answer, and no excerpts will be displayed.
383385
384-
![AI Foundry no RAG general question](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/no-rag-general.png?raw=true)
386+
![AI Foundry no RAG general question](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/no-rag-general.png?raw=true)
385387
386388
Notice how, with RAG enabled, the AI is strictly limited to the handbook and refuses to answer unrelated questions. With RAG disabled, the AI is more flexible and answers any question to the best of its ability.
387389

.github/steps/5-frameworks.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ In this step, you will learn you can simplify integrating AI features into your
2020

2121
This step assumes you have already completed the previous steps in this project and have a working web application that uses Azure's LLM endpoints. If you haven't done so, please click the **Reset Progress** button above to select the _Add a simple chat interface_ quest.
2222

23+
> [!IMPORTANT]
24+
> If you have done the previous quest, ensure you pull your changes from GitHub using `git pull` before continuing with this project to update the project README.
25+
2326
## Step 1️⃣: Add LangChain.js to your project
2427
We'll first install LangChain.js in our project to ensure our backend can communicate with Azure's LLM endpoints using LangChain's abstractions.
2528

@@ -96,7 +99,7 @@ Currently, the chat model does not remember previous messages. For example, if y
9699

97100
Then ask the model _"Quiz time. What's my name?"_. The model will not remember your name because your name is not passed to the model in the prompt.
98101

99-
![Memory test](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/memory-test.png?raw=true)
102+
![Memory test](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/memory-test.png?raw=true)
100103

101104
To add memory, you will use LangChain's built-in memory modules - `ChatMessageHistory` and `ConversationSummaryMemory`. Conversation memory allows the AI to reference previous exchanges in a session, enabling more context-aware and coherent responses and LangChain.js provides built-in memory modules that make this easy to implement. With LangChain, you can implement stateful AI app experiences without manually managing chat logs, and you can easily switch between in-memory, Redis, or other storage options.
102105

@@ -201,7 +204,7 @@ app.post("/chat", async (req, res) => {
201204

202205
To test this, open the chat UI in your browser and send a message like _"Hey, you can call me Terry. What should I call you?"_ and then ask _"Quiz time. What's my name?"_. The model should remember your name.
203206

204-
![Memory test passed](https://github.com/Azure-Samples/JS-Journey-to-AI-Foundry/blob/assets/jsai-buildathon-assets/memory-test-passed.png?raw=true)
207+
![Memory test passed](https://github.com/Azure-Samples/JS-AI-Build-a-thon/blob/assets/jsai-buildathon-assets/memory-test-passed.png?raw=true)
205208

206209
## ✅ Activity: Push your updated code to the repository
207210

@@ -211,7 +214,7 @@ To complete this quest and **AUTOMATICALLY UPDATE** your progress, you MUST push
211214

212215
**Checklist**
213216

214-
- [ ] Have a `@langchain/azure-oenai` dependency in your package.json in the webapi directory
217+
- [ ] Have a `@langchain/azure-openai` dependency in your package.json in the webapi directory
215218

216219
1. In the terminal, run the following commands to add, commit, and push your changes to the repository:
217220

0 commit comments

Comments
 (0)