Conversation
|
👋 Thanks for contributing @copilot! We will review the pull request and get back to you soon. |
Co-authored-by: leestott <2511341+leestott@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Standardizes environment variable naming in lesson docs/notebooks and fixes a recurring AzureAIProjectAgentProvider(...) syntax issue by removing stray ,) fragments and relying on env-based auto-configuration.
Changes:
- Fixed invalid
AzureAIProjectAgentProviderinstantiations across notebooks/READMEs by removing dangling keyword args caused by a stray,). - Updated READMEs to remove/replace legacy
AZURE_OPENAI_*variables in favor of.env.example’sAZURE_AI_*convention. - Expanded root
.env.exampleand setup docs to include GitHub Models and Bing grounding variables used in later lessons.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| 12-context-engineering/code_samples/12-chat_summarization.ipynb | Fixes provider instantiation syntax and updates messaging to “Azure AI Foundry provider”. |
| 10-ai-agents-production/code_samples/10-python-agent-framework.ipynb | Fixes provider instantiation syntax to a valid single call. |
| 07-planning-design/README.md | Removes incorrect provider args and legacy env vars; uses provider env auto-detection. |
| 06-building-trustworthy-agents/README.md | Removes unsupported/incorrect endpoint/model args from provider constructor. |
| 04-tool-use/README.md | Replaces env var name in an AzureOpenAI client snippet and fixes provider instantiation syntax. |
| 02-explore-agentic-frameworks/README.md | Fixes repeated provider instantiation syntax errors. |
| 00-course-setup/README.md | Documents newly added .env variables for GitHub Models and Bing grounding. |
| .env.example | Adds GitHub Models + Bing grounding variables and clarifies Foundry project endpoint comment. |
Comments suppressed due to low confidence (1)
.env.example:6
- The default
AZURE_AI_MODEL_DEPLOYMENT_NAMEexample value (gpt-4o) appears inconsistent with several lesson snippets that referencegpt-4o-mini. To reduce learner confusion, consider aligning the example value with the model used most frequently in the lessons (or explicitly note that it must match the user’s deployment name and may begpt-4o-minidepending on what they deployed).
# Model deployment name in your Foundry project (e.g., gpt-4o)
AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Initialize the Azure OpenAI client | ||
| client = AzureOpenAI( | ||
| azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"), | ||
| azure_endpoint = os.getenv("AZURE_AI_PROJECT_ENDPOINT"), |
There was a problem hiding this comment.
AzureOpenAI(azure_endpoint=...) expects an Azure OpenAI resource endpoint (e.g., https://<resource>.openai.azure.com), not an Azure AI Foundry project endpoint. Using AZURE_AI_PROJECT_ENDPOINT here will misconfigure the client. Consider reverting this line to os.getenv("AZURE_OPENAI_ENDPOINT") (and keep that variable in docs for AzureOpenAI snippets), or switch the example to use the Foundry/Agent provider API consistently instead of AzureOpenAI.
| azure_endpoint = os.getenv("AZURE_AI_PROJECT_ENDPOINT"), | |
| azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"), |
Inconsistent env var names (
AZURE_OPENAI_ENDPOINT,AZURE_OPENAI_CHAT_DEPLOYMENT_NAME) scattered across README code snippets conflicted with.env.examplestandards (AZURE_AI_PROJECT_ENDPOINT,AZURE_AI_MODEL_DEPLOYMENT_NAME). SeveralAzureAIProjectAgentProviderinstantiations also had a systematic syntax error — a stray,)that made the code unparseable.Syntax fixes
Corrected broken
AzureAIProjectAgentProvidercalls across notebooks and READMEs (lessons 02, 04, 06, 07, 10, 12). Pattern was consistently:Env var name standardization
04-tool-use/README.md:AZURE_OPENAI_ENDPOINT→AZURE_AI_PROJECT_ENDPOINT07-planning-design/README.md: removedAZURE_OPENAI_ENDPOINTandAZURE_OPENAI_CHAT_DEPLOYMENT_NAMEreferences; provider now uses env-auto-detection06-building-trustworthy-agents/README.md: removed incorrectendpoint=/model=params from provider constructor.env.exampleand setup docsAdded missing variables so the root
.env.examplecovers all lessons 01–11:00-course-setup/README.mdupdated with corresponding lookup instructions for each new variable.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.