Skip to content

Add on_start support to VoiceWorkflowBase and VoicePipeline #922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vrtnis
Copy link

@vrtnis vrtnis commented Jun 23, 2025

I added an optional on_start() method to VoiceWorkflowBase, allowing voice workflows to emit an initial TTS message before any user input. This aligns with the usage pattern suggested in #488

The VoicePipeline._run_multi_turn() method was updated to call this hook and stream any yielded messages via TTS before transcription begins. No changes are required to existing workflows, as the method defaults to returning an empty AsyncIterator[str].

Resolves #488 and thus improves UX for voice agents that need to greet or instruct users proactively. All tests pass under Python 3.12. Let me know if you'd like an example workflow or docs added in a follow-up!

@vrtnis vrtnis changed the title Add on_start support to VoiceWorkflowBase and VoicePipeline (resolves #488) Add on_start support to VoiceWorkflowBase and VoicePipeline Jun 23, 2025
@seratch seratch added the enhancement New feature or request label Jun 25, 2025
@seratch seratch requested a review from dkundel-openai June 25, 2025 03:49
@vrtnis vrtnis force-pushed the voice-onstart-support branch from 2a2941d to 6f2366d Compare June 25, 2025 05:39
Copy link
Collaborator

@rm-openai rm-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vrtnis this looks reasonable, just one quick change

Copy link
Collaborator

@rm-openai rm-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vrtnis this looks reasonable, just one quick change

@vrtnis vrtnis force-pushed the voice-onstart-support branch from 6f2366d to e94d576 Compare June 27, 2025 16:45
@vrtnis vrtnis force-pushed the voice-onstart-support branch from e94d576 to e8ff208 Compare June 27, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature:voice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Intro message function for VoicePipeline
3 participants