Skip to content

Commit 21b1481

Browse files
committed
Have ChatAnthropic() yield thinking deltas
1 parent 2e539ac commit 21b1481

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
@@ -390,8 +390,11 @@ def _structured_tool_call(**kwargs: Any):
390390
return kwargs_full
391391

392392
def stream_text(self, chunk) -> Optional[str]:
393-
if chunk.type == "content_block_delta" and chunk.delta.type == "text_delta":
394-
return chunk.delta.text
393+
if chunk.type == "content_block_delta":
394+
if chunk.delta.type == "text_delta":
395+
return chunk.delta.text
396+
if chunk.delta.type == "thinking_delta":
397+
return chunk.delta.thinking
395398
return None
396399

397400
def stream_merge_chunks(self, completion, chunk):

0 commit comments

Comments
 (0)