From 2eef9c978cb295241ebe655f40ab67685a0a52ec Mon Sep 17 00:00:00 2001 From: jknapp Date: Sun, 16 Mar 2025 21:07:02 -0700 Subject: [PATCH] testing thinking --- claude_sonnet-3-7-bedrock.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/claude_sonnet-3-7-bedrock.py b/claude_sonnet-3-7-bedrock.py index 13f70d5..d461c31 100644 --- a/claude_sonnet-3-7-bedrock.py +++ b/claude_sonnet-3-7-bedrock.py @@ -176,7 +176,6 @@ class Pipeline: def stream_response(self, model_id: str, payload: dict) -> Generator: # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-runtime/client/converse_stream.html streaming_response = self.bedrock_runtime.converse_stream(**payload) - print(f"{streaming_response} for {payload}") thinking_block = None for chunk in streaming_response["stream"]: if "contentBlockDelta" in chunk: @@ -189,8 +188,8 @@ class Pipeline: yield '\n' yield delta["reasoningContent"]["text"] - if "contentBlockStop" in chunk and chunk["contentBlockStop"]["contentBlockIndex"] == thinking_block: - yield '\n\n' + if "contentBlockStop" in chunk: #and chunk["contentBlockStop"]["contentBlockIndex"] == thinking_block: + yield '\n\n' # Handle regular response text if "text" in delta: