Skip to content

Commit f7dc812

Browse files
committed
Have ChatAnthropic() yield thinking deltas
1 parent f461b6f commit f7dc812

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

chatlas/_provider_anthropic.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,11 @@ def _structured_tool_call(**kwargs: Any):
445445
return kwargs_full
446446

447447
def stream_text(self, chunk) -> Optional[str]:
448-
if chunk.type == "content_block_delta" and chunk.delta.type == "text_delta":
449-
return chunk.delta.text
448+
if chunk.type == "content_block_delta":
449+
if chunk.delta.type == "text_delta":
450+
return chunk.delta.text
451+
if chunk.delta.type == "thinking_delta":
452+
return chunk.delta.thinking
450453
return None
451454

452455
def stream_merge_chunks(self, completion, chunk):

0 commit comments

Comments
 (0)