llama-index-llms-bedrock-converse 0.12.2__tar.gz → 0.12.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llama-index-llms-bedrock-converse
3
- Version: 0.12.2
3
+ Version: 0.12.3
4
4
  Summary: llama-index llms bedrock converse integration
5
5
  Author-email: Your Name <you@example.com>
6
6
  License-Expression: MIT
@@ -505,10 +505,13 @@ class BedrockConverse(FunctionCallingLLM):
505
505
  content_delta = content_block_delta["delta"]
506
506
  content = join_two_dicts(content, content_delta)
507
507
 
508
+ thinking_delta_value = None
508
509
  if "reasoningContent" in content_delta:
509
- thinking += content_delta.get("reasoningContent", {}).get(
510
+ reasoning_text = content_delta.get("reasoningContent", {}).get(
510
511
  "text", ""
511
512
  )
513
+ thinking += reasoning_text
514
+ thinking_delta_value = reasoning_text
512
515
  thinking_signature += content_delta.get(
513
516
  "reasoningContent", {}
514
517
  ).get("signature", "")
@@ -566,6 +569,14 @@ class BedrockConverse(FunctionCallingLLM):
566
569
  )
567
570
  )
568
571
 
572
+ response_additional_kwargs = self._get_response_token_counts(
573
+ dict(chunk)
574
+ )
575
+ if thinking_delta_value is not None:
576
+ response_additional_kwargs["thinking_delta"] = (
577
+ thinking_delta_value
578
+ )
579
+
569
580
  yield ChatResponse(
570
581
  message=ChatMessage(
571
582
  role=role,
@@ -579,7 +590,7 @@ class BedrockConverse(FunctionCallingLLM):
579
590
  ),
580
591
  delta=content_delta.get("text", ""),
581
592
  raw=chunk,
582
- additional_kwargs=self._get_response_token_counts(dict(chunk)),
593
+ additional_kwargs=response_additional_kwargs,
583
594
  )
584
595
  elif content_block_start := chunk.get("contentBlockStart"):
585
596
  # New tool call starting
@@ -670,6 +681,7 @@ class BedrockConverse(FunctionCallingLLM):
670
681
  },
671
682
  ),
672
683
  delta="",
684
+ thinking_delta=None,
673
685
  raw=chunk,
674
686
  additional_kwargs=self._get_response_token_counts(metadata),
675
687
  )
@@ -777,10 +789,13 @@ class BedrockConverse(FunctionCallingLLM):
777
789
  content_delta = content_block_delta["delta"]
778
790
  content = join_two_dicts(content, content_delta)
779
791
 
792
+ thinking_delta_value = None
780
793
  if "reasoningContent" in content_delta:
781
- thinking += content_delta.get("reasoningContent", {}).get(
794
+ reasoning_text = content_delta.get("reasoningContent", {}).get(
782
795
  "text", ""
783
796
  )
797
+ thinking += reasoning_text
798
+ thinking_delta_value = reasoning_text
784
799
  thinking_signature += content_delta.get(
785
800
  "reasoningContent", {}
786
801
  ).get("signature", "")
@@ -838,6 +853,14 @@ class BedrockConverse(FunctionCallingLLM):
838
853
  )
839
854
  )
840
855
 
856
+ response_additional_kwargs = self._get_response_token_counts(
857
+ dict(chunk)
858
+ )
859
+ if thinking_delta_value is not None:
860
+ response_additional_kwargs["thinking_delta"] = (
861
+ thinking_delta_value
862
+ )
863
+
841
864
  yield ChatResponse(
842
865
  message=ChatMessage(
843
866
  role=role,
@@ -851,7 +874,7 @@ class BedrockConverse(FunctionCallingLLM):
851
874
  ),
852
875
  delta=content_delta.get("text", ""),
853
876
  raw=chunk,
854
- additional_kwargs=self._get_response_token_counts(dict(chunk)),
877
+ additional_kwargs=response_additional_kwargs,
855
878
  )
856
879
  elif content_block_start := chunk.get("contentBlockStart"):
857
880
  # New tool call starting
@@ -943,6 +966,7 @@ class BedrockConverse(FunctionCallingLLM):
943
966
  },
944
967
  ),
945
968
  delta="",
969
+ thinking_delta=None,
946
970
  raw=chunk,
947
971
  additional_kwargs=self._get_response_token_counts(metadata),
948
972
  )
@@ -29,7 +29,7 @@ dev = [
29
29
 
30
30
  [project]
31
31
  name = "llama-index-llms-bedrock-converse"
32
- version = "0.12.2"
32
+ version = "0.12.3"
33
33
  description = "llama-index llms bedrock converse integration"
34
34
  authors = [{name = "Your Name", email = "you@example.com"}]
35
35
  requires-python = ">=3.9,<4.0"