From 48e15f82328172b874233b2557cec263cff3aad2 Mon Sep 17 00:00:00 2001 From: Woody Date: Tue, 28 Apr 2026 16:50:26 +0800 Subject: [PATCH] feat(llm): log structured LLM response and extra_body Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- backend/app/services/llm_client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/app/services/llm_client.py b/backend/app/services/llm_client.py index 0959198..816293f 100644 --- a/backend/app/services/llm_client.py +++ b/backend/app/services/llm_client.py @@ -128,12 +128,20 @@ class LLMClient: self.logger.info("[%s] Structured LLM request started. Prompt: %s", step_name, prompt_preview) start_time = time.perf_counter() + extra_body = self._build_extra_body() + self.logger.info("[%s] Structured LLM Extra Body: %s", step_name, str(extra_body)) + try: model = self._get_langchain_model() structured = model.with_structured_output(pydantic_model, method="json_schema") result = await structured.ainvoke(prompt) elapsed_ms = (time.perf_counter() - start_time) * 1000 + self.logger.info( + "[%s] Structured LLM Response: %s", + step_name, + getattr(result, "model_dump", lambda: result)(), + ) self.logger.info( "[%s] Structured LLM request completed in %.2fms", step_name,