Skip to content

Commit 7e5bfc3

Browse files
committed
remove logs
1 parent dc1590b commit 7e5bfc3

File tree

5 files changed

+15
-23
lines changed

5 files changed

+15
-23
lines changed

src/backend/app_config.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def get_ai_project_client(self):
183183
self._ai_project_client = AIProjectClient.from_connection_string(
184184
credential=credential, conn_str=connection_string
185185
)
186-
logging.info("Successfully created AIProjectClient using connection string")
186+
187187
return self._ai_project_client
188188
except Exception as exc:
189189
logging.error("Failed to create AIProjectClient: %s", exc)
@@ -221,10 +221,8 @@ async def create_azure_ai_agent(
221221

222222
# First try to get an existing agent with this name as assistant_id
223223
try:
224-
logging.info(f"Trying to retrieve existing agent with ID: {agent_name}")
225-
existing_definition = await project_client.agents.get_agent(agent_name)
226-
logging.info(f"Found existing agent with ID: {agent_name}")
227224

225+
existing_definition = await project_client.agents.get_agent(agent_name)
228226
# Create the agent instance directly with project_client and existing definition
229227
agent = AzureAIAgent(
230228
client=project_client,
@@ -233,9 +231,6 @@ async def create_azure_ai_agent(
233231
plugins=tools,
234232
)
235233

236-
logging.info(
237-
f"Successfully loaded existing Azure AI Agent for {agent_name}"
238-
)
239234
return agent
240235
except Exception as e:
241236
# The Azure AI Projects SDK throws an exception when the agent doesn't exist

src/backend/app_kernel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ async def input_task_endpoint(input_task: InputTask, request: Request):
135135

136136
# Convert input task to JSON for the kernel function, add user_id here
137137

138-
logging.info(f"Input task: {input_task}")
139138
# Use the planner to handle the task
140139
result = await group_chat_manager.handle_input_task(input_task)
141140

src/backend/kernel_agents/agent_base.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,15 @@ async def async_init(self):
128128
"""
129129
logging.info(f"Initializing agent: {self._agent_name}")
130130
# Create Azure AI Agent or fallback
131-
self._agent = await config.create_azure_ai_agent(
132-
kernel=self._kernel,
133-
agent_name=self._agent_name,
134-
instructions=self._system_message,
135-
tools=self._tools,
136-
)
131+
if not self._agent:
132+
self._agent = await config.create_azure_ai_agent(
133+
kernel=self._kernel,
134+
agent_name=self._agent_name,
135+
instructions=self._system_message,
136+
tools=self._tools,
137+
)
138+
else:
139+
logging.info(f"Agent {self._agent_name} already initialized.")
137140
# Tools are registered with the kernel via get_tools_from_config
138141
return self
139142

@@ -248,8 +251,6 @@ async def handle_action_request(self, action_request: ActionRequest) -> str:
248251
)
249252
return response.json()
250253

251-
logging.info(f"Task completed: {response_content}")
252-
253254
# Update step status
254255
step.status = StepStatus.completed
255256
step.agent_reply = response_content

src/backend/kernel_agents/agent_factory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ async def create_agent(
129129
session_id in cls._agent_cache
130130
and agent_type in cls._agent_cache[session_id]
131131
):
132+
logger.info(
133+
f"Returning cached agent instance for session {session_id} and agent type {agent_type}"
134+
)
132135
return cls._agent_cache[session_id][agent_type]
133136

134137
# Get the agent class
@@ -302,7 +305,7 @@ async def create_all_agents(
302305

303306
# Phase 2: Create the planner agent with agent_instances
304307
planner_agent = await cls.create_agent(
305-
agent_type=planner_agent_type,
308+
agent_type=AgentType.PLANNER,
306309
session_id=session_id,
307310
user_id=user_id,
308311
temperature=temperature,

src/backend/kernel_agents/generic_agent.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,8 @@ def __init__(
4343
if not tools:
4444
# Get tools directly from GenericTools class
4545
tools_dict = GenericTools.get_all_kernel_functions()
46-
logging.info(
47-
f"GenericAgent: Got tools_dict with {len(tools_dict)} functions: {list(tools_dict.keys())}"
48-
)
4946

5047
tools = [KernelFunction.from_method(func) for func in tools_dict.values()]
51-
logging.info(
52-
f"GenericAgent: Created {len(tools)} KernelFunctions from tools_dict"
53-
)
5448

5549
# Use system message from config if not explicitly provided
5650
if not system_message:

0 commit comments

Comments
 (0)