Skip to content

Commit edb0e8c

Browse files
committed
Fix get agent using env variable
1 parent f9c59e8 commit edb0e8c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/api/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def lifespan(app: fastapi.FastAPI):
8484
else:
8585
configure_azure_monitor(connection_string=application_insights_connection_string)
8686

87-
if os.environ.get("AZURE_AI_AGENT_ID") is not None:
87+
if os.environ.get("AZURE_AI_AGENT_ID"):
8888
try:
8989
agent = await ai_client.agents.get_agent(os.environ["AZURE_AI_AGENT_ID"])
9090
logger.info("Agent already exists, skipping creation")

src/gunicorn.conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ async def initialize_resources():
116116
)
117117

118118
# If the environment already has AZURE_AI_AGENT_ID, try fetching that agent
119-
if os.environ.get("AZURE_AI_AGENT_ID") is not None:
119+
if os.environ.get("AZURE_AI_AGENT_ID"):
120120
try:
121121
agent = await ai_client.agents.get_agent(os.environ["AZURE_AI_AGENT_ID"])
122122
logger.info(f"Found agent by ID: {agent.id}")

0 commit comments

Comments
 (0)