@@ -22,7 +22,47 @@ This folder contains examples demonstrating different ways to create and use age
2222
2323## Environment Variables
2424
25- Make sure to set the following environment variables before running the examples :
25+ Before running the examples, you need to set up your environment variables. You can do this in one of two ways :
2626
27- - ` AZURE_AI_PROJECT_ENDPOINT ` : Your Azure AI project endpoint
28- - ` AZURE_AI_MODEL_DEPLOYMENT_NAME ` : The name of your model deployment
27+ ### Option 1: Using a .env file (Recommended)
28+
29+ 1 . Copy the ` .env.example ` file from the ` python ` directory to create a ` .env ` file:
30+ ``` bash
31+ cp ../../.env.example ../../.env
32+ ```
33+
34+ 2 . Edit the ` .env ` file and add your values:
35+ ```
36+ AZURE_AI_PROJECT_ENDPOINT="your-project-endpoint"
37+ AZURE_AI_MODEL_DEPLOYMENT_NAME="your-model-deployment-name"
38+ ```
39+
40+ 3 . For samples using Bing Grounding search (like ` azure_ai_with_bing_grounding.py ` and ` azure_ai_with_multiple_tools.py ` ), you'll also need:
41+ ```
42+ BING_CONNECTION_ID="/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.CognitiveServices/accounts/{ai-service-name}/projects/{project-name}/connections/{connection-name}"
43+ ```
44+
45+ To get your Bing connection ID:
46+ - Go to [ Azure AI Foundry portal] ( https://ai.azure.com )
47+ - Navigate to your project's "Connected resources" section
48+ - Add a new connection for "Grounding with Bing Search"
49+ - Copy the connection ID
50+
51+ ### Option 2: Using environment variables directly
52+
53+ Set the environment variables in your shell:
54+
55+ ``` bash
56+ export AZURE_AI_PROJECT_ENDPOINT=" your-project-endpoint"
57+ export AZURE_AI_MODEL_DEPLOYMENT_NAME=" your-model-deployment-name"
58+ export BING_CONNECTION_ID=" your-bing-connection-id" # Optional, only needed for web search samples
59+ ```
60+
61+ ### Required Variables
62+
63+ - ` AZURE_AI_PROJECT_ENDPOINT ` : Your Azure AI project endpoint (required for all examples)
64+ - ` AZURE_AI_MODEL_DEPLOYMENT_NAME ` : The name of your model deployment (required for all examples)
65+
66+ ### Optional Variables
67+
68+ - ` BING_CONNECTION_ID ` : Your Bing connection ID (required for ` azure_ai_with_bing_grounding.py ` and ` azure_ai_with_multiple_tools.py ` )
0 commit comments