summaryrefslogtreecommitdiff
path: root/backend/app/services/llm.py
diff options
context:
space:
mode:
authorblackhao <13851610112@163.com>2025-12-11 00:45:20 -0600
committerblackhao <13851610112@163.com>2025-12-11 00:45:20 -0600
commite70c89790517a57b5a5819806e112fd0efaeadb8 (patch)
treec2e005659bfc99a8a3953080405a1c8b7a486ae4 /backend/app/services/llm.py
parentf47ea989671ac53958a226f9ff419423863c596a (diff)
add some log
Diffstat (limited to 'backend/app/services/llm.py')
-rw-r--r--backend/app/services/llm.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/backend/app/services/llm.py b/backend/app/services/llm.py
index 87b9155..6f79d35 100644
--- a/backend/app/services/llm.py
+++ b/backend/app/services/llm.py
@@ -159,10 +159,13 @@ async def stream_openai(
for out in final_resp.output:
out_type = getattr(out, 'type', None)
out_content = getattr(out, 'content', None)
+ print(f"[responses debug] output item: type={out_type}, content={out_content}")
if out_type == 'message' and out_content:
for c in out_content:
c_type = getattr(c, 'type', None)
+ c_text = getattr(c, 'text', None)
+ print(f"[responses debug] content item: type={c_type}, text={c_text[:100] if c_text else None}...")
if c_type == 'output_text':
text_val = getattr(c, 'text', None)
if text_val:
@@ -170,7 +173,8 @@ async def stream_openai(
found_content = True
if not found_content:
- yield f"\n[Debug: Completed but no content. Resp: {final_resp}]"
+ print(f"[responses debug] No content found! final_resp.output={final_resp.output}")
+ yield f"\n[Debug: Completed but no content extracted]"
return
elif final_resp.status in ['failed', 'cancelled', 'expired']: