Cloudflare turn integration (#264)

* Turn integration

* Add code:

* type hint

* Fix typehint

* add code

* format

* WIP

* trickle ice

* bump version

* Better docs

* Modify

* code

* Mute icon for whisper

* Add code

* llama 4 demo

* code

* OpenAI interruptions

* fix docs
This commit is contained in:
Freddy Boulton
2025-04-09 09:36:51 -04:00
committed by GitHub
parent f70b27bd41
commit 837330dcd8
37 changed files with 2914 additions and 780 deletions

View File

@@ -7,7 +7,7 @@ import json
import logging
import tempfile
import traceback
from collections.abc import Callable
from collections.abc import Callable, Coroutine
from contextvars import ContextVar
from dataclasses import dataclass
from typing import Any, Literal, Protocol, TypedDict, cast
@@ -486,3 +486,15 @@ async def wait_for_item(queue: asyncio.Queue, timeout: float = 0.1) -> Any:
return await asyncio.wait_for(queue.get(), timeout=timeout)
except (TimeoutError, asyncio.TimeoutError):
return None
RTCConfigurationCallable = (
Callable[[], dict[str, Any]]
| Callable[[], Coroutine[dict[str, Any], Any, dict[str, Any]]]
| Callable[[str | None, str | None, str | None], dict[str, Any]]
| Callable[
[str | None, str | None, str | None],
Coroutine[dict[str, Any], Any, dict[str, Any]],
]
| dict[str, Any]
)