livekit-plugins-anthropic 1.0.0.dev5__py3-none-any.whl → 1.0.0rc1__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.
@@ -82,7 +82,7 @@ class LLM(llm.LLM):
82
82
  parallel_tool_calls (bool | None): Whether to parallelize tool calls. Defaults to None.
83
83
  tool_choice (Union[ToolChoice, Literal["auto", "required", "none"]] | None): The tool choice for the Anthropic API. Defaults to "auto".
84
84
  caching (Literal["ephemeral"] | None): If set to "ephemeral", caching will be enabled for the system prompt, tools, and chat history.
85
- """
85
+ """ # noqa: E501
86
86
 
87
87
  super().__init__()
88
88
 
@@ -96,13 +96,13 @@ class LLM(llm.LLM):
96
96
  top_k=top_k,
97
97
  max_tokens=max_tokens,
98
98
  )
99
- api_key = api_key or os.environ.get("ANTHROPIC_API_KEY")
100
- if not is_given(api_key):
99
+ anthropic_api_key = api_key if is_given(api_key) else os.environ.get("ANTHROPIC_API_KEY")
100
+ if not anthropic_api_key:
101
101
  raise ValueError("Anthropic API key is required")
102
102
 
103
103
  self._client = anthropic.AsyncClient(
104
- api_key=api_key or None,
105
- base_url=base_url or None,
104
+ api_key=anthropic_api_key,
105
+ base_url=base_url if is_given(base_url) else None,
106
106
  http_client=httpx.AsyncClient(
107
107
  timeout=5.0,
108
108
  follow_redirects=True,
@@ -100,7 +100,8 @@ def to_chat_ctx(
100
100
  messages.insert(
101
101
  0,
102
102
  anthropic.types.MessageParam(
103
- role="user", content=[anthropic.types.TextBlockParam(text="(empty)", type="text")]
103
+ role="user",
104
+ content=[anthropic.types.TextBlockParam(text="(empty)", type="text")],
104
105
  ),
105
106
  )
106
107
 
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "1.0.0.dev5"
15
+ __version__ = '1.0.0.rc1'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: livekit-plugins-anthropic
3
- Version: 1.0.0.dev5
3
+ Version: 1.0.0rc1
4
4
  Summary: Agent Framework plugin for services from Anthropic
5
5
  Project-URL: Documentation, https://docs.livekit.io
6
6
  Project-URL: Website, https://livekit.io/
@@ -19,7 +19,7 @@ Classifier: Topic :: Multimedia :: Video
19
19
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
20
  Requires-Python: >=3.9.0
21
21
  Requires-Dist: anthropic>=0.34
22
- Requires-Dist: livekit-agents>=1.0.0.dev5
22
+ Requires-Dist: livekit-agents>=1.0.0.rc1
23
23
  Description-Content-Type: text/markdown
24
24
 
25
25
  # LiveKit Plugins Anthropic
@@ -0,0 +1,10 @@
1
+ livekit/plugins/anthropic/__init__.py,sha256=1WCyNEaR6qBsX54qJQM0SeY-QHIucww16PLXcSnMqRo,1175
2
+ livekit/plugins/anthropic/llm.py,sha256=Gj9oGm16kdeEHw1I4GB7EGSBLpgkzhv36f55Msby5o0,13042
3
+ livekit/plugins/anthropic/log.py,sha256=fG1pYSY88AnT738gZrmzF9FO4l4BdGENj3VKHMQB3Yo,72
4
+ livekit/plugins/anthropic/models.py,sha256=wyTr2nl6SL4ylN6s4mHJcqtmgV2mjJysZo89FknWdhI,213
5
+ livekit/plugins/anthropic/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ livekit/plugins/anthropic/utils.py,sha256=SgF7No3XxiF62zt_ija9scqqOUkuB51Yxpe9X2QTuf8,4956
7
+ livekit/plugins/anthropic/version.py,sha256=pF0lh6G9GYL7Mj7EnfhjFifzlzdWx6u3RvB0Itch4UE,604
8
+ livekit_plugins_anthropic-1.0.0rc1.dist-info/METADATA,sha256=zPsXk4--Jt2z_O6LNNjC9vMhHIWh6y1LbvlGde48aso,1280
9
+ livekit_plugins_anthropic-1.0.0rc1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ livekit_plugins_anthropic-1.0.0rc1.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- livekit/plugins/anthropic/__init__.py,sha256=1WCyNEaR6qBsX54qJQM0SeY-QHIucww16PLXcSnMqRo,1175
2
- livekit/plugins/anthropic/llm.py,sha256=T22doOXWfmw-xSbY2Ts6jCQxENOA9pQTcbPQn-_3Eao,12969
3
- livekit/plugins/anthropic/log.py,sha256=fG1pYSY88AnT738gZrmzF9FO4l4BdGENj3VKHMQB3Yo,72
4
- livekit/plugins/anthropic/models.py,sha256=wyTr2nl6SL4ylN6s4mHJcqtmgV2mjJysZo89FknWdhI,213
5
- livekit/plugins/anthropic/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- livekit/plugins/anthropic/utils.py,sha256=tr7lQwIWP5hzNQl1XE6L91htsd7x8fPzfXfh9eVoWH0,4939
7
- livekit/plugins/anthropic/version.py,sha256=pXgCpV03nQI-5Kk-74NFyAdw1htj2cx6unwQHipEcfE,605
8
- livekit_plugins_anthropic-1.0.0.dev5.dist-info/METADATA,sha256=N8A6WjOyZxgFXr3LQeBhfA6LEkZEtwOIWKeqV0XoA6s,1283
9
- livekit_plugins_anthropic-1.0.0.dev5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- livekit_plugins_anthropic-1.0.0.dev5.dist-info/RECORD,,