diff --git a/README.md b/README.md index 428c9206..8ed67b87 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,9 @@ # ๐Ÿ“น๐ŸŽ™๏ธ๐Ÿ Python SDK for LiveKit + Use this SDK to add realtime video, audio and data features to your Python app. By connecting to LiveKit Cloud or a self-hosted server, you can quickly build applications such as multi-modal AI, live streaming, or video calls with just a few lines of code. + This repo contains two packages @@ -52,9 +54,7 @@ from livekit import api import asyncio async def main(): - lkapi = api.LiveKitAPI( - 'http://localhost:7880', - ) + lkapi = api.LiveKitAPI("https://my-project.livekit.cloud") room_info = await lkapi.room.create_room( api.CreateRoomRequest(name="my-room"), ) @@ -66,6 +66,29 @@ async def main(): asyncio.run(main()) ``` +### Using other APIs + +Services can be accessed via the LiveKitAPI object. + +```python +lkapi = api.LiveKitAPI("https://my-project.livekit.cloud") + +# Room Service +room_svc = lkapi.room + +# Egress Service +egress_svc = lkapi.egress + +# Ingress Service +ingress_svc = lkapi.ingress + +# Sip Service +sip_svc = lkapi.sip + +# Agent Dispatch +dispatch_svc = lkapi.agent_dispatch +``` + ## Using Real-time SDK ```shell @@ -132,10 +155,9 @@ def on_message_received(msg: rtc.ChatMessage): await chat.send_message("hello world") ``` - ### RPC -Perform your own predefined method calls from one participant to another. +Perform your own predefined method calls from one participant to another. This feature is especially powerful when used with [Agents](https://docs.livekit.io/agents), for instance to forward LLM function calls to your client application. @@ -172,11 +194,10 @@ You may find it useful to adjust the `response_timeout` parameter, which indicat #### Errors -LiveKit is a dynamic realtime environment and calls can fail for various reasons. +LiveKit is a dynamic realtime environment and calls can fail for various reasons. You may throw errors of the type `RpcError` with a string `message` in an RPC method handler and they will be received on the caller's side with the message intact. Other errors will not be transmitted and will instead arrive to the caller as `1500` ("Application Error"). Other built-in errors are detailed in `RpcError`. - ## Examples - [Facelandmark](https://github.com/livekit/python-sdks/tree/main/examples/face_landmark): Use mediapipe to detect face landmarks (eyes, nose ...) @@ -189,7 +210,9 @@ You may throw errors of the type `RpcError` with a string `message` in an RPC me Please join us on [Slack](https://livekit.io/join-slack) to get help from our devs / community members. We welcome your contributions(PRs) and details can be discussed there. +
+ diff --git a/livekit-api/livekit/api/sip_service.py b/livekit-api/livekit/api/sip_service.py index eee8bcff..e404e0f6 100644 --- a/livekit-api/livekit/api/sip_service.py +++ b/livekit-api/livekit/api/sip_service.py @@ -47,6 +47,9 @@ def __init__( super().__init__(session, url, api_key, api_secret) async def create_sip_trunk(self, create: CreateSIPTrunkRequest) -> SIPTrunkInfo: + """ + @deprecated Use create_sip_inbound_trunk or create_sip_outbound_trunk instead + """ return await self._client.request( SVC, "CreateSIPTrunk", diff --git a/livekit-api/livekit/api/version.py b/livekit-api/livekit/api/version.py index 777f190d..8088f751 100644 --- a/livekit-api/livekit/api/version.py +++ b/livekit-api/livekit/api/version.py @@ -1 +1 @@ -__version__ = "0.8.0" +__version__ = "0.8.1" diff --git a/livekit-api/setup.py b/livekit-api/setup.py index 5a441d68..0a133275 100644 --- a/livekit-api/setup.py +++ b/livekit-api/setup.py @@ -53,7 +53,7 @@ "aiohttp>=3.9.0", "protobuf>=3", "types-protobuf>=4,<5", - "livekit-protocol>=0.7.0,<2", + "livekit-protocol>=0.8.0,<2", ], package_data={ "livekit.api": ["py.typed", "*.pyi", "**/*.pyi"], diff --git a/livekit-protocol/livekit/protocol/version.py b/livekit-protocol/livekit/protocol/version.py index 49e0fc1e..777f190d 100644 --- a/livekit-protocol/livekit/protocol/version.py +++ b/livekit-protocol/livekit/protocol/version.py @@ -1 +1 @@ -__version__ = "0.7.0" +__version__ = "0.8.0"
LiveKit Ecosystem
Realtime SDKsReact Components ยท Browser ยท Swift Components ยท iOS/macOS/visionOS ยท Android ยท Flutter ยท React Native ยท Rust ยท Node.js ยท Python ยท Unity (web) ยท Unity (beta)