Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def summarize_paper(

for attempt in range(3):
try:
response = client.messages.create(
# Streaming is required for long-running requests (extended thinking + web search)
with client.messages.stream(
model=model,
max_tokens=32000,
thinking={
Expand All @@ -127,7 +128,8 @@ def summarize_paper(
),
}
],
)
) as stream:
response = stream.get_final_message()
break
except anthropic.APIStatusError as e:
if e.status_code in (429, 529) and attempt < 2:
Expand Down