microsoft / botframework-directline-dotnet Goto Github PK
View Code? Open in Web Editor NEWC# client library for Microsoft Bot Framework's Direct Line protocol
License: MIT License
C# client library for Microsoft Bot Framework's Direct Line protocol
License: MIT License
[enhancement]
2.3.0
I added the following Universal.Microsoft.Bot.Connector.DirectLine dll and its dependencies to the project's Assets\Plugins folder in Unity and now when I open the project I get an error saying the assemblies have been unloaded because they can cause crashes.
Just add the dll to the Assets\Plugins folder as described in the Unity documentation and open the project.
I expected to be able to use the bot connector to connect to my botframework bot running on Azure.
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
[bug]
What package version of the SDK are you using.
Microsoft.Bot.Builder.Integration.AspNet.Core
:4.21.0
After creating a .NET Client to Connect to Direct Line App Service extension, a 403 error is thrown.
Documentation for creating DLASE Client in .NET: https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-directline-extension-net-client?view=azure-bot-service-4.0
Steps to reproduce the behavior:
MicrosoftAppTenantId
in app service configuration after deploymentRun .NET Client to Connect to Direct Line App Service extension without errors.
System.AggregateException: "One or more errors occurred. (The server returned status code '403' when status code '101' was expected.)" ---> System.Net.WebSockets.WebSocketException: "The server returned status code '403' when status
$(String[] args) in /Users/ram/Documents/bot/BF/directline_bots/Csharp/CSharpDLASEClient/CustomerDLASE_ConsoleApp/Program.cs:24
code '101' was expected." at System.Net.WebSockets.WebSocketHandle.d__13.MoveNext()\n at System.Net.WebSockets.ClientWebSocket.d__15.MoveNext()\n at Microsoft.Bot.Streaming.Transport.WebSockets.WebSocketClient.d__21.MoveNext()\n at Microsoft.Bot.Streaming.Transport.WebSockets.WebSocketClient.d__20.MoveNext()\n at Microsoft.Bot.Connector.DirectLine.StreamingConversations.d__15.MoveNext() in /Users/ram/Documents/bot/BF/directline_bots/Csharp/CSharpDLASEClient/BotFramework-DirectLine-DotNet/libraries/Streaming/StreamingConversations.cs:line 77\n at CustomerDLASE_ConsoleApp.DirectLineInterface.d__7.MoveNext() in /Users/ram/Documents/bot/BF/directline_bots/Csharp/CSharpDLASEClient/CustomerDLASE_ConsoleApp/Directline.cs:69 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\n at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\n at System.Threading.Tasks.Task.Wait()\n at Program.
[bug]
In the Microsoft BotBuilder family, the .Net NuGet package Microsoft.Bot.Connector.DirectLine is not Open Source and does not have a GitHub repo, so I open this issue here.
In the bot service documentation, it says that if an app has an expired token (too late to be renewed) in the client side, it should ask the server-side of the application to create a new token for the current conversation, based on the secret (that the server-side has but not the client-side) : Reconnect to conversation.
The typescript DirectLine SDK has the documented "reconnect" function which updates the new token and new websocket stream url.
The .Net C# NuGet client SDK does not have a reconnect function which accepts the new token and websocket stream url like the TypeScript SDK does. It only proposes to use the current expired token to create a new one itself. It makes it more difficult to implement bot client in C#.
Adding to the .Net client SDK the feature supported by the TypeScript SDK.
Ideally, open sourcing the client NuGet package too.
The .Net NuGet package Microsoft.Bot.Connector.DirectLine.
Not able to follow the documentation for expired tokens when creating .Net bot client which uses a token and does not embed the secret itself.
Dotnet SDK
[dcr]
What package version of the SDK are you using. Microsoft.Bot.Connector.DirectLine 3.0.2
I'm trying to send an Activity
with mentions to my Bot, but the mentions always show as empty on the receiving end. Here's a rough outline of the code I'm using:
// Code to set up DirectLine client and start a conversation.
var activity = new Activity
{
Type = "message",
From = new ChannelAccount { Id="123", Name="haacked" },
Text = "hello @haacked",
Entities = new List<Entity> {
new Entity
{
Type = "mention",
Properties =
JObject.Parse(@"{{""mentioned"": {{""id"": ""123:T123"", ""name"": ""haacked"" }} }}")
}
}
};
await client.Conversations.PostActivityWithHttpMessagesAsync(
conversation.ConversationId,
activity);
I can see that my bot does receive the message, but the Mentions
property is empty. 😦
Steps to reproduce the behavior:
Activity
containing Entities
to https://directline.botframework.com/
.The bot would receive an Activity
with a populated Mentions
property.
The bot receives the Activity
but the Mentions
property is empty.
[bug]
Problem:
Currently, the directline has a cache of the conversation history only for 24 hours. The conversationId which is used to reconnect to the conversation also gets obsolete after a few days/weeks, disabling the client to reconnect to the ongoing conversation.
Feature to overcome the problem:
There should be a feature that would let the client reconnect to a conversation exactly where they left off(This is possible for now but only for 24 hours), also after 24 hours or many weeks after leaving the conversation.
The samples use polling and an external library (websocket-sharp) but should also cover the Microsoft.Bot.Streaming.Transport.WebSockets.WebSocketClient the StreamingConversations APIs use.
An example is outlined here: https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-directline-extension-net-client?view=azure-bot-service-4.0
There are important files that Microsoft projects should all have that are not present in this repository. A pull request has been opened to add the missing file(s). When the pr is merged this issue will be closed automatically.
Microsoft teams can learn more about this effort and share feedback within the open source guidance available internally.
Microsoft.Bot.Connector.DirectLine 3.0.3-Preview1
I have created a new language services resource, a custom question answer library in it and then connected it to a bot.
see: https://techcommunity.microsoft.com/t5/ai-cognitive-services-blog/question-answering-feature-is-generally-available/ba-p/2899497
Then I enabled direct channel on the bot resource. grabbed the key and then plugged it in my existing solution. Note, the existing solution works fine if I connect to a bot (what microsoft now calls classic).
Steps to reproduce the behavior:
bot message should be received
[bug]
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
I'd like this to be a nuget package so I don't need to copy and paste the code and maintain my own version of it.
Describe alternatives you've considered
The alternative detailed in https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-directline-extension-net-client?view=azure-bot-service-4.0#create-a-c-direct-line-client has some friction. Can we make it easier for developers?
When we are trying to send a simple adaptive card it is getting displayed in the webchat and emulator but while using it in a client application(Mobile which uses directline .net client it is not getting displayed. Is there anything we have to specially do to handle it? The adaptive card is getting displayed in the emulator as well as in the webchat)
$ dotnet --list-sdks
3.1.420 [/usr/share/dotnet/sdk]
6.0.301 [/usr/share/dotnet/sdk]
I installed the recommended version of the dotnet sdk (dotnet-sdk-6.0) following instructions at https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu
then cloned this repo and did:
$ cd BotFramework-DirectLine-DotNet/samples/core-DirectLine/DirectLineClient
$ dotnet build DirectLineSampleClient.csproj
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Nothing to do. None of the projects specified contain packages to restore.
/usr/share/dotnet/sdk/6.0.301/Microsoft.Common.CurrentVersion.targets(1221,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/home/chrb/git/BotFramework-DirectLine-DotNet/samples/core-DirectLine/DirectLineClient/DirectLineSampleClient.csproj]
Build FAILED.
I can't see any way to install dotnet-sdk-4 in Ubuntu - the MS repos only have dotnet package versions 2.1, 3.1, 5.0, and 6.0:
$ apt-cache search dotnet-sdk
dotnet-sdk-2.1 - Microsoft .NET Core SDK 2.1.818
dotnet-sdk-3.1 - Microsoft .NET Core SDK 3.1.420
dotnet-sdk-5.0 - Microsoft .NET SDK 5.0.408
dotnet-sdk-6.0 - Microsoft .NET SDK 6.0.301
Steps to reproduce the behavior:
As above
Should compile ok with latest recommended SDK version
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
[bug]
add more info, docs links, nuget ref, usage, context
ref: https://github.com/microsoft/BotFramework-DirectLineJS
[enhancement]
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
[enhancement]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.