llama-index-llms-bedrock-converse 0.12.3__tar.gz → 0.12.5__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.
- {llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/PKG-INFO +1 -1
- {llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/llama_index/llms/bedrock_converse/base.py +14 -14
- {llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/llama_index/llms/bedrock_converse/utils.py +5 -2
- {llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/pyproject.toml +1 -1
- {llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/.gitignore +0 -0
- {llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/LICENSE +0 -0
- {llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/README.md +0 -0
- {llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/llama_index/llms/bedrock_converse/__init__.py +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import warnings
|
|
2
2
|
from typing import (
|
|
3
|
+
TYPE_CHECKING,
|
|
3
4
|
Any,
|
|
4
5
|
Callable,
|
|
5
6
|
Dict,
|
|
@@ -9,16 +10,21 @@ from typing import (
|
|
|
9
10
|
Sequence,
|
|
10
11
|
Tuple,
|
|
11
12
|
Union,
|
|
12
|
-
TYPE_CHECKING,
|
|
13
13
|
)
|
|
14
14
|
|
|
15
|
+
from llama_index.core.base.llms.generic_utils import (
|
|
16
|
+
achat_to_completion_decorator,
|
|
17
|
+
astream_chat_to_completion_decorator,
|
|
18
|
+
chat_to_completion_decorator,
|
|
19
|
+
stream_chat_to_completion_decorator,
|
|
20
|
+
)
|
|
15
21
|
from llama_index.core.base.llms.types import (
|
|
16
22
|
ChatMessage,
|
|
17
23
|
ChatResponse,
|
|
18
|
-
ChatResponseGen,
|
|
19
24
|
ChatResponseAsyncGen,
|
|
20
|
-
|
|
25
|
+
ChatResponseGen,
|
|
21
26
|
CompletionResponse,
|
|
27
|
+
CompletionResponseAsyncGen,
|
|
22
28
|
CompletionResponseGen,
|
|
23
29
|
LLMMetadata,
|
|
24
30
|
MessageRole,
|
|
@@ -33,26 +39,20 @@ from llama_index.core.llms.callbacks import (
|
|
|
33
39
|
llm_chat_callback,
|
|
34
40
|
llm_completion_callback,
|
|
35
41
|
)
|
|
36
|
-
from llama_index.core.base.llms.generic_utils import (
|
|
37
|
-
achat_to_completion_decorator,
|
|
38
|
-
astream_chat_to_completion_decorator,
|
|
39
|
-
chat_to_completion_decorator,
|
|
40
|
-
stream_chat_to_completion_decorator,
|
|
41
|
-
)
|
|
42
42
|
from llama_index.core.llms.function_calling import FunctionCallingLLM, ToolSelection
|
|
43
43
|
from llama_index.core.llms.utils import parse_partial_json
|
|
44
44
|
from llama_index.core.types import BaseOutputParser, PydanticProgramMode
|
|
45
45
|
from llama_index.llms.bedrock_converse.utils import (
|
|
46
|
+
ThinkingDict,
|
|
46
47
|
bedrock_modelname_to_context_size,
|
|
47
48
|
converse_with_retry,
|
|
48
49
|
converse_with_retry_async,
|
|
49
50
|
force_single_tool_call,
|
|
50
51
|
is_bedrock_function_calling_model,
|
|
52
|
+
is_reasoning,
|
|
51
53
|
join_two_dicts,
|
|
52
54
|
messages_to_converse_messages,
|
|
53
55
|
tools_to_converse_tools,
|
|
54
|
-
is_reasoning,
|
|
55
|
-
ThinkingDict,
|
|
56
56
|
)
|
|
57
57
|
|
|
58
58
|
if TYPE_CHECKING:
|
|
@@ -364,7 +364,9 @@ class BedrockConverse(FunctionCallingLLM):
|
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
def _get_content_and_tool_calls(
|
|
367
|
-
self,
|
|
367
|
+
self,
|
|
368
|
+
response: Optional[Dict[str, Any]] = None,
|
|
369
|
+
content: Optional[Dict[str, Any]] = None,
|
|
368
370
|
) -> Tuple[
|
|
369
371
|
List[Union[TextBlock, ThinkingBlock, ToolCallBlock]], List[str], List[str]
|
|
370
372
|
]:
|
|
@@ -681,7 +683,6 @@ class BedrockConverse(FunctionCallingLLM):
|
|
|
681
683
|
},
|
|
682
684
|
),
|
|
683
685
|
delta="",
|
|
684
|
-
thinking_delta=None,
|
|
685
686
|
raw=chunk,
|
|
686
687
|
additional_kwargs=self._get_response_token_counts(metadata),
|
|
687
688
|
)
|
|
@@ -966,7 +967,6 @@ class BedrockConverse(FunctionCallingLLM):
|
|
|
966
967
|
},
|
|
967
968
|
),
|
|
968
969
|
delta="",
|
|
969
|
-
thinking_delta=None,
|
|
970
970
|
raw=chunk,
|
|
971
971
|
additional_kwargs=self._get_response_token_counts(metadata),
|
|
972
972
|
)
|
|
@@ -491,7 +491,7 @@ def tools_to_converse_tools(
|
|
|
491
491
|
tool_required: bool = False,
|
|
492
492
|
tool_caching: bool = False,
|
|
493
493
|
supports_forced_tool_calls: bool = True,
|
|
494
|
-
) -> Dict[str, Any]:
|
|
494
|
+
) -> Optional[Dict[str, Any]]:
|
|
495
495
|
"""
|
|
496
496
|
Converts a list of tools to AWS Bedrock Converse tools.
|
|
497
497
|
|
|
@@ -499,9 +499,12 @@ def tools_to_converse_tools(
|
|
|
499
499
|
tools: List of BaseTools
|
|
500
500
|
|
|
501
501
|
Returns:
|
|
502
|
-
AWS Bedrock Converse tools
|
|
502
|
+
AWS Bedrock Converse tools, or None if tools list is empty
|
|
503
503
|
|
|
504
504
|
"""
|
|
505
|
+
if not tools:
|
|
506
|
+
return None
|
|
507
|
+
|
|
505
508
|
converse_tools = []
|
|
506
509
|
for tool in tools:
|
|
507
510
|
tool_name, tool_description = tool.metadata.name, tool.metadata.description
|
{llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/pyproject.toml
RENAMED
|
@@ -29,7 +29,7 @@ dev = [
|
|
|
29
29
|
|
|
30
30
|
[project]
|
|
31
31
|
name = "llama-index-llms-bedrock-converse"
|
|
32
|
-
version = "0.12.
|
|
32
|
+
version = "0.12.5"
|
|
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"
|
{llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/.gitignore
RENAMED
|
File without changes
|
{llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/LICENSE
RENAMED
|
File without changes
|
{llama_index_llms_bedrock_converse-0.12.3 → llama_index_llms_bedrock_converse-0.12.5}/README.md
RENAMED
|
File without changes
|