Implement response handling and speech tracking in CallEnd functionality

- Add begin_response and finish_after_current_speech methods to CallEndCoordinator for better management of speech events.
- Update PromptBrain to utilize new methods, ensuring proper handling of generated closing speech and tool-only calls.
- Enhance tests to verify the correct behavior of speech tracking and response handling in various scenarios, including waiting for audio to finish before ending calls.
- Introduce a new test suite for CallEndCoordinator to validate the interaction with speech frames.
This commit is contained in:
Xin Wang
2026-07-14 13:43:42 +08:00
parent d069e5282e
commit e78dc4088a
5 changed files with 151 additions and 12 deletions

View File

@@ -51,8 +51,12 @@ class CallEndPort(Protocol):
def begin(self, reason: str) -> None: ...
def begin_response(self) -> None: ...
def arm_after_speech(self) -> None: ...
async def finish_after_current_speech(self, *, has_text: bool) -> None: ...
async def finish(self) -> None: ...