Skip to content

Commit 7673b8f

Browse files
authored
Merge pull request #14 from MicrosoftCloudEssentials-LearningHub/revamp-agents
3 models deployed in new foundry sdk
2 parents 63342d1 + cad1399 commit 7673b8f

18 files changed

Lines changed: 1150 additions & 505 deletions

.github/workflows/use-visitor-counter.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,38 +57,30 @@ jobs:
5757
git config --global user.name "github-actions[bot]"
5858
git config --global user.email "github-actions[bot]@users.noreply.github.com"
5959
60+
# Commit and push logic for PR events (merge, not rebase)
6061
- name: Commit and push changes (PR)
6162
if: github.event_name == 'pull_request'
6263
env:
6364
TOKEN: ${{ secrets.GITHUB_TOKEN }}
6465
run: |
6566
git fetch origin
66-
git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }}
67-
git add "*.md" metrics.json
67+
git checkout ${{ github.head_ref }}
68+
git pull origin ${{ github.head_ref }} || echo "No merge needed"
69+
git add -A
6870
git commit -m "Update visitor count" || echo "No changes to commit"
6971
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
70-
git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed"
71-
git push origin HEAD:${{ github.event.pull_request.head.ref }}
72+
git push origin HEAD:${{ github.head_ref }}
7273
74+
# Commit and push logic for non-PR events (merge, not rebase)
7375
- name: Commit and push changes (non-PR)
7476
if: github.event_name != 'pull_request'
7577
env:
7678
TOKEN: ${{ secrets.GITHUB_TOKEN }}
7779
run: |
7880
git fetch origin
79-
git checkout ${{ github.event.pull_request.head.ref }} || git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }}
80-
git add "*.md" metrics.json
81+
git checkout ${{ github.ref_name }} || git checkout -b ${{ github.ref_name }} origin/${{ github.ref_name }}
82+
git pull origin ${{ github.ref_name }} || echo "No merge needed"
83+
git add -A
8184
git commit -m "Update visitor count" || echo "No changes to commit"
8285
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
83-
git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed"
84-
git push origin HEAD:${{ github.event.pull_request.head.ref }}
85-
86-
- name: Create Pull Request (non-PR)
87-
if: github.event_name != 'pull_request'
88-
uses: peter-evans/create-pull-request@v6
89-
with:
90-
token: ${{ secrets.GITHUB_TOKEN }}
91-
branch: update-visitor-count
92-
title: "Update visitor count"
93-
body: "Automated update of visitor count"
94-
base: main
86+
git push origin HEAD:${{ github.ref_name }}

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Costa Rica
55
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
66
[brown9804](https://github.com/brown9804)
77

8-
Last updated: 2026-01-12
8+
Last updated: 2026-01-29
99

1010
----------
1111

@@ -153,7 +153,7 @@ graph TD
153153
- Configures delegation relationships between Product Manager and specialized agents.
154154
- Saves the unique Agent IDs, delegation endpoints, and A2A configuration to the `.env` file.
155155

156-
> E.g `Old UI`
156+
> E.g `Classic UI`
157157
158158
<img width="1881" height="1000" alt="image" src="https://github.com/user-attachments/assets/59a9dcaf-9291-403c-b8b0-1195c1375aac" />
159159

@@ -171,7 +171,7 @@ graph TD
171171
- Visit `https://<your-app-name>.azurewebsites.net`.
172172
- You should see the Zava chat interface with A2A protocol support.
173173

174-
> E.g `Old UI`
174+
> E.g `Classic UI`
175175
176176
<https://github.com/user-attachments/assets/a1139528-6b37-4ac2-a1cb-771788ff45a4>
177177

@@ -187,7 +187,7 @@ graph TD
187187
- Core agents: Cora, Interior Design, Inventory, Loyalty, Cart Manager
188188
- Product Management Specialist with delegation capabilities
189189

190-
> E.g `Old UI`
190+
> E.g `Classic UI`
191191
192192
<https://github.com/user-attachments/assets/3c562ccd-cff3-4a30-b9f8-44111fb71113>
193193

@@ -202,7 +202,7 @@ graph TD
202202

203203
<!-- START BADGE -->
204204
<div align="center">
205-
<img src="https://img.shields.io/badge/Total%20views-1324-limegreen" alt="Total views">
206-
<p>Refresh Date: 2026-01-12</p>
205+
<img src="https://img.shields.io/badge/Total%20views-1329-limegreen" alt="Total views">
206+
<p>Refresh Date: 2026-01-29</p>
207207
</div>
208208
<!-- END BADGE -->

TROUBLESHOOTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ terraform apply
347347

348348
<!-- START BADGE -->
349349
<div align="center">
350-
<img src="https://img.shields.io/badge/Total%20views-1324-limegreen" alt="Total views">
351-
<p>Refresh Date: 2026-01-12</p>
350+
<img src="https://img.shields.io/badge/Total%20views-1329-limegreen" alt="Total views">
351+
<p>Refresh Date: 2026-01-29</p>
352352
</div>
353353
<!-- END BADGE -->

src/a2a/status_automation.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if () {
1111

1212
# Check automation endpoint
1313
try {
14-
= Invoke-RestMethod -Uri "https://zava-4f64ebdc-app.azurewebsites.net/a2a/automation/status" -TimeoutSec 5
14+
= Invoke-RestMethod -Uri "https://zava-63f59c9f-app.azurewebsites.net/a2a/automation/status" -TimeoutSec 5
1515
Write-Host "Automation Status: "
1616
} catch {
1717
Write-Host "Automation endpoint not accessible"

src/app/agents/agent_processor.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
try:
99
from azure.ai.projects import AIProjectClient # type: ignore
1010
from azure.identity import DefaultAzureCredential # type: ignore
11+
from services.azure_auth import get_default_credential, get_inference_credential # type: ignore
1112
_REMOTE_AVAILABLE = True
1213
except Exception:
1314
_REMOTE_AVAILABLE = False
@@ -112,11 +113,32 @@ def __init__(self, agent_id: str, project_endpoint: str = None):
112113
project_endpoint: Optional project endpoint (reads from env if not provided)
113114
"""
114115
self.agent_id = agent_id
115-
self.project_endpoint = project_endpoint or os.environ.get("AZURE_AI_AGENT_ENDPOINT")
116-
117-
if not self.project_endpoint or not _REMOTE_AVAILABLE:
116+
117+
raw_endpoint = (
118+
project_endpoint
119+
or os.environ.get("AZURE_AI_AGENT_ENDPOINT")
120+
or os.environ.get("AZURE_AI_PROJECT_ENDPOINT")
121+
or os.environ.get("AZURE_AI_FOUNDRY_ENDPOINT")
122+
)
123+
if not raw_endpoint or not _REMOTE_AVAILABLE:
118124
raise ValueError("Remote agent support unavailable (endpoint or SDK missing)")
119-
self.client = AIProjectClient(endpoint=self.project_endpoint, credential=DefaultAzureCredential())
125+
126+
# The Azure AI Projects SDK expects: https://<hub>.services.ai.azure.com/api/projects/<project>
127+
project_name = os.environ.get("AZURE_AI_PROJECT_NAME")
128+
normalized = raw_endpoint.replace("cognitiveservices.azure.com", "services.ai.azure.com")
129+
130+
if "/api/projects/" in normalized:
131+
# Already a full project endpoint
132+
full_project_endpoint = normalized.rstrip("/")
133+
elif project_name:
134+
base_endpoint = normalized.split("/api/")[0].rstrip("/")
135+
full_project_endpoint = f"{base_endpoint}/api/projects/{project_name}"
136+
else:
137+
# Best-effort fallback (may still work if the caller provided a full endpoint)
138+
full_project_endpoint = normalized.rstrip("/")
139+
140+
self.project_endpoint = full_project_endpoint
141+
self.client = AIProjectClient(endpoint=self.project_endpoint, credential=get_default_credential())
120142

121143
def run_conversation_with_text_stream(
122144
self,

0 commit comments

Comments
 (0)