File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
anthropic_bridge/providers Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,7 @@ async def _stream_response(
327327 "output_tokens" : resp_usage .get ("output_tokens" , 0 ),
328328 }
329329 break
330+ break
330331
331332 except Exception as e :
332333 yield self ._sse (
Original file line number Diff line number Diff line change @@ -182,13 +182,15 @@ async def _stream_openrouter(
182182 lines = buffer .split ("\n " )
183183 buffer = lines .pop ()
184184
185+ done = False
185186 for line in lines :
186187 line = line .strip ()
187188 if not line or not line .startswith ("data: " ):
188189 continue
189190
190191 data_str = line [6 :]
191192 if data_str == "[DONE]" :
193+ done = True
192194 break
193195
194196 try :
@@ -397,6 +399,8 @@ async def _stream_openrouter(
397399 await get_reasoning_cache ().set (
398400 t ["id" ], current_reasoning_details .copy ()
399401 )
402+ if done :
403+ break
400404
401405 if thinking_started :
402406 yield self ._sse (
Original file line number Diff line number Diff line change 11[project ]
22name = " anthropic-bridge"
3- version = " 0.1.25 "
3+ version = " 0.1.26 "
44description = " Bridge Anthropic API to OpenRouter and OpenAI models."
55license = " MIT"
66requires-python = " >=3.11"
You can’t perform that action at this time.
0 commit comments