testing thinking
This commit is contained in:
		@@ -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,7 +188,7 @@ class Pipeline:
 | 
			
		||||
                    yield '<thinking>\n' 
 | 
			
		||||
                  yield delta["reasoningContent"]["text"]
 | 
			
		||||
 | 
			
		||||
                if "contentBlockStop" in chunk: #and chunk["contentBlockStop"]["contentBlockIndex"] == thinking_block:
 | 
			
		||||
            if "contentBlockStop" in chunk and chunk["contentBlockStop"]["contentBlockIndex"] == thinking_block:
 | 
			
		||||
                yield '</thinking>\n\n' 
 | 
			
		||||
 | 
			
		||||
                # Handle regular response text
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user