fix: correct try: block indentation in run_coaching_session (#105)

This commit is contained in:
KoalaTrapLord authored and GitHub committed 2026-03-26 13:44:33 -04:00
1 parent cb99388e3c
commit c9e932ef43
1 file changed
+3 -1
+3 -1
View File
@@ -300,7 +300,9 @@ class CoachService:
completion_tokens=usage.output_tokens if usage else 0,
parsed_json=None,
)
try: cleaned = re.sub(r'^```(?:json)?\s*', '', content.strip()) cleaned = re.sub(r'\s*```$', '', cleaned.strip())
try:
cleaned = re.sub(r'^```(?:json)?\s*', '', content.strip())
cleaned = re.sub(r'\s*```$', '', cleaned.strip())
llm_response.parsed_json = json.loads(cleaned)
except (json.JSONDecodeError, ValueError):
# Try to find JSON object in the text