Skip to content

Commit 05f3039

Browse files
committed
3 models deployed in new foundry sdk
1 parent 63342d1 commit 05f3039

15 files changed

Lines changed: 1133 additions & 480 deletions

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

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)