dtelecom-server-sdk 0.1.0__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.
- dtelecom_server/__init__.py +43 -0
- dtelecom_server/_typing/livekit_egress_pb2.pyi +473 -0
- dtelecom_server/_typing/livekit_ingress_pb2.pyi +213 -0
- dtelecom_server/_typing/livekit_models_pb2.pyi +524 -0
- dtelecom_server/_typing/livekit_room_pb2.pyi +154 -0
- dtelecom_server/_typing/livekit_webhook_pb2.pyi +28 -0
- dtelecom_server/client.py +159 -0
- dtelecom_server/http.py +112 -0
- dtelecom_server/models.py +250 -0
- dtelecom_server/moderation.py +84 -0
- dtelecom_server/protocol/LICENSE +202 -0
- dtelecom_server/protocol/NOTICE +1 -0
- dtelecom_server/protocol/__init__.py +25 -0
- dtelecom_server/protocol/wire.pb +0 -0
- dtelecom_server/py.typed +0 -0
- dtelecom_server/room.py +298 -0
- dtelecom_server/services.py +273 -0
- dtelecom_server/speech.py +642 -0
- dtelecom_server/webhooks.py +148 -0
- dtelecom_server/wire.py +32 -0
- dtelecom_server_sdk-0.1.0.dist-info/METADATA +78 -0
- dtelecom_server_sdk-0.1.0.dist-info/RECORD +25 -0
- dtelecom_server_sdk-0.1.0.dist-info/WHEEL +4 -0
- dtelecom_server_sdk-0.1.0.dist-info/licenses/LICENSE +201 -0
- dtelecom_server_sdk-0.1.0.dist-info/licenses/NOTICE +9 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"""Authenticate signed node webhook deliveries using their exact body bytes."""
|
|
2
|
+
|
|
3
|
+
import base64
|
|
4
|
+
import hashlib
|
|
5
|
+
import hmac
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
from collections.abc import Awaitable, Callable
|
|
9
|
+
from typing import Self
|
|
10
|
+
|
|
11
|
+
import base58
|
|
12
|
+
import httpx
|
|
13
|
+
import jwt
|
|
14
|
+
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
|
|
15
|
+
from google.protobuf.json_format import ParseDict
|
|
16
|
+
|
|
17
|
+
from .wire import WebhookEvent
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class TokenVerifier:
|
|
21
|
+
def __init__(self, public_key: str):
|
|
22
|
+
self.issuer = public_key
|
|
23
|
+
self.key = Ed25519PublicKey.from_public_bytes(base58.b58decode(public_key))
|
|
24
|
+
|
|
25
|
+
def verify(self, token: str) -> dict:
|
|
26
|
+
return jwt.decode(
|
|
27
|
+
token,
|
|
28
|
+
self.key,
|
|
29
|
+
algorithms=["EdDSA"],
|
|
30
|
+
issuer=self.issuer,
|
|
31
|
+
leeway=60,
|
|
32
|
+
options={"verify_aud": False, "require": ["iss"]},
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class SolanaNodeRegistry:
|
|
37
|
+
def __init__(
|
|
38
|
+
self,
|
|
39
|
+
*,
|
|
40
|
+
authority: str | None = None,
|
|
41
|
+
program: str | None = None,
|
|
42
|
+
rpc_url: str | None = None,
|
|
43
|
+
http_client: httpx.AsyncClient | None = None,
|
|
44
|
+
):
|
|
45
|
+
from solders.pubkey import Pubkey
|
|
46
|
+
|
|
47
|
+
self.program = Pubkey.from_string(
|
|
48
|
+
program
|
|
49
|
+
or os.environ.get("SOLANA_CONTRACT_ADDRESS")
|
|
50
|
+
or "E2FcHsC9STeB6FEtxBKGAwMTX7cbfYMyjSHKs4QbBAmh"
|
|
51
|
+
)
|
|
52
|
+
parent = Pubkey.from_string(
|
|
53
|
+
authority
|
|
54
|
+
or os.environ.get("SOLANA_REGISTRY_AUTHORITY")
|
|
55
|
+
or "6KVRs6Yr2oYzddepFdtWrFmVq8sgELcXzbUy7apwuQX4"
|
|
56
|
+
)
|
|
57
|
+
self.registry, _ = Pubkey.find_program_address(
|
|
58
|
+
[bytes(parent), b"dtel-nodes"], self.program
|
|
59
|
+
)
|
|
60
|
+
self.rpc_url = (
|
|
61
|
+
rpc_url
|
|
62
|
+
or os.environ.get("SOLANA_NETWORK_HOST_HTTP")
|
|
63
|
+
or "https://api.mainnet-beta.solana.com"
|
|
64
|
+
)
|
|
65
|
+
self._owned = http_client is None
|
|
66
|
+
self.http = (
|
|
67
|
+
http_client if http_client is not None else httpx.AsyncClient(timeout=10)
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
async def contains(self, issuer: str) -> bool:
|
|
71
|
+
from solders.pubkey import Pubkey
|
|
72
|
+
|
|
73
|
+
key = Pubkey.from_string(issuer)
|
|
74
|
+
address, _ = Pubkey.find_program_address(
|
|
75
|
+
[bytes(key), bytes(self.registry)], self.program
|
|
76
|
+
)
|
|
77
|
+
params = [str(address), {"encoding": "base64", "commitment": "finalized"}]
|
|
78
|
+
response = await self.http.post(
|
|
79
|
+
self.rpc_url,
|
|
80
|
+
json={
|
|
81
|
+
"jsonrpc": "2.0",
|
|
82
|
+
"id": 1,
|
|
83
|
+
"method": "getAccountInfo",
|
|
84
|
+
"params": params,
|
|
85
|
+
},
|
|
86
|
+
follow_redirects=False,
|
|
87
|
+
)
|
|
88
|
+
response.raise_for_status()
|
|
89
|
+
payload = response.json()
|
|
90
|
+
if "error" in payload:
|
|
91
|
+
raise RuntimeError("could not verify the webhook issuer with the registry")
|
|
92
|
+
account = payload["result"]["value"]
|
|
93
|
+
if not account or account["owner"] != str(self.program):
|
|
94
|
+
return False
|
|
95
|
+
blob = base64.b64decode(account["data"][0], validate=True)
|
|
96
|
+
discriminator = hashlib.sha256(b"account:NodeEntry").digest()[:8]
|
|
97
|
+
return len(blob) == 334 and blob[:72] == discriminator + bytes(
|
|
98
|
+
self.registry
|
|
99
|
+
) + bytes(key)
|
|
100
|
+
|
|
101
|
+
async def aclose(self) -> None:
|
|
102
|
+
if self._owned:
|
|
103
|
+
await self.http.aclose()
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class WebhookReceiver:
|
|
107
|
+
"""Accepts raw POST bytes and the Authorization header. Owns its default registry connection."""
|
|
108
|
+
|
|
109
|
+
def __init__(
|
|
110
|
+
self, *, registered_node: Callable[[str], Awaitable[bool]] | None = None
|
|
111
|
+
):
|
|
112
|
+
self.registry: SolanaNodeRegistry | None = None
|
|
113
|
+
if registered_node is None:
|
|
114
|
+
self.registry = SolanaNodeRegistry()
|
|
115
|
+
registered_node = self.registry.contains
|
|
116
|
+
self.registered_node = registered_node
|
|
117
|
+
|
|
118
|
+
async def __aenter__(self) -> Self:
|
|
119
|
+
return self
|
|
120
|
+
|
|
121
|
+
async def __aexit__(self, *args) -> None:
|
|
122
|
+
await self.aclose()
|
|
123
|
+
|
|
124
|
+
async def aclose(self) -> None:
|
|
125
|
+
if self.registry is not None:
|
|
126
|
+
await self.registry.aclose()
|
|
127
|
+
|
|
128
|
+
@staticmethod
|
|
129
|
+
def decode(body: bytes | str) -> WebhookEvent:
|
|
130
|
+
"""Parse an event without authenticating it."""
|
|
131
|
+
return ParseDict(json.loads(body), WebhookEvent(), ignore_unknown_fields=True)
|
|
132
|
+
|
|
133
|
+
async def receive(self, body: bytes | str, authorization: str) -> WebhookEvent:
|
|
134
|
+
if not authorization:
|
|
135
|
+
raise ValueError("missing webhook Authorization")
|
|
136
|
+
raw = body.encode("utf-8") if isinstance(body, str) else body
|
|
137
|
+
token = authorization.removeprefix("Bearer ")
|
|
138
|
+
issuer = jwt.decode(token, options={"verify_signature": False}).get("iss")
|
|
139
|
+
if not isinstance(issuer, str) or not issuer:
|
|
140
|
+
raise ValueError("missing webhook issuer")
|
|
141
|
+
claims = TokenVerifier(issuer).verify(token)
|
|
142
|
+
checksum = base64.b64encode(hashlib.sha256(raw).digest()).decode("ascii")
|
|
143
|
+
claim = claims.get("sha256")
|
|
144
|
+
if not isinstance(claim, str) or not hmac.compare_digest(checksum, claim):
|
|
145
|
+
raise ValueError("webhook body checksum mismatch")
|
|
146
|
+
if not await self.registered_node(issuer):
|
|
147
|
+
raise ValueError("unknown webhook signer")
|
|
148
|
+
return self.decode(raw)
|
dtelecom_server/wire.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Public room and webhook messages backed by the dTelecom fork descriptor pool."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
from ._typing.livekit_models_pb2 import (
|
|
7
|
+
ParticipantInfo,
|
|
8
|
+
ParticipantPermission,
|
|
9
|
+
Room,
|
|
10
|
+
TrackInfo,
|
|
11
|
+
)
|
|
12
|
+
from ._typing.livekit_room_pb2 import ListParticipantsResponse
|
|
13
|
+
from ._typing.livekit_webhook_pb2 import WebhookEvent
|
|
14
|
+
else:
|
|
15
|
+
from .protocol import message_type
|
|
16
|
+
|
|
17
|
+
Room = message_type("Room")
|
|
18
|
+
ParticipantInfo = message_type("ParticipantInfo")
|
|
19
|
+
ParticipantPermission = message_type("ParticipantPermission")
|
|
20
|
+
TrackInfo = message_type("TrackInfo")
|
|
21
|
+
WebhookEvent = message_type("WebhookEvent")
|
|
22
|
+
ListParticipantsResponse = message_type("ListParticipantsResponse")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
__all__ = [
|
|
26
|
+
"ListParticipantsResponse",
|
|
27
|
+
"ParticipantInfo",
|
|
28
|
+
"ParticipantPermission",
|
|
29
|
+
"Room",
|
|
30
|
+
"TrackInfo",
|
|
31
|
+
"WebhookEvent",
|
|
32
|
+
]
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: dtelecom-server-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Async Python client for dTelecom Cloud
|
|
5
|
+
Project-URL: Homepage, https://dtelecom.org/
|
|
6
|
+
Project-URL: Documentation, https://docs.dtelecom.org/
|
|
7
|
+
Project-URL: Source, https://github.com/dTelecom/server-sdk-python
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
License-File: NOTICE
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Requires-Dist: base58<3,>=2.1
|
|
13
|
+
Requires-Dist: httpx<1,>=0.27
|
|
14
|
+
Requires-Dist: protobuf<8,>=5.29
|
|
15
|
+
Requires-Dist: pydantic<3,>=2.8
|
|
16
|
+
Requires-Dist: pyjwt[crypto]<3,>=2.10
|
|
17
|
+
Requires-Dist: websockets<17,>=15
|
|
18
|
+
Provides-Extra: webhooks
|
|
19
|
+
Requires-Dist: solders<1,>=0.23; extra == 'webhooks'
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# dTelecom Cloud server SDK for Python
|
|
23
|
+
|
|
24
|
+
Use Python 3.11 or later to issue room grants, administer participants, verify incoming webhooks, and use dTelecom speech and AI services. Set `DTELECOM_API_KEY`, `DTELECOM_API_SECRET`, and `DTELECOM_CLOUD_URL` in your backend environment.
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from dtelecom_server import CloudClient
|
|
28
|
+
|
|
29
|
+
async def issue(room: str, identity: str) -> dict:
|
|
30
|
+
async with CloudClient() as cloud:
|
|
31
|
+
grant = await cloud.create_token(room, identity, ttl="10m")
|
|
32
|
+
return grant.client_fields()
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Pass the returned token, wsUrl and fallbackUrls to the room client. Use the backend-only session ID and expiry to schedule extensions. Keep a client open across requests in a long-running application and call `await cloud.aclose()` at shutdown.
|
|
36
|
+
|
|
37
|
+
For a Solana registry-backed webhook verifier, install the `webhooks` extra. The receiver accepts the original raw request body and Authorization header. [Cloud API reference](https://docs.dtelecom.org/reference/http-api/)
|
|
38
|
+
|
|
39
|
+
## Room administration and session charges
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
async with CloudClient() as cloud:
|
|
43
|
+
rooms = cloud.room_service()
|
|
44
|
+
for participant in await rooms.list_participants("demo"):
|
|
45
|
+
print(participant.identity)
|
|
46
|
+
await rooms.send_data("demo", b"Starting in one minute", topic="announcement")
|
|
47
|
+
charges = await cloud.list_sessions("demo", limit=20)
|
|
48
|
+
print(charges.total_usd)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The SDK uses room-scoped admin grants from Cloud and sends node operations to the returned API URLs. Rooms spanning multiple nodes return one participant per SID. The SDK prefers the local owner’s record over its relayed copies and sends participant changes to that owner. If the owner cannot be located after refreshing node membership, the operation reports an error. Each participant or AI service session has its own session ID. Use `get_session` to read its status and final charge.
|
|
52
|
+
|
|
53
|
+
## Speech and AI services
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from uuid import uuid4
|
|
57
|
+
|
|
58
|
+
async with CloudClient() as cloud:
|
|
59
|
+
result = await cloud.translate("Good morning", "es", source="en", idempotency_key=uuid4().hex)
|
|
60
|
+
if result.status == "completed":
|
|
61
|
+
print(result.result.translated_text)
|
|
62
|
+
else:
|
|
63
|
+
print(result.id)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Use `get_translation` to check a pending translation. The `stt` and `tts` clients issue and extend streaming credentials. Use `transcriptions` and `wav` for file jobs, `vision` for snapshots and `moderation` for audio, frames or a ticketed WebSocket. Supply one idempotency key per logical job or inference request and keep it across retries.
|
|
67
|
+
|
|
68
|
+
## Verify a webhook
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from dtelecom_server import WebhookReceiver
|
|
72
|
+
|
|
73
|
+
async with WebhookReceiver() as receiver:
|
|
74
|
+
event = await receiver.receive(raw_request_body, authorization_header)
|
|
75
|
+
print(event.event)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The receiver verifies the node's Ed25519 signature, registry membership and the exact request body's signed checksum. Pass the body bytes before JSON parsing. A custom async `registered_node` callback can supply your trusted registry lookup.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
dtelecom_server/__init__.py,sha256=rARYt5Njpq82Phgtfgc8GekuWWXlDGKz6BoMV2m8QQA,1068
|
|
2
|
+
dtelecom_server/client.py,sha256=2TA67pbP-ZOOdcKEfIpTVAGTW1QsLCdkyXPYGwXGZEw,4940
|
|
3
|
+
dtelecom_server/http.py,sha256=egsjuivYxQyKUqyRaqg-atfAt5ou7mps-VpUq8S6Apg,3491
|
|
4
|
+
dtelecom_server/models.py,sha256=iw8jDKXFmRCYwnJewNc3NGsQfqKD_Zl3N3rW2UxAVuI,5452
|
|
5
|
+
dtelecom_server/moderation.py,sha256=MHow5_GZHQd_5hDsUze50xqxYcUu17lRtVH4vx4L8XE,3181
|
|
6
|
+
dtelecom_server/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
dtelecom_server/room.py,sha256=_yaZ-uC_gQYX5xnAXESuiIGd72Se8zfxh4-_J56qnWM,10782
|
|
8
|
+
dtelecom_server/services.py,sha256=0AYSH_-laJn4m50IymzXXIqojgrx0npfX7xzvyhsne4,8449
|
|
9
|
+
dtelecom_server/speech.py,sha256=BSae9USs7A1UGZjdXkml7nBx02YuZqZIkin_aEnDfEM,24898
|
|
10
|
+
dtelecom_server/webhooks.py,sha256=r-grJ9anvb0Gy_b93mAjboo6JVl3FRr98fDRLjgQxKE,5182
|
|
11
|
+
dtelecom_server/wire.py,sha256=NMXgmDZk1zec8ERkdaqVpLqXEwcM_wN3ej14jruzFxE,912
|
|
12
|
+
dtelecom_server/_typing/livekit_egress_pb2.pyi,sha256=cEdT5iEE9KwnjdNIOfFQUE_2uIwIWC0LiqD7Q8MkObw,24753
|
|
13
|
+
dtelecom_server/_typing/livekit_ingress_pb2.pyi,sha256=EHhYa77jWv5V_JsRwJzAZ68YMdlLJSTAo3mbJSyG6Ls,10998
|
|
14
|
+
dtelecom_server/_typing/livekit_models_pb2.pyi,sha256=V98gVR0FIOQik4WrmDa0fJZKjiYoc1OlXQfp5ksIEkQ,24855
|
|
15
|
+
dtelecom_server/_typing/livekit_room_pb2.pyi,sha256=hmGj10IZMoVbUG_hu11dm2CWC5Uw1Zf3QpTitGq_8VI,6984
|
|
16
|
+
dtelecom_server/_typing/livekit_webhook_pb2.pyi,sha256=di2qotgozEtDBThXv7sZUv-E8ThVHtkoYNmYPlc_eJQ,1682
|
|
17
|
+
dtelecom_server/protocol/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
18
|
+
dtelecom_server/protocol/NOTICE,sha256=ktjIZjFPSEoVbU0skXn5t2yTYLPLT24AcrtSN1KVlK8,365
|
|
19
|
+
dtelecom_server/protocol/__init__.py,sha256=wyxZt8D9KdTaEkybH8yrcDbEoh1zG8uVU8J1QpEwDtw,936
|
|
20
|
+
dtelecom_server/protocol/wire.pb,sha256=7vk2_UfUjdnuilj3gJKKj6ECFAE5xcVj0O84ap1Y_2c,28538
|
|
21
|
+
dtelecom_server_sdk-0.1.0.dist-info/METADATA,sha256=GeY8STFNZRSzTvb-VK65lfaEkR2wHuW5muR4_BSk9_0,3704
|
|
22
|
+
dtelecom_server_sdk-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
23
|
+
dtelecom_server_sdk-0.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
24
|
+
dtelecom_server_sdk-0.1.0.dist-info/licenses/NOTICE,sha256=JNU915jFDRNWAsBSqQuR13im7Fpbwl4lHgDW0Gy_0ds,505
|
|
25
|
+
dtelecom_server_sdk-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
dTelecom Cloud SDK for Python
|
|
2
|
+
The HTTP, room administration and webhook behavior was adapted from the dTelecom
|
|
3
|
+
JavaScript server SDK version 4.4.0, revision 0350bb9ac5b1fcca97f32f7ce7bd70f00dd28449.
|
|
4
|
+
https://github.com/dTelecom/server-sdk-js
|
|
5
|
+
Licensed under the Apache License, Version 2.0.
|
|
6
|
+
|
|
7
|
+
The streaming speech clients implement the wire behavior of dTelecom agents-js
|
|
8
|
+
0.12.0 (e652f6fb88931200507a7886be06d21bd4131676), Apache License 2.0.
|
|
9
|
+
https://github.com/dTelecom/agents-js/tree/v0.12.0/src/providers
|