diff --git a/scripts/solve.py b/scripts/solve.py index 3840bba..bb745f4 100644 --- a/scripts/solve.py +++ b/scripts/solve.py @@ -156,12 +156,20 @@ async def call_api_streaming( try: chunk = json.loads(data) logger.debug(f"[{question_name}] Chunk: {chunk}") - delta = chunk.get("choices", [{}])[0].get("delta", {}) + choices = chunk.get("choices") + if not choices: + continue + delta = choices[0].get("delta", {}) content = delta.get("content") if content: full_content.append(content) + reasoning = delta.get("reasoning_content") + if reasoning: + full_content.append(reasoning) except json.JSONDecodeError: continue + except IndexError: + continue content = "".join(full_content) if not content: