fix: _extract_skill_json crashes on a truthy non-string teacher response (#1630)
This commit is contained in:
@@ -327,7 +327,7 @@ def _extract_skill_json(teacher_response: str) -> Optional[Dict[str, Any]]:
|
||||
treated as "teacher declined to write a skill", per the prompt
|
||||
contract.
|
||||
"""
|
||||
if not teacher_response:
|
||||
if not isinstance(teacher_response, str) or not teacher_response:
|
||||
return None
|
||||
import json
|
||||
m = re.search(r"```(?:json)?\s*\n(\{[\s\S]*?\})\s*\n```", teacher_response)
|
||||
|
||||
Reference in New Issue
Block a user