microsoft / microsoft/BotFramework-WebChat

Facing problem implementing streaming using directline channel

Open
#5,277 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bot Services customer-reported question
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

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);
            }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with docs/LIVESTREAMING.md at the bot-implementation section and compare its Direct Line requirements with the activity sequence in the issue. Reproduce the reported behavior using the provided C# example and capture the actual result or error. Done means identifying a specific defect with a reproducible case, or confirming the implementation streams successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.