Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
38194fb
Merge pull request #783 from microsoft/dev-v4
Roopan-Microsoft Feb 3, 2026
e4896d5
agent framework v2 changes
Abdul-Microsoft Feb 4, 2026
95b0049
v2 changes
Abdul-Microsoft Feb 5, 2026
124fcf7
Enhance agent orchestration and configuration for Azure AI Search int…
Abdul-Microsoft Feb 10, 2026
1bc5725
fix for agent multiple times calling
Abdul-Microsoft Feb 11, 2026
45582e1
Enhance get_chat_client to use latest agent version and log agent name
Abdul-Microsoft Feb 13, 2026
3a4dfbb
Update dependency versions in pyproject.toml and uv.lock for consistency
Abdul-Microsoft Feb 13, 2026
c513f4b
Add user state cleanup and enhance AzureAIClient initialization with …
Abdul-Microsoft Feb 13, 2026
f2eb8e3
Revert "Add user state cleanup and enhance AzureAIClient initializati…
Abdul-Microsoft Feb 13, 2026
643306f
updated the logging and resolved the HR scenario issue
Dhruvkumar-Microsoft Feb 13, 2026
303c866
Refactor FoundryAgentTemplate and MagenticAgentFactory to remove debu…
Abdul-Microsoft Feb 16, 2026
8d1d1c7
Merge remote-tracking branch 'origin/dev-v4' into ab-agentframeworkv2…
Abdul-Microsoft Feb 16, 2026
bb5331e
Refactor agent creation and configuration to avoid mutating original …
Abdul-Microsoft Feb 20, 2026
60c894e
Remove description and instructions from MagenticManager ChatAgent in…
Abdul-Microsoft Feb 20, 2026
26d9331
Merge remote-tracking branch 'origin/dev-v4' into ab-agentframeworkv2…
Abdul-Microsoft Feb 27, 2026
6a0462b
resolved pylint issues
Abdul-Microsoft Feb 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@

from contextlib import asynccontextmanager

from common.config.app_config import config

# Configure logging levels FIRST, before any logging calls
logging.basicConfig(level=getattr(logging, config.AZURE_BASIC_LOGGING_LEVEL.upper(), logging.INFO))


from azure.monitor.opentelemetry import configure_azure_monitor
from common.config.app_config import config
# from common.config.app_config import config
from common.models.messages_af import UserLanguage

# FastAPI imports
Expand Down Expand Up @@ -61,7 +66,7 @@ async def lifespan(app: FastAPI):
)

# Configure logging levels from environment variables
logging.basicConfig(level=getattr(logging, config.AZURE_BASIC_LOGGING_LEVEL.upper(), logging.INFO))
# logging.basicConfig(level=getattr(logging, config.AZURE_BASIC_LOGGING_LEVEL.upper(), logging.INFO))

# Configure Azure package logging levels
azure_level = getattr(logging, config.AZURE_PACKAGE_LOGGING_LEVEL.upper(), logging.WARNING)
Expand All @@ -73,6 +78,8 @@ async def lifespan(app: FastAPI):

logging.getLogger("opentelemetry.sdk").setLevel(logging.ERROR)

logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.WARNING)

# Initialize the FastAPI app
app = FastAPI(lifespan=lifespan)

Expand Down
14 changes: 10 additions & 4 deletions src/backend/common/utils/utils_af.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@ async def create_RAI_agent(
)

model_deployment_name = config.AZURE_OPENAI_RAI_DEPLOYMENT_NAME
team.team_id = "rai_team" # Use a fixed team ID for RAI agent
team.name = "RAI Team"
team.description = "Team responsible for Responsible AI checks"

# Create a copy to avoid mutating the caller's team config.
# The original team object is reused later (e.g., for orchestration init),
# so mutating it would corrupt the real team name/id.
rai_team = team.model_copy()
rai_team.team_id = "rai_team"
rai_team.name = "RAI Team"
rai_team.description = "Team responsible for Responsible AI checks"

agent = FoundryAgentTemplate(
agent_name=agent_name,
agent_description=agent_description,
Expand All @@ -101,7 +107,7 @@ async def create_RAI_agent(
project_endpoint=config.AZURE_AI_PROJECT_ENDPOINT,
mcp_config=None,
search_config=None,
team_config=team,
team_config=rai_team,
memory_store=memory_store,
)

Expand Down
24 changes: 0 additions & 24 deletions src/backend/common/utils/utils_agents.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@

import logging
import secrets
import string
from typing import Optional

from common.database.database_base import DatabaseBase
from common.models.messages_af import TeamConfiguration


def generate_assistant_id(prefix: str = "asst_", length: int = 24) -> str:
Expand All @@ -21,22 +16,3 @@ def generate_assistant_id(prefix: str = "asst_", length: int = 24) -> str:
# cryptographically strong randomness
random_part = "".join(secrets.choice(alphabet) for _ in range(length))
return f"{prefix}{random_part}"


async def get_database_team_agent_id(
memory_store: DatabaseBase, team_config: TeamConfiguration, agent_name: str
) -> Optional[str]:
"""Retrieve existing team agent from database, if any."""
agent_id = None
try:
currentAgent = await memory_store.get_team_agent(
team_id=team_config.team_id, agent_name=agent_name
)
if currentAgent and currentAgent.agent_foundry_id:
agent_id = currentAgent.agent_foundry_id

except (
Exception
) as ex: # Consider narrowing this to specific exceptions if possible
logging.error("Failed to initialize Get database team agent: %s", ex)
return agent_id
23 changes: 11 additions & 12 deletions src/backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,37 @@ requires-python = ">=3.11"
dependencies = [
"azure-ai-evaluation==1.11.0",
"azure-ai-inference==1.0.0b9",
"azure-ai-projects==1.0.0",
"azure-ai-agents==1.2.0b5",
"azure-ai-projects==2.0.0b3",
"azure-cosmos==4.9.0",
"azure-identity==1.24.0",
"azure-monitor-events-extension==0.1.0",
"azure-monitor-opentelemetry==1.7.0",
"azure-monitor-opentelemetry==1.8.5",
"azure-search-documents==11.5.3",
"fastapi==0.116.1",
"openai==1.105.0",
"opentelemetry-api==1.36.0",
"opentelemetry-exporter-otlp-proto-grpc==1.36.0",
"opentelemetry-exporter-otlp-proto-http==1.36.0",
"opentelemetry-instrumentation-fastapi==0.57b0",
"openai==2.16.0",
"opentelemetry-api==1.39.0",
"opentelemetry-exporter-otlp-proto-grpc==1.39.0",
"opentelemetry-exporter-otlp-proto-http==1.39.0",
"opentelemetry-instrumentation-fastapi==0.60b0",
"opentelemetry-instrumentation-openai==0.46.2",
"opentelemetry-sdk==1.36.0",
"opentelemetry-sdk==1.39.0",
"pytest==8.4.1",
"pytest-asyncio==0.24.0",
"pytest-cov==5.0.0",
"python-dotenv==1.1.1",
"python-multipart==0.0.22",
"semantic-kernel==1.39.4",
"uvicorn==0.35.0",
"pylint-pydantic==0.3.5",
"pexpect==4.9.0",
"mcp==1.26.0",
"werkzeug==3.1.5",
"azure-core==1.38.0",
"agent-framework>=1.0.0b251105",
"agent-framework-azure-ai==1.0.0b260130",
"agent-framework-core==1.0.0b260130",
"urllib3==2.6.3",
"protobuf==5.29.6",
"cryptography==46.0.5",
"aiohttp==3.13.3",
"pyasn1==0.6.2",
"nltk==3.9.3",
]
]
Loading