Strip markdown fences in _call_sonnet response

This commit is contained in:
2026-04-05 02:46:38 -06:00
parent d7e475331d
commit 0c5d36d182
2 changed files with 26 additions and 2 deletions
+5 -1
View File
@@ -93,7 +93,11 @@ async def _call_sonnet(prompt: str) -> dict:
model=PROMOTION_MODEL,
usage_data=usage,
)
return json.loads(data["choices"][0]["message"]["content"])
content = data["choices"][0]["message"]["content"].strip()
if content.startswith("```") and content.endswith("```"):
lines = content.splitlines()
content = "\n".join(lines[1:-1])
return json.loads(content)
async def evaluate_promotion(caller_name: str, call_transcript: str) -> dict: