Skip to content

Commit a960c05

Browse files
abossardCopilot
andcommitted
Fix NameError: OpenAICallLoggingCallback was removed but still referenced
The class was deleted in the dead code cleanup but agents.py still used it. Replaced with make_llm_logging_callback from agent_builder. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 511adb0 commit a960c05

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/agents.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def _env_int(name: str, default: int) -> int:
5757
# Local CSV service
5858
from csv_data import get_csv_ticket_service
5959

60-
from langchain_core.callbacks import BaseCallbackHandler
6160
from langchain_core.tools import StructuredTool
6261

6362
# Third-party - LangChain and LangGraph
@@ -408,7 +407,8 @@ async def run_agent(self, request: AgentRequest) -> AgentResponse:
408407

409408
invoke_config: dict[str, Any] = {"recursion_limit": REACT_AGENT_RECURSION_LIMIT}
410409
if OPENAI_CALL_LOGGING_ENABLED:
411-
invoke_config["callbacks"] = [OpenAICallLoggingCallback()]
410+
from agent_builder.engine.callbacks import make_llm_logging_callback
411+
invoke_config["callbacks"] = [make_llm_logging_callback(OPENAI_MODEL)]
412412

413413
result = await self._react_agent.ainvoke(
414414
{"messages": [("system", self._system_prompt), ("user", request.prompt)]},

0 commit comments

Comments
 (0)