feat: GLM 디버그 정보 출력 추가
- `_glm_debug_enabled()`가 활성화된 경우, content와 reasoning의 길이 및 JSON 유사성 여부를 포함한 디버그 정보를 출력하도록 로직 추가 - 디버깅을 위한 content 및 reasoning의 미리보기 문자열도 포함하여 문제 해결 시 유용한 정보 제공
This commit is contained in:
@@ -391,6 +391,16 @@ class AIPlanner:
|
||||
content_stripped = content.strip()
|
||||
reasoning_stripped = reasoning.strip()
|
||||
|
||||
if _glm_debug_enabled():
|
||||
c_preview = (content_stripped[:120] + ("..." if len(content_stripped) > 120 else ""))
|
||||
r_preview = (reasoning_stripped[:120] + ("..." if len(reasoning_stripped) > 120 else ""))
|
||||
print(
|
||||
"[GLM][디버그] extract_assistant_text | "
|
||||
f"content_len={len(content_stripped)} reasoning_len={len(reasoning_stripped)} | "
|
||||
f"content_looks_json={looks_like_json(content_stripped)} reasoning_looks_json={looks_like_json(reasoning_stripped)} | "
|
||||
f"content_preview={c_preview!r} | reasoning_preview={r_preview!r}"
|
||||
)
|
||||
|
||||
if looks_like_json(content_stripped):
|
||||
return content_stripped
|
||||
if looks_like_json(reasoning_stripped):
|
||||
|
||||
Reference in New Issue
Block a user