diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f9edc8e1..0a87b0a2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -24,6 +24,8 @@ "postCreateCommand": "bash .devcontainer/scripts/post-create.sh", "postStartCommand": "bash .devcontainer/scripts/post-start.sh", "forwardPorts": [ + 3000, + 8000, 5432, 6379, 9000, diff --git a/api/services/workflow/pipecat_engine_callbacks.py b/api/services/workflow/pipecat_engine_callbacks.py index 0c80704b..9e58f1df 100644 --- a/api/services/workflow/pipecat_engine_callbacks.py +++ b/api/services/workflow/pipecat_engine_callbacks.py @@ -46,14 +46,14 @@ class UserIdleHandler: if self._retry_count == 1: message = { - "role": "user", + "role": "system", "content": "The user has been quiet. Politely and briefly ask if they're still there in the language that the user has been speaking so far.", } await aggregator.push_frame(LLMMessagesAppendFrame([message], run_llm=True)) return message = { - "role": "user", + "role": "system", "content": "The user has been quiet. We will be disconnecting the call now. Wish them a good day in the language that the user has been speaking so far.", } await aggregator.push_frame(LLMMessagesAppendFrame([message], run_llm=True)) diff --git a/api/tests/test_realtime_message_append.py b/api/tests/test_realtime_message_append.py index 56ec8927..2025dc5d 100644 --- a/api/tests/test_realtime_message_append.py +++ b/api/tests/test_realtime_message_append.py @@ -20,7 +20,7 @@ async def test_openai_realtime_messages_append_frame_sends_conversation_item(): await service._handle_messages_append( LLMMessagesAppendFrame( - [{"role": "user", "content": "Are you still there?"}], + [{"role": "system", "content": "Are you still there?"}], run_llm=True, ) ) @@ -28,7 +28,7 @@ async def test_openai_realtime_messages_append_frame_sends_conversation_item(): service.send_client_event.assert_awaited_once() event = service.send_client_event.await_args.args[0] assert isinstance(event, events.ConversationItemCreateEvent) - assert event.item.role == "user" + assert event.item.role == "system" assert event.item.type == "message" assert event.item.content == [ events.ItemContent(type="input_text", text="Are you still there?") @@ -53,7 +53,7 @@ async def test_user_idle_handler_uses_realtime_append_path(): assert frame.run_llm is True assert frame.messages == [ { - "role": "user", + "role": "system", "content": "The user has been quiet. Politely and briefly ask if they're still there in the language that the user has been speaking so far.", } ]