livekit-plugins-aws 1.0.0rc4__py3-none-any.whl → 1.0.0rc6__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.
- livekit/plugins/aws/llm.py +6 -6
- livekit/plugins/aws/utils.py +2 -2
- livekit/plugins/aws/version.py +1 -1
- {livekit_plugins_aws-1.0.0rc4.dist-info → livekit_plugins_aws-1.0.0rc6.dist-info}/METADATA +3 -3
- {livekit_plugins_aws-1.0.0rc4.dist-info → livekit_plugins_aws-1.0.0rc6.dist-info}/RECORD +6 -6
- {livekit_plugins_aws-1.0.0rc4.dist-info → livekit_plugins_aws-1.0.0rc6.dist-info}/WHEEL +0 -0
livekit/plugins/aws/llm.py
CHANGED
|
@@ -41,7 +41,7 @@ TEXT_MODEL = Literal["anthropic.claude-3-5-sonnet-20241022-v2:0"]
|
|
|
41
41
|
class _LLMOptions:
|
|
42
42
|
model: str | TEXT_MODEL
|
|
43
43
|
temperature: NotGivenOr[float]
|
|
44
|
-
tool_choice: NotGivenOr[ToolChoice
|
|
44
|
+
tool_choice: NotGivenOr[ToolChoice]
|
|
45
45
|
max_output_tokens: NotGivenOr[int]
|
|
46
46
|
top_p: NotGivenOr[float]
|
|
47
47
|
additional_request_fields: NotGivenOr[dict[str, Any]]
|
|
@@ -58,7 +58,7 @@ class LLM(llm.LLM):
|
|
|
58
58
|
temperature: NotGivenOr[float] = NOT_GIVEN,
|
|
59
59
|
max_output_tokens: NotGivenOr[int] = NOT_GIVEN,
|
|
60
60
|
top_p: NotGivenOr[float] = NOT_GIVEN,
|
|
61
|
-
tool_choice: NotGivenOr[ToolChoice
|
|
61
|
+
tool_choice: NotGivenOr[ToolChoice] = NOT_GIVEN,
|
|
62
62
|
additional_request_fields: NotGivenOr[dict[str, Any]] = NOT_GIVEN,
|
|
63
63
|
) -> None:
|
|
64
64
|
"""
|
|
@@ -77,7 +77,7 @@ class LLM(llm.LLM):
|
|
|
77
77
|
temperature (float, optional): Sampling temperature for response generation. Defaults to 0.8.
|
|
78
78
|
max_output_tokens (int, optional): Maximum number of tokens to generate in the output. Defaults to None.
|
|
79
79
|
top_p (float, optional): The nucleus sampling probability for response generation. Defaults to None.
|
|
80
|
-
tool_choice (ToolChoice
|
|
80
|
+
tool_choice (ToolChoice, optional): Specifies whether to use tools during response generation. Defaults to "auto".
|
|
81
81
|
additional_request_fields (dict[str, Any], optional): Additional request fields to send to the AWS Bedrock Converse API. Defaults to None.
|
|
82
82
|
""" # noqa: E501
|
|
83
83
|
super().__init__()
|
|
@@ -106,7 +106,7 @@ class LLM(llm.LLM):
|
|
|
106
106
|
tools: list[FunctionTool] | None = None,
|
|
107
107
|
conn_options: APIConnectOptions = DEFAULT_API_CONNECT_OPTIONS,
|
|
108
108
|
temperature: NotGivenOr[float] = NOT_GIVEN,
|
|
109
|
-
tool_choice: NotGivenOr[ToolChoice
|
|
109
|
+
tool_choice: NotGivenOr[ToolChoice] = NOT_GIVEN,
|
|
110
110
|
) -> LLMStream:
|
|
111
111
|
opts = {}
|
|
112
112
|
|
|
@@ -122,8 +122,8 @@ class LLM(llm.LLM):
|
|
|
122
122
|
tool_config: dict[str, Any] = {"tools": to_fnc_ctx(tools)}
|
|
123
123
|
tool_choice = tool_choice if is_given(tool_choice) else self._opts.tool_choice
|
|
124
124
|
if is_given(tool_choice):
|
|
125
|
-
if isinstance(tool_choice,
|
|
126
|
-
tool_config["toolChoice"] = {"tool": {"name": tool_choice
|
|
125
|
+
if isinstance(tool_choice, dict) and tool_choice.get("type") == "function":
|
|
126
|
+
tool_config["toolChoice"] = {"tool": {"name": tool_choice["function"]["name"]}}
|
|
127
127
|
elif tool_choice == "required":
|
|
128
128
|
tool_config["toolChoice"] = {"any": {}}
|
|
129
129
|
elif tool_choice == "auto":
|
livekit/plugins/aws/utils.py
CHANGED
|
@@ -53,7 +53,7 @@ def to_chat_ctx(chat_ctx: ChatContext, cache_key: Any) -> tuple[list[dict], dict
|
|
|
53
53
|
for msg in chat_ctx.items:
|
|
54
54
|
if msg.type == "message" and msg.role == "system":
|
|
55
55
|
for content in msg.content:
|
|
56
|
-
if isinstance(content, str):
|
|
56
|
+
if content and isinstance(content, str):
|
|
57
57
|
system_message = {"text": content}
|
|
58
58
|
continue
|
|
59
59
|
|
|
@@ -73,7 +73,7 @@ def to_chat_ctx(chat_ctx: ChatContext, cache_key: Any) -> tuple[list[dict], dict
|
|
|
73
73
|
|
|
74
74
|
if msg.type == "message":
|
|
75
75
|
for content in msg.content:
|
|
76
|
-
if isinstance(content, str):
|
|
76
|
+
if content and isinstance(content, str):
|
|
77
77
|
current_content.append({"text": content})
|
|
78
78
|
elif isinstance(content, ImageContent):
|
|
79
79
|
current_content.append(_build_image(content, cache_key))
|
livekit/plugins/aws/version.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: livekit-plugins-aws
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0rc6
|
|
4
4
|
Summary: LiveKit Agents Plugin for services from AWS
|
|
5
5
|
Project-URL: Documentation, https://docs.livekit.io
|
|
6
6
|
Project-URL: Website, https://livekit.io/
|
|
7
7
|
Project-URL: Source, https://github.com/livekit/agents
|
|
8
|
-
Author-email: LiveKit <
|
|
8
|
+
Author-email: LiveKit <hello@livekit.io>
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
10
|
Keywords: audio,aws,livekit,realtime,video,webrtc
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
@@ -21,7 +21,7 @@ Requires-Python: >=3.9.0
|
|
|
21
21
|
Requires-Dist: aiobotocore==2.19.0
|
|
22
22
|
Requires-Dist: amazon-transcribe>=0.6.2
|
|
23
23
|
Requires-Dist: boto3==1.36.3
|
|
24
|
-
Requires-Dist: livekit-agents>=1.0.0.
|
|
24
|
+
Requires-Dist: livekit-agents>=1.0.0.rc6
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
|
|
27
27
|
# LiveKit Plugins AWS
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
livekit/plugins/aws/__init__.py,sha256=Ea-hK7QdutnwdZvvs9K2fiR8RWJqz2JcONxXnV1kXF0,977
|
|
2
|
-
livekit/plugins/aws/llm.py,sha256=
|
|
2
|
+
livekit/plugins/aws/llm.py,sha256=rIji8jLIyV-xfrDzDewqQiHIzV-oZAE9Cj6p6bba6Nw,11353
|
|
3
3
|
livekit/plugins/aws/log.py,sha256=jFief0Xhv0n_F6sp6UFu9VKxs2bXNVGAfYGmEYfR_2Q,66
|
|
4
4
|
livekit/plugins/aws/models.py,sha256=Nf8RFmDulW7h03dG2lERTog3mgDK0TbLvW0eGOncuEE,704
|
|
5
5
|
livekit/plugins/aws/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
livekit/plugins/aws/stt.py,sha256=j2vEsoixFcsyTbCNhW5EWea5CEv3K-DzL9wmweebf3o,8030
|
|
7
7
|
livekit/plugins/aws/tts.py,sha256=4EOI4VabvhjCcDyp_QoDhlXOdrMrKpnmNIDTeoJ8kcU,7601
|
|
8
|
-
livekit/plugins/aws/utils.py,sha256=
|
|
9
|
-
livekit/plugins/aws/version.py,sha256=
|
|
10
|
-
livekit_plugins_aws-1.0.
|
|
11
|
-
livekit_plugins_aws-1.0.
|
|
12
|
-
livekit_plugins_aws-1.0.
|
|
8
|
+
livekit/plugins/aws/utils.py,sha256=FBUOsVNC0J2-_bfdRMbAtny72Tqji3UnC0RZdMND7jo,5011
|
|
9
|
+
livekit/plugins/aws/version.py,sha256=PDOEKN5zsYLQdbfAm5Di6G1sFYANNA0LqJR8zZzeghg,604
|
|
10
|
+
livekit_plugins_aws-1.0.0rc6.dist-info/METADATA,sha256=H7G8v1bskBEj88pLijagWXR_uG-LwkUKnLwLs0R8JU8,1483
|
|
11
|
+
livekit_plugins_aws-1.0.0rc6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
12
|
+
livekit_plugins_aws-1.0.0rc6.dist-info/RECORD,,
|
|
File without changes
|