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

Add connect_named_pipe method to CloudAdapter in support of DirectLine Speech

Open stevkan opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. When creating a bot that would utilize DirectLine Speech, the current version of the Python SDK does not fully support the use of this service. While much of the infrastructure is in place, the necessary connect_named_pipe method is missing on the CloudAdapter class that would make this service accessible.

Describe the solution you'd like The connect_named_pipe method needs to be added to the CloudAdapter class located in the cloud_adapter.py file. Using the methods present in the .Net and JS SDKs for reference, it mightlook something like this:

async def connect_named_pipe(
    self, pipe_name: str, bot: Bot, audience: str, callerId: str
):
    streaming_activity_processor = _StreamingActivityProcessor(
        authenticate_request_result=AuthenticateRequestResult(
            audience=audience,
            caller_id=callerId,
            service_url=None,
            connector_factory=ConnectorFactory(
                credentials=MicrosoftAppCredentials(
                    self._AUTH_HEADER_NAME, self._CHANNEL_ID_HEADER_NAME
                ),
                channel_service=None,
            ),
        ),
        adapter=self,
        bot=bot,
    )
    await streaming_activity_processor.connect_named_pipe(pipe_name)

As they would be utilized by the above proposed method, it may be necessary to make updates to the _StreamingActivityProcessor and _StreamingConnectorFactory classes, also located in the cloud_adapter.py file.

stevkan avatar Feb 09 '24 18:02 stevkan