Skip to content

Commit 23c469b

Browse files
resolved pylint and agent recreation issue
1 parent 3170e01 commit 23c469b

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/backend/app_kernel.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from auth.auth_utils import get_authenticated_user_details
1111

1212
# Azure monitoring
13-
from azure.monitor.opentelemetry import configure_azure_monitor
13+
# from azure.monitor.opentelemetry import configure_azure_monitor
1414
from config_kernel import Config
1515
from event_utils import track_event_if_configured
1616

@@ -34,11 +34,11 @@
3434
# Updated import for KernelArguments
3535
from utils_kernel import initialize_runtime_and_context, rai_success
3636

37-
#Check if the Application Insights Instrumentation Key is set in the environment variables
37+
# Check if the Application Insights Instrumentation Key is set in the environment variables
3838
connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
3939
if connection_string:
4040
# Configure Application Insights if the Instrumentation Key is found
41-
configure_azure_monitor(connection_string=connection_string)
41+
# configure_azure_monitor(connection_string=connection_string)
4242
logging.info(
4343
"Application Insights configured with the provided Instrumentation Key"
4444
)
@@ -51,7 +51,6 @@
5151
# Configure logging
5252
logging.basicConfig(level=logging.INFO)
5353

54-
5554
# Suppress INFO logs from 'azure.core.pipeline.policies.http_logging_policy'
5655
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(
5756
logging.WARNING

src/backend/kernel_agents/agent_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ async def _create_azure_ai_agent_definition(
276276
# # First try to get an existing agent with this name as assistant_id
277277
try:
278278
agent_id = None
279-
agent_list = await client.agents.list_agents()
280-
for agent in agent_list.data:
279+
agent_list = client.agents.list_agents()
280+
async for agent in agent_list:
281281
if agent.name == agent_name:
282282
agent_id = agent.id
283283
break

src/backend/kernel_agents/agent_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Import the new AppConfig instance
88
from app_config import config
99
from azure.ai.agents.models import (ResponseFormatJsonSchema,
10-
ResponseFormatJsonSchemaType)
10+
ResponseFormatJsonSchemaType)
1111
from context.cosmos_memory_kernel import CosmosMemoryContext
1212
from kernel_agents.agent_base import BaseAgent
1313
from kernel_agents.generic_agent import GenericAgent
@@ -326,4 +326,4 @@ def clear_cache(cls, session_id: Optional[str] = None) -> None:
326326
else:
327327
cls._agent_cache.clear()
328328
cls._azure_ai_agent_cache.clear()
329-
logger.info("Cleared all agent caches")
329+
logger.info("Cleared all agent caches")

src/backend/kernel_agents/planner_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Any, Dict, List, Optional, Tuple
55

66
from azure.ai.agents.models import (ResponseFormatJsonSchema,
7-
ResponseFormatJsonSchemaType)
7+
ResponseFormatJsonSchemaType)
88
from context.cosmos_memory_kernel import CosmosMemoryContext
99
from event_utils import track_event_if_configured
1010
from kernel_agents.agent_base import BaseAgent
@@ -596,4 +596,4 @@ def _get_template():
596596
Choose from {{$agents_str}} ONLY for planning your steps.
597597
598598
"""
599-
return instruction_template
599+
return instruction_template

0 commit comments

Comments
 (0)