llama-index-llms-bedrock-converse 0.10.5__py3-none-any.whl → 0.10.6__py3-none-any.whl
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.
- llama_index/llms/bedrock_converse/base.py +7 -0
- llama_index/llms/bedrock_converse/utils.py +9 -1
- {llama_index_llms_bedrock_converse-0.10.5.dist-info → llama_index_llms_bedrock_converse-0.10.6.dist-info}/METADATA +1 -1
- llama_index_llms_bedrock_converse-0.10.6.dist-info/RECORD +7 -0
- llama_index_llms_bedrock_converse-0.10.5.dist-info/RECORD +0 -7
- {llama_index_llms_bedrock_converse-0.10.5.dist-info → llama_index_llms_bedrock_converse-0.10.6.dist-info}/WHEEL +0 -0
- {llama_index_llms_bedrock_converse-0.10.5.dist-info → llama_index_llms_bedrock_converse-0.10.6.dist-info}/licenses/LICENSE +0 -0
|
@@ -167,6 +167,10 @@ class BedrockConverse(FunctionCallingLLM):
|
|
|
167
167
|
description="Specifies the thinking configuration of a reasoning model. Only applicable to Anthropic and DeepSeek models",
|
|
168
168
|
default=None,
|
|
169
169
|
)
|
|
170
|
+
supports_forced_tool_calls: bool = Field(
|
|
171
|
+
default=True,
|
|
172
|
+
description="Whether the model supports forced tool calls. If True, the model can be forced to call at least 1 or more tools.",
|
|
173
|
+
)
|
|
170
174
|
additional_kwargs: Dict[str, Any] = Field(
|
|
171
175
|
default_factory=dict,
|
|
172
176
|
description="Additional kwargs for the bedrock invokeModel request.",
|
|
@@ -210,6 +214,7 @@ class BedrockConverse(FunctionCallingLLM):
|
|
|
210
214
|
application_inference_profile_arn: Optional[str] = None,
|
|
211
215
|
trace: Optional[str] = None,
|
|
212
216
|
thinking: Optional[ThinkingDict] = None,
|
|
217
|
+
supports_forced_tool_calls: bool = True,
|
|
213
218
|
) -> None:
|
|
214
219
|
additional_kwargs = additional_kwargs or {}
|
|
215
220
|
callback_manager = callback_manager or CallbackManager([])
|
|
@@ -261,6 +266,7 @@ class BedrockConverse(FunctionCallingLLM):
|
|
|
261
266
|
application_inference_profile_arn=application_inference_profile_arn,
|
|
262
267
|
trace=trace,
|
|
263
268
|
thinking=thinking,
|
|
269
|
+
supports_forced_tool_calls=supports_forced_tool_calls,
|
|
264
270
|
)
|
|
265
271
|
|
|
266
272
|
self._config = None
|
|
@@ -913,6 +919,7 @@ class BedrockConverse(FunctionCallingLLM):
|
|
|
913
919
|
tool_choice=tool_choice,
|
|
914
920
|
tool_required=tool_required,
|
|
915
921
|
tool_caching=tool_caching,
|
|
922
|
+
supports_forced_tool_calls=self.supports_forced_tool_calls,
|
|
916
923
|
)
|
|
917
924
|
|
|
918
925
|
return {
|
|
@@ -454,6 +454,7 @@ def tools_to_converse_tools(
|
|
|
454
454
|
tool_choice: Optional[dict] = None,
|
|
455
455
|
tool_required: bool = False,
|
|
456
456
|
tool_caching: bool = False,
|
|
457
|
+
supports_forced_tool_calls: bool = True,
|
|
457
458
|
) -> Dict[str, Any]:
|
|
458
459
|
"""
|
|
459
460
|
Converts a list of tools to AWS Bedrock Converse tools.
|
|
@@ -482,11 +483,18 @@ def tools_to_converse_tools(
|
|
|
482
483
|
if tool_caching:
|
|
483
484
|
converse_tools.append({"cachePoint": {"type": "default"}})
|
|
484
485
|
|
|
486
|
+
if tool_choice:
|
|
487
|
+
tool_choice = tool_choice
|
|
488
|
+
elif supports_forced_tool_calls and tool_required:
|
|
489
|
+
tool_choice = {"any": {}}
|
|
490
|
+
else:
|
|
491
|
+
tool_choice = {"auto": {}}
|
|
492
|
+
|
|
485
493
|
return {
|
|
486
494
|
"tools": converse_tools,
|
|
487
495
|
# https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolChoice.html
|
|
488
496
|
# e.g. { "auto": {} }
|
|
489
|
-
"toolChoice": tool_choice
|
|
497
|
+
"toolChoice": tool_choice,
|
|
490
498
|
}
|
|
491
499
|
|
|
492
500
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
llama_index/llms/bedrock_converse/__init__.py,sha256=xE3ZHLXqFr7TTTgQlYH9bLLPRZAV3dJyiz_iUFXBfak,98
|
|
2
|
+
llama_index/llms/bedrock_converse/base.py,sha256=MISQTYCwaUIinyOGZhOdPYQYQAFrRSLAkiTEE-8f21A,41478
|
|
3
|
+
llama_index/llms/bedrock_converse/utils.py,sha256=-SDwcbgcX_W7p6SEt6-3HH_cAsKxG_4e2wHhi5kFKJU,27893
|
|
4
|
+
llama_index_llms_bedrock_converse-0.10.6.dist-info/METADATA,sha256=0y3xka1zYDazsks_i17_00wj89QwvAu2tBB-s4k2sXE,7834
|
|
5
|
+
llama_index_llms_bedrock_converse-0.10.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
6
|
+
llama_index_llms_bedrock_converse-0.10.6.dist-info/licenses/LICENSE,sha256=JPQLUZD9rKvCTdu192Nk0V5PAwklIg6jANii3UmTyMs,1065
|
|
7
|
+
llama_index_llms_bedrock_converse-0.10.6.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
llama_index/llms/bedrock_converse/__init__.py,sha256=xE3ZHLXqFr7TTTgQlYH9bLLPRZAV3dJyiz_iUFXBfak,98
|
|
2
|
-
llama_index/llms/bedrock_converse/base.py,sha256=tXQMmgyYZmrudRsQ7uofvQyIKNUTQtTpcdny1EoMCB0,41080
|
|
3
|
-
llama_index/llms/bedrock_converse/utils.py,sha256=LAeSiK_GLiRhoLMEVJKtMEOcqon_8UW-db04-NQJDn4,27711
|
|
4
|
-
llama_index_llms_bedrock_converse-0.10.5.dist-info/METADATA,sha256=z2YFtHev0AwKQRhyNnTCdlkAzwzHPLY_PKdSJk7HqP8,7834
|
|
5
|
-
llama_index_llms_bedrock_converse-0.10.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
6
|
-
llama_index_llms_bedrock_converse-0.10.5.dist-info/licenses/LICENSE,sha256=JPQLUZD9rKvCTdu192Nk0V5PAwklIg6jANii3UmTyMs,1065
|
|
7
|
-
llama_index_llms_bedrock_converse-0.10.5.dist-info/RECORD,,
|
|
File without changes
|