testing thinking
This commit is contained in:
parent
8824b8a591
commit
0f7c22e3aa
@ -178,7 +178,6 @@ class Pipeline:
|
||||
streaming_response = self.bedrock_runtime.converse_stream(**payload)
|
||||
thinking_block = None
|
||||
for chunk in streaming_response["stream"]:
|
||||
print(chunk)
|
||||
if "contentBlockDelta" in chunk:
|
||||
delta = chunk["contentBlockDelta"]["delta"]
|
||||
|
||||
@ -189,8 +188,8 @@ class Pipeline:
|
||||
yield '<thinking>\n'
|
||||
yield delta["reasoningContent"]["text"]
|
||||
|
||||
if "contentBlockStop" in chunk: #and chunk["contentBlockStop"]["contentBlockIndex"] == thinking_block:
|
||||
yield '</thinking>\n\n'
|
||||
if "contentBlockStop" in chunk and chunk["contentBlockStop"]["contentBlockIndex"] == thinking_block:
|
||||
yield '</thinking>\n\n'
|
||||
|
||||
# Handle regular response text
|
||||
if "text" in delta:
|
||||
|
Loading…
x
Reference in New Issue
Block a user