diff --git a/CHANGELOG.md b/CHANGELOG.md index 0758360d6..e4ee4e5f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,10 +15,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `LiveKitTransportLayer`. - Added `enable_prejoin_ui`, `max_participants` and `start_video_off` params to `DailyRoomProperties`. +- Added `session_timeout` param in `FastAPIWebsocketTransport` and `WebsocketServerTransport` + to set the session timeout in seconds, this triggers callback method `on_session_timeout` + where you can handle the timeout event as per business logic. Refer to `examples/websocket-server/bot.py`. + ### Changed - api_key, aws_access_key_id and region are no longer required parameters for the PollyTTSService (AWSTTSService) +- Added `session_timeout` example in `examples/websocket-server/bot.py` to handle session timeout event. ### Fixed diff --git a/examples/websocket-server/bot.py b/examples/websocket-server/bot.py index 483920184..7c6670205 100644 --- a/examples/websocket-server/bot.py +++ b/examples/websocket-server/bot.py @@ -12,7 +12,7 @@ from dotenv import load_dotenv from loguru import logger from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import LLMMessagesFrame, BotInterruptionFrame, EndFrame +from pipecat.frames.frames import BotInterruptionFrame, EndFrame, LLMMessagesFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask @@ -32,8 +32,7 @@ logger.add(sys.stderr, level="DEBUG") class SessionTimeoutHandler: - """ - Handles actions to be performed when a session times out. + """Handles actions to be performed when a session times out. Inputs: - task: Pipeline task (used to queue frames). - tts: TTS service (used to generate speech output).