Skip to content
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

Facing problem implementing streaming using directline channel #5277

Open
NagarroShobharaja opened this issue Sep 5, 2024 · 0 comments
Open
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Required for internal Azure reporting. Do not delete. question Further information is requested. Stack Overflow candidate

Comments

@NagarroShobharaja
Copy link

I have a question

Hello All,

i tried implementing the solution using the below code please let me know what I'm doing it wrong.

i have followed instruction from this file
LIVESTREAMING.md

else if (turnContext.Activity.ChannelId.Equals(Channels.Directline))
            {
                var oldActivity = new Bot.Schema.Activity();

                oldActivity.Type = "typing";
                oldActivity.Text = "Searching your document library...";
                oldActivity.ChannelData = new ChannelData()
                {
                    streamSequence = 1,
                    streamType = "informative"
                };
                var activityid = await turnContext.SendActivityAsync(oldActivity);

                Thread.Sleep(1000);

                oldActivity.Type = "typing";
                oldActivity.Text = "A quick";
                oldActivity.ChannelData = new ChannelData()
                {
                    streamId = activityid.Id,
                    streamSequence = 2,
                    streamType = "streaming"
                };
                await turnContext.SendActivityAsync(oldActivity);

                Thread.Sleep(1000);

                oldActivity.Type = "typing";
                oldActivity.Text = "A quick brown fox";
                oldActivity.ChannelData = new ChannelData()
                {
                    streamId = activityid.Id,
                    streamSequence = 3,
                    streamType = "streaming"
                };
                await turnContext.SendActivityAsync(oldActivity);

                Thread.Sleep(1000);

                oldActivity.Type = "message";
                oldActivity.Text = "A quick brown fox jumped over the lazy dogs.";
                oldActivity.ChannelData = new ChannelData() { streamId = activityid.Id, streamType = "final" };
                await turnContext.SendActivityAsync(oldActivity);
            }
@NagarroShobharaja NagarroShobharaja added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Required for internal Azure reporting. Do not delete. question Further information is requested. Stack Overflow candidate labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Required for internal Azure reporting. Do not delete. question Further information is requested. Stack Overflow candidate
Projects
None yet
Development

No branches or pull requests

1 participant