vocode-python icon indicating copy to clipboard operation
vocode-python copied to clipboard

Decouple telephony from StreamingConversation

Open ajar98 opened this issue 1 year ago • 1 comments

We’d like support other “streaming” conversations on the phone - basically anything that can accept streaming audio chunks and send out streaming audio chunks concurrently should supportable on a phone call

  • An AbstractPhoneConversation needs to have a StreamingConversation, not be a StreamingConversation - then it works pretty cleanly - use AudioPipeline[0] for this
  • Create notion of PipelineFactory and PipelineConfig to contain typed versions of pipelines that can be used on phone calls and create the first version (e.g. StreamingConversationFactory and StreamingConversationConfig)

[0] https://github.com/vocodedev/vocode-core/issues/650

ajar98 avatar Jul 19 '24 18:07 ajar98

hello @ajar98

I’ve been evaluating the project, and in relation to this, I believe it would be interesting to implement it through a factory, allowing this factory to be overridden during the call creation.

In the context of SIP with Twilio, it’s common to receive information in the headers of a transferred call. The headers sent with the "X-" prefix are forwarded with the "SipHeader_" prefix and can be extracted from the body. Having access to the body that initializes the call when creating the agent can be very useful for adjusting the call behavior, such as changing the prompts or the voice that will handle the call.

Implementing this feature would provide greater flexibility. Instead of:

call_config = TwilioCallConfig(config.... )
conversation_id = create_conversation_id()
await self.config_manager.save_config(conversation_id, call_config)

We could consider changing it to something like:

self.call_config_factory = TwilioCallConfigFactory()
....

call_config = self.call_config_factory.create_config(config..., extra_params=twilio_body)
conversation_id = call_config.conversation_id
await self.config_manager.save_config(conversation_id, call_config)

Overriding the factory during the initialization of the flow would give the system the necessary versatility to adapt the call behavior based on the parameters received. This simple change allows for greater system flexibility. For example, it could use different languages depending on the caller, or the agent could behave differently based on the transcription or specific needs if the call was transferred from another location.

rodrigoGA avatar Aug 16 '24 15:08 rodrigoGA

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 16 '24 02:10 github-actions[bot]

This issue has been automatically closed due to inactivity. Thank you for your contributions.

github-actions[bot] avatar Oct 24 '24 02:10 github-actions[bot]