dv-pipecat-ai 0.0.74.dev770__py3-none-any.whl → 0.0.82.dev776__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.
Potentially problematic release.
This version of dv-pipecat-ai might be problematic. Click here for more details.
- {dv_pipecat_ai-0.0.74.dev770.dist-info → dv_pipecat_ai-0.0.82.dev776.dist-info}/METADATA +137 -93
- dv_pipecat_ai-0.0.82.dev776.dist-info/RECORD +340 -0
- pipecat/__init__.py +17 -0
- pipecat/adapters/base_llm_adapter.py +36 -1
- pipecat/adapters/schemas/direct_function.py +296 -0
- pipecat/adapters/schemas/function_schema.py +15 -6
- pipecat/adapters/schemas/tools_schema.py +55 -7
- pipecat/adapters/services/anthropic_adapter.py +22 -3
- pipecat/adapters/services/aws_nova_sonic_adapter.py +23 -3
- pipecat/adapters/services/bedrock_adapter.py +22 -3
- pipecat/adapters/services/gemini_adapter.py +16 -3
- pipecat/adapters/services/open_ai_adapter.py +17 -2
- pipecat/adapters/services/open_ai_realtime_adapter.py +23 -3
- pipecat/audio/filters/base_audio_filter.py +30 -6
- pipecat/audio/filters/koala_filter.py +37 -2
- pipecat/audio/filters/krisp_filter.py +59 -6
- pipecat/audio/filters/noisereduce_filter.py +37 -0
- pipecat/audio/interruptions/base_interruption_strategy.py +25 -5
- pipecat/audio/interruptions/min_words_interruption_strategy.py +21 -4
- pipecat/audio/mixers/base_audio_mixer.py +30 -7
- pipecat/audio/mixers/soundfile_mixer.py +53 -6
- pipecat/audio/resamplers/base_audio_resampler.py +17 -9
- pipecat/audio/resamplers/resampy_resampler.py +26 -1
- pipecat/audio/resamplers/soxr_resampler.py +32 -1
- pipecat/audio/resamplers/soxr_stream_resampler.py +101 -0
- pipecat/audio/utils.py +194 -1
- pipecat/audio/vad/silero.py +60 -3
- pipecat/audio/vad/vad_analyzer.py +114 -30
- pipecat/clocks/base_clock.py +19 -0
- pipecat/clocks/system_clock.py +25 -0
- pipecat/extensions/voicemail/__init__.py +0 -0
- pipecat/extensions/voicemail/voicemail_detector.py +707 -0
- pipecat/frames/frames.py +590 -156
- pipecat/metrics/metrics.py +64 -1
- pipecat/observers/base_observer.py +58 -19
- pipecat/observers/loggers/debug_log_observer.py +56 -64
- pipecat/observers/loggers/llm_log_observer.py +8 -1
- pipecat/observers/loggers/transcription_log_observer.py +19 -7
- pipecat/observers/loggers/user_bot_latency_log_observer.py +32 -5
- pipecat/observers/turn_tracking_observer.py +26 -1
- pipecat/pipeline/base_pipeline.py +5 -7
- pipecat/pipeline/base_task.py +52 -9
- pipecat/pipeline/parallel_pipeline.py +121 -177
- pipecat/pipeline/pipeline.py +129 -20
- pipecat/pipeline/runner.py +50 -1
- pipecat/pipeline/sync_parallel_pipeline.py +132 -32
- pipecat/pipeline/task.py +263 -280
- pipecat/pipeline/task_observer.py +85 -34
- pipecat/pipeline/to_be_updated/merge_pipeline.py +32 -2
- pipecat/processors/aggregators/dtmf_aggregator.py +29 -22
- pipecat/processors/aggregators/gated.py +25 -24
- pipecat/processors/aggregators/gated_openai_llm_context.py +22 -2
- pipecat/processors/aggregators/llm_response.py +398 -89
- pipecat/processors/aggregators/openai_llm_context.py +161 -13
- pipecat/processors/aggregators/sentence.py +25 -14
- pipecat/processors/aggregators/user_response.py +28 -3
- pipecat/processors/aggregators/vision_image_frame.py +24 -14
- pipecat/processors/async_generator.py +28 -0
- pipecat/processors/audio/audio_buffer_processor.py +78 -37
- pipecat/processors/consumer_processor.py +25 -6
- pipecat/processors/filters/frame_filter.py +23 -0
- pipecat/processors/filters/function_filter.py +30 -0
- pipecat/processors/filters/identity_filter.py +17 -2
- pipecat/processors/filters/null_filter.py +24 -1
- pipecat/processors/filters/stt_mute_filter.py +56 -21
- pipecat/processors/filters/wake_check_filter.py +46 -3
- pipecat/processors/filters/wake_notifier_filter.py +21 -3
- pipecat/processors/frame_processor.py +488 -131
- pipecat/processors/frameworks/langchain.py +38 -3
- pipecat/processors/frameworks/rtvi.py +719 -34
- pipecat/processors/gstreamer/pipeline_source.py +41 -0
- pipecat/processors/idle_frame_processor.py +26 -3
- pipecat/processors/logger.py +23 -0
- pipecat/processors/metrics/frame_processor_metrics.py +77 -4
- pipecat/processors/metrics/sentry.py +42 -4
- pipecat/processors/producer_processor.py +34 -14
- pipecat/processors/text_transformer.py +22 -10
- pipecat/processors/transcript_processor.py +48 -29
- pipecat/processors/user_idle_processor.py +31 -21
- pipecat/runner/__init__.py +1 -0
- pipecat/runner/daily.py +132 -0
- pipecat/runner/livekit.py +148 -0
- pipecat/runner/run.py +543 -0
- pipecat/runner/types.py +67 -0
- pipecat/runner/utils.py +515 -0
- pipecat/serializers/base_serializer.py +42 -0
- pipecat/serializers/exotel.py +17 -6
- pipecat/serializers/genesys.py +95 -0
- pipecat/serializers/livekit.py +33 -0
- pipecat/serializers/plivo.py +16 -15
- pipecat/serializers/protobuf.py +37 -1
- pipecat/serializers/telnyx.py +18 -17
- pipecat/serializers/twilio.py +32 -16
- pipecat/services/ai_service.py +5 -3
- pipecat/services/anthropic/llm.py +113 -43
- pipecat/services/assemblyai/models.py +63 -5
- pipecat/services/assemblyai/stt.py +64 -11
- pipecat/services/asyncai/__init__.py +0 -0
- pipecat/services/asyncai/tts.py +501 -0
- pipecat/services/aws/llm.py +185 -111
- pipecat/services/aws/stt.py +217 -23
- pipecat/services/aws/tts.py +118 -52
- pipecat/services/aws/utils.py +101 -5
- pipecat/services/aws_nova_sonic/aws.py +82 -64
- pipecat/services/aws_nova_sonic/context.py +15 -6
- pipecat/services/azure/common.py +10 -2
- pipecat/services/azure/image.py +32 -0
- pipecat/services/azure/llm.py +9 -7
- pipecat/services/azure/stt.py +65 -2
- pipecat/services/azure/tts.py +154 -23
- pipecat/services/cartesia/stt.py +125 -8
- pipecat/services/cartesia/tts.py +102 -38
- pipecat/services/cerebras/llm.py +15 -23
- pipecat/services/deepgram/stt.py +19 -11
- pipecat/services/deepgram/tts.py +36 -0
- pipecat/services/deepseek/llm.py +14 -23
- pipecat/services/elevenlabs/tts.py +330 -64
- pipecat/services/fal/image.py +43 -0
- pipecat/services/fal/stt.py +48 -10
- pipecat/services/fireworks/llm.py +14 -21
- pipecat/services/fish/tts.py +109 -9
- pipecat/services/gemini_multimodal_live/__init__.py +1 -0
- pipecat/services/gemini_multimodal_live/events.py +83 -2
- pipecat/services/gemini_multimodal_live/file_api.py +189 -0
- pipecat/services/gemini_multimodal_live/gemini.py +218 -21
- pipecat/services/gladia/config.py +17 -10
- pipecat/services/gladia/stt.py +82 -36
- pipecat/services/google/frames.py +40 -0
- pipecat/services/google/google.py +2 -0
- pipecat/services/google/image.py +39 -2
- pipecat/services/google/llm.py +176 -58
- pipecat/services/google/llm_openai.py +26 -4
- pipecat/services/google/llm_vertex.py +37 -15
- pipecat/services/google/rtvi.py +41 -0
- pipecat/services/google/stt.py +65 -17
- pipecat/services/google/test-google-chirp.py +45 -0
- pipecat/services/google/tts.py +390 -19
- pipecat/services/grok/llm.py +8 -6
- pipecat/services/groq/llm.py +8 -6
- pipecat/services/groq/stt.py +13 -9
- pipecat/services/groq/tts.py +40 -0
- pipecat/services/hamsa/__init__.py +9 -0
- pipecat/services/hamsa/stt.py +241 -0
- pipecat/services/heygen/__init__.py +5 -0
- pipecat/services/heygen/api.py +281 -0
- pipecat/services/heygen/client.py +620 -0
- pipecat/services/heygen/video.py +338 -0
- pipecat/services/image_service.py +5 -3
- pipecat/services/inworld/__init__.py +1 -0
- pipecat/services/inworld/tts.py +592 -0
- pipecat/services/llm_service.py +127 -45
- pipecat/services/lmnt/tts.py +80 -7
- pipecat/services/mcp_service.py +85 -44
- pipecat/services/mem0/memory.py +42 -13
- pipecat/services/minimax/tts.py +74 -15
- pipecat/services/mistral/__init__.py +0 -0
- pipecat/services/mistral/llm.py +185 -0
- pipecat/services/moondream/vision.py +55 -10
- pipecat/services/neuphonic/tts.py +275 -48
- pipecat/services/nim/llm.py +8 -6
- pipecat/services/ollama/llm.py +27 -7
- pipecat/services/openai/base_llm.py +54 -16
- pipecat/services/openai/image.py +30 -0
- pipecat/services/openai/llm.py +7 -5
- pipecat/services/openai/stt.py +13 -9
- pipecat/services/openai/tts.py +42 -10
- pipecat/services/openai_realtime_beta/azure.py +11 -9
- pipecat/services/openai_realtime_beta/context.py +7 -5
- pipecat/services/openai_realtime_beta/events.py +10 -7
- pipecat/services/openai_realtime_beta/openai.py +37 -18
- pipecat/services/openpipe/llm.py +30 -24
- pipecat/services/openrouter/llm.py +9 -7
- pipecat/services/perplexity/llm.py +15 -19
- pipecat/services/piper/tts.py +26 -12
- pipecat/services/playht/tts.py +227 -65
- pipecat/services/qwen/llm.py +8 -6
- pipecat/services/rime/tts.py +128 -17
- pipecat/services/riva/stt.py +160 -22
- pipecat/services/riva/tts.py +67 -2
- pipecat/services/sambanova/llm.py +19 -17
- pipecat/services/sambanova/stt.py +14 -8
- pipecat/services/sarvam/tts.py +60 -13
- pipecat/services/simli/video.py +82 -21
- pipecat/services/soniox/__init__.py +0 -0
- pipecat/services/soniox/stt.py +398 -0
- pipecat/services/speechmatics/stt.py +29 -17
- pipecat/services/stt_service.py +47 -11
- pipecat/services/tavus/video.py +94 -25
- pipecat/services/together/llm.py +8 -6
- pipecat/services/tts_service.py +77 -53
- pipecat/services/ultravox/stt.py +46 -43
- pipecat/services/vision_service.py +5 -3
- pipecat/services/websocket_service.py +12 -11
- pipecat/services/whisper/base_stt.py +58 -12
- pipecat/services/whisper/stt.py +69 -58
- pipecat/services/xtts/tts.py +59 -2
- pipecat/sync/base_notifier.py +19 -0
- pipecat/sync/event_notifier.py +24 -0
- pipecat/tests/utils.py +73 -5
- pipecat/transcriptions/language.py +24 -0
- pipecat/transports/base_input.py +112 -8
- pipecat/transports/base_output.py +235 -13
- pipecat/transports/base_transport.py +119 -0
- pipecat/transports/local/audio.py +76 -0
- pipecat/transports/local/tk.py +84 -0
- pipecat/transports/network/fastapi_websocket.py +174 -15
- pipecat/transports/network/small_webrtc.py +383 -39
- pipecat/transports/network/webrtc_connection.py +214 -8
- pipecat/transports/network/websocket_client.py +171 -1
- pipecat/transports/network/websocket_server.py +147 -9
- pipecat/transports/services/daily.py +792 -70
- pipecat/transports/services/helpers/daily_rest.py +122 -129
- pipecat/transports/services/livekit.py +339 -4
- pipecat/transports/services/tavus.py +273 -38
- pipecat/utils/asyncio/task_manager.py +92 -186
- pipecat/utils/base_object.py +83 -1
- pipecat/utils/network.py +2 -0
- pipecat/utils/string.py +114 -58
- pipecat/utils/text/base_text_aggregator.py +44 -13
- pipecat/utils/text/base_text_filter.py +46 -0
- pipecat/utils/text/markdown_text_filter.py +70 -14
- pipecat/utils/text/pattern_pair_aggregator.py +18 -14
- pipecat/utils/text/simple_text_aggregator.py +43 -2
- pipecat/utils/text/skip_tags_aggregator.py +21 -13
- pipecat/utils/time.py +36 -0
- pipecat/utils/tracing/class_decorators.py +32 -7
- pipecat/utils/tracing/conversation_context_provider.py +12 -2
- pipecat/utils/tracing/service_attributes.py +80 -64
- pipecat/utils/tracing/service_decorators.py +48 -21
- pipecat/utils/tracing/setup.py +13 -7
- pipecat/utils/tracing/turn_context_provider.py +12 -2
- pipecat/utils/tracing/turn_trace_observer.py +27 -0
- pipecat/utils/utils.py +14 -14
- dv_pipecat_ai-0.0.74.dev770.dist-info/RECORD +0 -319
- pipecat/examples/daily_runner.py +0 -64
- pipecat/examples/run.py +0 -265
- pipecat/utils/asyncio/watchdog_async_iterator.py +0 -72
- pipecat/utils/asyncio/watchdog_event.py +0 -42
- pipecat/utils/asyncio/watchdog_priority_queue.py +0 -48
- pipecat/utils/asyncio/watchdog_queue.py +0 -48
- {dv_pipecat_ai-0.0.74.dev770.dist-info → dv_pipecat_ai-0.0.82.dev776.dist-info}/WHEEL +0 -0
- {dv_pipecat_ai-0.0.74.dev770.dist-info → dv_pipecat_ai-0.0.82.dev776.dist-info}/licenses/LICENSE +0 -0
- {dv_pipecat_ai-0.0.74.dev770.dist-info → dv_pipecat_ai-0.0.82.dev776.dist-info}/top_level.txt +0 -0
- /pipecat/{examples → extensions}/__init__.py +0 -0
|
@@ -20,11 +20,11 @@ from pydantic import BaseModel, Field, ValidationError
|
|
|
20
20
|
class DailyRoomSipParams(BaseModel):
|
|
21
21
|
"""SIP configuration parameters for Daily rooms.
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
display_name: Name shown for the SIP endpoint
|
|
25
|
-
video: Whether video is enabled for SIP
|
|
26
|
-
sip_mode: SIP connection mode, typically 'dial-in'
|
|
27
|
-
num_endpoints: Number of allowed SIP endpoints
|
|
23
|
+
Parameters:
|
|
24
|
+
display_name: Name shown for the SIP endpoint.
|
|
25
|
+
video: Whether video is enabled for SIP.
|
|
26
|
+
sip_mode: SIP connection mode, typically 'dial-in'.
|
|
27
|
+
num_endpoints: Number of allowed SIP endpoints.
|
|
28
28
|
"""
|
|
29
29
|
|
|
30
30
|
display_name: str = "sw-sip-dialin"
|
|
@@ -38,6 +38,31 @@ class RecordingsBucketConfig(BaseModel):
|
|
|
38
38
|
|
|
39
39
|
Refer to the Daily API documentation for more information:
|
|
40
40
|
https://docs.daily.co/guides/products/live-streaming-recording/storing-recordings-in-a-custom-s3-bucket
|
|
41
|
+
|
|
42
|
+
Parameters:
|
|
43
|
+
bucket_name: Name of the S3 bucket for storing recordings.
|
|
44
|
+
bucket_region: AWS region where the S3 bucket is located.
|
|
45
|
+
assume_role_arn: ARN of the IAM role to assume for S3 access.
|
|
46
|
+
allow_api_access: Whether to allow API access to the recordings.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
bucket_name: str
|
|
50
|
+
bucket_region: str
|
|
51
|
+
assume_role_arn: str
|
|
52
|
+
allow_api_access: bool = False
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class TranscriptionBucketConfig(BaseModel):
|
|
56
|
+
"""Configuration for storing Daily transcription in a custom S3 bucket.
|
|
57
|
+
|
|
58
|
+
Refer to the Daily API documentation for more information:
|
|
59
|
+
https://docs.daily.co/guides/products/live-streaming-recording/storing-recordings-in-a-custom-s3-bucket
|
|
60
|
+
|
|
61
|
+
Parameters:
|
|
62
|
+
bucket_name: Name of the S3 bucket for storing transcription.
|
|
63
|
+
bucket_region: AWS region where the S3 bucket is located.
|
|
64
|
+
assume_role_arn: ARN of the IAM role to assume for S3 access.
|
|
65
|
+
allow_api_access: Whether to allow API access to the transcription.
|
|
41
66
|
"""
|
|
42
67
|
|
|
43
68
|
bucket_name: str
|
|
@@ -49,21 +74,24 @@ class RecordingsBucketConfig(BaseModel):
|
|
|
49
74
|
class DailyRoomProperties(BaseModel, extra="allow"):
|
|
50
75
|
"""Properties for configuring a Daily room.
|
|
51
76
|
|
|
52
|
-
Attributes:
|
|
53
|
-
exp: Optional Unix epoch timestamp for room expiration (e.g., time.time() + 300 for 5 minutes)
|
|
54
|
-
enable_chat: Whether chat is enabled in the room
|
|
55
|
-
enable_prejoin_ui: Whether the pre-join UI is enabled
|
|
56
|
-
enable_emoji_reactions: Whether emoji reactions are enabled
|
|
57
|
-
eject_at_room_exp: Whether to remove participants when room expires
|
|
58
|
-
enable_dialout: Whether SIP dial-out is enabled
|
|
59
|
-
enable_recording: Recording settings ('cloud', 'local', 'raw-tracks')
|
|
60
|
-
geo: Geographic region for room
|
|
61
|
-
max_participants: Maximum number of participants allowed in the room
|
|
62
|
-
sip: SIP configuration parameters
|
|
63
|
-
sip_uri: SIP URI information returned by Daily
|
|
64
|
-
start_video_off: Whether video is off by default
|
|
65
|
-
|
|
66
77
|
Reference: https://docs.daily.co/reference/rest-api/rooms/create-room#properties
|
|
78
|
+
|
|
79
|
+
Parameters:
|
|
80
|
+
exp: Optional Unix epoch timestamp for room expiration (e.g., time.time() + 300 for 5 minutes).
|
|
81
|
+
enable_chat: Whether chat is enabled in the room.
|
|
82
|
+
enable_prejoin_ui: Whether the pre-join UI is enabled.
|
|
83
|
+
enable_emoji_reactions: Whether emoji reactions are enabled.
|
|
84
|
+
eject_at_room_exp: Whether to remove participants when room expires.
|
|
85
|
+
enable_dialout: Whether SIP dial-out is enabled.
|
|
86
|
+
enable_recording: Recording settings ('cloud', 'local', 'raw-tracks').
|
|
87
|
+
enable_transcription_storage: Whether transcription storage is enabled.
|
|
88
|
+
geo: Geographic region for room.
|
|
89
|
+
max_participants: Maximum number of participants allowed in the room.
|
|
90
|
+
recordings_bucket: Configuration for custom S3 bucket recordings.
|
|
91
|
+
transcription_bucket: Configuration for custom S3 bucket transcription.
|
|
92
|
+
sip: SIP configuration parameters.
|
|
93
|
+
sip_uri: SIP URI information returned by Daily.
|
|
94
|
+
start_video_off: Whether video is off by default.
|
|
67
95
|
"""
|
|
68
96
|
|
|
69
97
|
exp: Optional[float] = None
|
|
@@ -73,9 +101,11 @@ class DailyRoomProperties(BaseModel, extra="allow"):
|
|
|
73
101
|
eject_at_room_exp: bool = False
|
|
74
102
|
enable_dialout: Optional[bool] = None
|
|
75
103
|
enable_recording: Optional[Literal["cloud", "local", "raw-tracks"]] = None
|
|
104
|
+
enable_transcription_storage: Optional[bool] = None
|
|
76
105
|
geo: Optional[str] = None
|
|
77
106
|
max_participants: Optional[int] = None
|
|
78
107
|
recordings_bucket: Optional[RecordingsBucketConfig] = None
|
|
108
|
+
transcription_bucket: Optional[TranscriptionBucketConfig] = None
|
|
79
109
|
sip: Optional[DailyRoomSipParams] = None
|
|
80
110
|
sip_uri: Optional[dict] = None
|
|
81
111
|
start_video_off: bool = False
|
|
@@ -85,7 +115,7 @@ class DailyRoomProperties(BaseModel, extra="allow"):
|
|
|
85
115
|
"""Get the SIP endpoint URI if available.
|
|
86
116
|
|
|
87
117
|
Returns:
|
|
88
|
-
|
|
118
|
+
SIP endpoint URI or empty string if not available.
|
|
89
119
|
"""
|
|
90
120
|
if not self.sip_uri:
|
|
91
121
|
return ""
|
|
@@ -96,10 +126,10 @@ class DailyRoomProperties(BaseModel, extra="allow"):
|
|
|
96
126
|
class DailyRoomParams(BaseModel):
|
|
97
127
|
"""Parameters for creating a Daily room.
|
|
98
128
|
|
|
99
|
-
|
|
100
|
-
name: Optional custom name for the room
|
|
101
|
-
privacy: Room privacy setting ('private' or 'public')
|
|
102
|
-
properties: Room configuration properties
|
|
129
|
+
Parameters:
|
|
130
|
+
name: Optional custom name for the room.
|
|
131
|
+
privacy: Room privacy setting ('private' or 'public').
|
|
132
|
+
properties: Room configuration properties.
|
|
103
133
|
"""
|
|
104
134
|
|
|
105
135
|
name: Optional[str] = None
|
|
@@ -110,14 +140,14 @@ class DailyRoomParams(BaseModel):
|
|
|
110
140
|
class DailyRoomObject(BaseModel):
|
|
111
141
|
"""Represents a Daily room returned by the API.
|
|
112
142
|
|
|
113
|
-
|
|
114
|
-
id: Unique room identifier
|
|
115
|
-
name: Room name
|
|
116
|
-
api_created: Whether room was created via API
|
|
117
|
-
privacy: Room privacy setting ('private' or 'public')
|
|
118
|
-
url: Full URL for joining the room
|
|
143
|
+
Parameters:
|
|
144
|
+
id: Unique room identifier.
|
|
145
|
+
name: Room name.
|
|
146
|
+
api_created: Whether room was created via API.
|
|
147
|
+
privacy: Room privacy setting ('private' or 'public').
|
|
148
|
+
url: Full URL for joining the room.
|
|
119
149
|
created_at: Timestamp of room creation in ISO 8601 format (e.g., "2019-01-26T09:01:22.000Z").
|
|
120
|
-
config: Room configuration properties
|
|
150
|
+
config: Room configuration properties.
|
|
121
151
|
"""
|
|
122
152
|
|
|
123
153
|
id: str
|
|
@@ -134,71 +164,40 @@ class DailyMeetingTokenProperties(BaseModel):
|
|
|
134
164
|
|
|
135
165
|
Refer to the Daily API documentation for more information:
|
|
136
166
|
https://docs.daily.co/reference/rest-api/meeting-tokens/create-meeting-token#properties
|
|
167
|
+
|
|
168
|
+
Parameters:
|
|
169
|
+
room_name: The room for which this token is valid. If not set, the token is valid for all rooms in your domain.
|
|
170
|
+
eject_at_token_exp: If True, the user will be ejected from the room when the token expires.
|
|
171
|
+
eject_after_elapsed: The number of seconds after which the user will be ejected from the room.
|
|
172
|
+
nbf: Not before timestamp - users cannot join with this token before this time.
|
|
173
|
+
exp: Expiration time (unix timestamp in seconds). Strongly recommended for security.
|
|
174
|
+
is_owner: If True, the token will grant owner privileges in the room.
|
|
175
|
+
user_name: The name of the user. This will be added to the token payload.
|
|
176
|
+
user_id: A unique identifier for the user. This will be added to the token payload.
|
|
177
|
+
enable_screenshare: If True, the user will be able to share their screen.
|
|
178
|
+
start_video_off: If True, the user's video will be turned off when they join the room.
|
|
179
|
+
start_audio_off: If True, the user's audio will be turned off when they join the room.
|
|
180
|
+
enable_recording: Recording settings for the token. Must be one of 'cloud', 'local' or 'raw-tracks'.
|
|
181
|
+
enable_prejoin_ui: If True, the user will see the prejoin UI before joining the room.
|
|
182
|
+
start_cloud_recording: Start cloud recording when the user joins the room.
|
|
183
|
+
permissions: Specifies the initial default permissions for a non-meeting-owner participant.
|
|
137
184
|
"""
|
|
138
185
|
|
|
139
|
-
room_name: Optional[str] =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
default=None,
|
|
155
|
-
description="Not before. This is a unix timestamp (seconds since the epoch.) Users cannot join a meeting in with this token before this time.",
|
|
156
|
-
)
|
|
157
|
-
|
|
158
|
-
exp: Optional[int] = Field(
|
|
159
|
-
default=None,
|
|
160
|
-
description="Expiration time (unix timestamp in seconds). We strongly recommend setting this value for security. If not set, the token will not expire. Refer docs for more info.",
|
|
161
|
-
)
|
|
162
|
-
is_owner: Optional[bool] = Field(
|
|
163
|
-
default=None,
|
|
164
|
-
description="If `true`, the token will grant owner privileges in the room. Defaults to `false`.",
|
|
165
|
-
)
|
|
166
|
-
user_name: Optional[str] = Field(
|
|
167
|
-
default=None,
|
|
168
|
-
description="The name of the user. This will be added to the token payload.",
|
|
169
|
-
)
|
|
170
|
-
user_id: Optional[str] = Field(
|
|
171
|
-
default=None,
|
|
172
|
-
description="A unique identifier for the user. This will be added to the token payload.",
|
|
173
|
-
)
|
|
174
|
-
enable_screenshare: Optional[bool] = Field(
|
|
175
|
-
default=None,
|
|
176
|
-
description="If `true`, the user will be able to share their screen. Defaults to `true`.",
|
|
177
|
-
)
|
|
178
|
-
start_video_off: Optional[bool] = Field(
|
|
179
|
-
default=None,
|
|
180
|
-
description="If `true`, the user's video will be turned off when they join the room. Defaults to `false`.",
|
|
181
|
-
)
|
|
182
|
-
start_audio_off: Optional[bool] = Field(
|
|
183
|
-
default=None,
|
|
184
|
-
description="If `true`, the user's audio will be turned off when they join the room. Defaults to `false`.",
|
|
185
|
-
)
|
|
186
|
-
enable_recording: Optional[Literal["cloud", "local", "raw-tracks"]] = Field(
|
|
187
|
-
default=None,
|
|
188
|
-
description="Recording settings for the token. Must be one of `cloud`, `local` or `raw-tracks`.",
|
|
189
|
-
)
|
|
190
|
-
enable_prejoin_ui: Optional[bool] = Field(
|
|
191
|
-
default=None,
|
|
192
|
-
description="If `true`, the user will see the prejoin UI before joining the room.",
|
|
193
|
-
)
|
|
194
|
-
start_cloud_recording: Optional[bool] = Field(
|
|
195
|
-
default=None,
|
|
196
|
-
description="Start cloud recording when the user joins the room. This can be used to always record and archive meetings, for example in a customer support context.",
|
|
197
|
-
)
|
|
198
|
-
permissions: Optional[dict] = Field(
|
|
199
|
-
default=None,
|
|
200
|
-
description="Specifies the initial default permissions for a non-meeting-owner participant joining a call.",
|
|
201
|
-
)
|
|
186
|
+
room_name: Optional[str] = None
|
|
187
|
+
eject_at_token_exp: Optional[bool] = None
|
|
188
|
+
eject_after_elapsed: Optional[int] = None
|
|
189
|
+
nbf: Optional[int] = None
|
|
190
|
+
exp: Optional[int] = None
|
|
191
|
+
is_owner: Optional[bool] = None
|
|
192
|
+
user_name: Optional[str] = None
|
|
193
|
+
user_id: Optional[str] = None
|
|
194
|
+
enable_screenshare: Optional[bool] = None
|
|
195
|
+
start_video_off: Optional[bool] = None
|
|
196
|
+
start_audio_off: Optional[bool] = None
|
|
197
|
+
enable_recording: Optional[Literal["cloud", "local", "raw-tracks"]] = None
|
|
198
|
+
enable_prejoin_ui: Optional[bool] = None
|
|
199
|
+
start_cloud_recording: Optional[bool] = None
|
|
200
|
+
permissions: Optional[dict] = None
|
|
202
201
|
|
|
203
202
|
|
|
204
203
|
class DailyMeetingTokenParams(BaseModel):
|
|
@@ -206,6 +205,9 @@ class DailyMeetingTokenParams(BaseModel):
|
|
|
206
205
|
|
|
207
206
|
Refer to the Daily API documentation for more information:
|
|
208
207
|
https://docs.daily.co/reference/rest-api/meeting-tokens/create-meeting-token#body-params
|
|
208
|
+
|
|
209
|
+
Parameters:
|
|
210
|
+
properties: Meeting token configuration properties.
|
|
209
211
|
"""
|
|
210
212
|
|
|
211
213
|
properties: DailyMeetingTokenProperties = Field(default_factory=DailyMeetingTokenProperties)
|
|
@@ -215,11 +217,6 @@ class DailyRESTHelper:
|
|
|
215
217
|
"""Helper class for interacting with Daily's REST API.
|
|
216
218
|
|
|
217
219
|
Provides methods for creating, managing, and accessing Daily rooms.
|
|
218
|
-
|
|
219
|
-
Args:
|
|
220
|
-
daily_api_key: Your Daily API key
|
|
221
|
-
daily_api_url: Daily API base URL (e.g. "https://api.daily.co/v1")
|
|
222
|
-
aiohttp_session: Async HTTP session for making requests
|
|
223
220
|
"""
|
|
224
221
|
|
|
225
222
|
def __init__(
|
|
@@ -229,7 +226,13 @@ class DailyRESTHelper:
|
|
|
229
226
|
daily_api_url: str = "https://api.daily.co/v1",
|
|
230
227
|
aiohttp_session: aiohttp.ClientSession,
|
|
231
228
|
):
|
|
232
|
-
"""Initialize the Daily REST helper.
|
|
229
|
+
"""Initialize the Daily REST helper.
|
|
230
|
+
|
|
231
|
+
Args:
|
|
232
|
+
daily_api_key: Your Daily API key.
|
|
233
|
+
daily_api_url: Daily API base URL (e.g. "https://api.daily.co/v1").
|
|
234
|
+
aiohttp_session: Async HTTP session for making requests.
|
|
235
|
+
"""
|
|
233
236
|
self.daily_api_key = daily_api_key
|
|
234
237
|
self.daily_api_url = daily_api_url
|
|
235
238
|
self.aiohttp_session = aiohttp_session
|
|
@@ -238,10 +241,10 @@ class DailyRESTHelper:
|
|
|
238
241
|
"""Extract room name from a Daily room URL.
|
|
239
242
|
|
|
240
243
|
Args:
|
|
241
|
-
room_url: Full Daily room URL
|
|
244
|
+
room_url: Full Daily room URL.
|
|
242
245
|
|
|
243
246
|
Returns:
|
|
244
|
-
|
|
247
|
+
Room name portion of the URL.
|
|
245
248
|
"""
|
|
246
249
|
return urlparse(room_url).path[1:]
|
|
247
250
|
|
|
@@ -249,10 +252,10 @@ class DailyRESTHelper:
|
|
|
249
252
|
"""Get room details from a Daily room URL.
|
|
250
253
|
|
|
251
254
|
Args:
|
|
252
|
-
room_url: Full Daily room URL
|
|
255
|
+
room_url: Full Daily room URL.
|
|
253
256
|
|
|
254
257
|
Returns:
|
|
255
|
-
DailyRoomObject
|
|
258
|
+
DailyRoomObject instance for the room.
|
|
256
259
|
"""
|
|
257
260
|
room_name = self.get_name_from_url(room_url)
|
|
258
261
|
return await self._get_room_from_name(room_name)
|
|
@@ -261,13 +264,13 @@ class DailyRESTHelper:
|
|
|
261
264
|
"""Create a new Daily room.
|
|
262
265
|
|
|
263
266
|
Args:
|
|
264
|
-
params: Room configuration parameters
|
|
267
|
+
params: Room configuration parameters.
|
|
265
268
|
|
|
266
269
|
Returns:
|
|
267
|
-
DailyRoomObject
|
|
270
|
+
DailyRoomObject instance for the created room.
|
|
268
271
|
|
|
269
272
|
Raises:
|
|
270
|
-
Exception: If room creation fails or response is invalid
|
|
273
|
+
Exception: If room creation fails or response is invalid.
|
|
271
274
|
"""
|
|
272
275
|
headers = {"Authorization": f"Bearer {self.daily_api_key}"}
|
|
273
276
|
json = params.model_dump(exclude_none=True)
|
|
@@ -298,19 +301,19 @@ class DailyRESTHelper:
|
|
|
298
301
|
"""Generate a meeting token for user to join a Daily room.
|
|
299
302
|
|
|
300
303
|
Args:
|
|
301
|
-
room_url: Daily room URL
|
|
302
|
-
expiry_time: Token validity duration in seconds (default: 1 hour)
|
|
303
|
-
eject_at_token_exp: Whether to eject user when token expires
|
|
304
|
-
owner: Whether token has owner privileges
|
|
304
|
+
room_url: Daily room URL.
|
|
305
|
+
expiry_time: Token validity duration in seconds (default: 1 hour).
|
|
306
|
+
eject_at_token_exp: Whether to eject user when token expires.
|
|
307
|
+
owner: Whether token has owner privileges.
|
|
305
308
|
params: Optional additional token properties. Note that room_name,
|
|
306
309
|
exp, and is_owner will be set based on the other function
|
|
307
310
|
parameters regardless of values in params.
|
|
308
311
|
|
|
309
312
|
Returns:
|
|
310
|
-
|
|
313
|
+
Meeting token.
|
|
311
314
|
|
|
312
315
|
Raises:
|
|
313
|
-
Exception: If token generation fails or room URL is missing
|
|
316
|
+
Exception: If token generation fails or room URL is missing.
|
|
314
317
|
"""
|
|
315
318
|
if not room_url:
|
|
316
319
|
raise Exception(
|
|
@@ -355,10 +358,10 @@ class DailyRESTHelper:
|
|
|
355
358
|
"""Delete a room using its URL.
|
|
356
359
|
|
|
357
360
|
Args:
|
|
358
|
-
room_url: Daily room URL
|
|
361
|
+
room_url: Daily room URL.
|
|
359
362
|
|
|
360
363
|
Returns:
|
|
361
|
-
|
|
364
|
+
True if deletion was successful.
|
|
362
365
|
"""
|
|
363
366
|
room_name = self.get_name_from_url(room_url)
|
|
364
367
|
return await self.delete_room_by_name(room_name)
|
|
@@ -367,13 +370,13 @@ class DailyRESTHelper:
|
|
|
367
370
|
"""Delete a room using its name.
|
|
368
371
|
|
|
369
372
|
Args:
|
|
370
|
-
room_name: Name of the room to delete
|
|
373
|
+
room_name: Name of the room to delete.
|
|
371
374
|
|
|
372
375
|
Returns:
|
|
373
|
-
|
|
376
|
+
True if deletion was successful.
|
|
374
377
|
|
|
375
378
|
Raises:
|
|
376
|
-
Exception: If deletion fails (excluding 404 Not Found)
|
|
379
|
+
Exception: If deletion fails (excluding 404 Not Found).
|
|
377
380
|
"""
|
|
378
381
|
headers = {"Authorization": f"Bearer {self.daily_api_key}"}
|
|
379
382
|
async with self.aiohttp_session.delete(
|
|
@@ -386,17 +389,7 @@ class DailyRESTHelper:
|
|
|
386
389
|
return True
|
|
387
390
|
|
|
388
391
|
async def _get_room_from_name(self, room_name: str) -> DailyRoomObject:
|
|
389
|
-
"""Internal method to get room details by name.
|
|
390
|
-
|
|
391
|
-
Args:
|
|
392
|
-
room_name: Name of the room
|
|
393
|
-
|
|
394
|
-
Returns:
|
|
395
|
-
DailyRoomObject: DailyRoomObject instance for the room
|
|
396
|
-
|
|
397
|
-
Raises:
|
|
398
|
-
Exception: If room is not found or response is invalid
|
|
399
|
-
"""
|
|
392
|
+
"""Internal method to get room details by name."""
|
|
400
393
|
headers = {"Authorization": f"Bearer {self.daily_api_key}"}
|
|
401
394
|
async with self.aiohttp_session.get(
|
|
402
395
|
f"{self.daily_api_url}/rooms/{room_name}", headers=headers
|