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

Skill Updates First pass #2657

Merged
merged 79 commits into from
Oct 17, 2019
Merged

Skill Updates First pass #2657

merged 79 commits into from
Oct 17, 2019

Conversation

gabog
Copy link
Contributor

@gabog gabog commented Oct 4, 2019

Ref #2774
This PR contains some of the changes we are planning for Skills.

Creating it as a draft so we can start viewing the changes.

gabog and others added 18 commits October 1, 2019 12:35
TLDR; I have new version which
has no side storage for conversation reference
routes all traffic up through the bot, so the bot is in control of routing
Covers basic operations on Activity (send/update/delete)
Is less code and has no GDPR issues (other then bots internal conversationState logic to decide to route traffic to skill)

----

This has greatly simplified the amount of logic:
I don't use conversationReference context switching, instead the only change to payload is that I add a custom property to the Recipient and Conversation objects (both which allow for additional properties)
recipient.skillId = "id of the skill"
conversation.serviceUrl = "original serviceUrl for the conversation"
Since those properties are always reflected back,  I don't need to do context switching, but instead can create an appropriate conversationReference to bind to the adapter
I route all activities up through the bot and the bot is in control of calling appropriate adapter.XXX() APIS to pushes them back down to the user.
I turn DeleteActivity() => ActivityType.DeleteActivity.  The bot then turns that artifical delete activity into a call to botAdapter.DeleteActivity() call
I turn UpdateActivity() => ActivityType.UpdateActivity (with new activity in the Value payload), the bot then turns that artifical update activity into call to botAdapter.UpdateActivity()
As I suspected, the APIs that we are able to implement without the side-car is less due to not having enough information to plumb through
Fully Supported APIS
SendToConversation()/ReplyToActivity()
UpdateActivity()
DeleteActivity()
Not Supported APIS
CreateConversation() - Not sure if we want this
GetConversations() - not modeled by adapter, could support as pure connectClient call
SendConversationHistory() - only has conversationId as arg,
GetConversationMembers() - only has conversationId as arg
GetConversationPagedMembers() - only has conversationId as arg
DeleteConversationMember() - only has conversationId as arg
GetActivityMembers() - only has conversationId as arg
UploadAttachment() - only has conversationId as arg
For the conversationId APIs there are 2 approaches to support these:
If I have the original serviceUrl I can call straight through to the user using a connectorClient (bypassing the adapter)
If I have the original conversationReference I can route through the adapter up to the bot
-Tom
Removed experimental ConversationBridgeMiddleware and MultiAdapter.
Added placholder for BotToDialog
Removed InvokeActivity jiggerapoo
Simplified project references
Added cancelationTokens and cleaned up dead code.
@coveralls
Copy link
Collaborator

coveralls commented Oct 4, 2019

Excluded anotehr whitespace rule that didn't make a lot of sense.
Removed dependencies on old skills library.
Updated Adapter inherit from BF adapter rather than streaming.
…ver.

First pass at S2S auth.
Removed hardcoded URLs from SDK.
Moved skill definition to the schema library.
Removed Microsoft.Bot.Builder.Skills from the library.
@gabog gabog self-assigned this Oct 7, 2019
Tom Laird-McConnell and others added 3 commits October 7, 2019 16:12
…to allow passing a custom resouce (known issue, skill throws an exception on "stop"), will fix that later.

Removed projects that don't compile yet
Fixed some warnings and corrected some code.
…placed the code with the SDK primitives (we'll use dialog manager eventually).
Fixed some code based on steves comments.
More code cleanup and fixes.
/// <param name="activity">activity to forward.</param>
/// <param name="cancellationToken">cancellation Token.</param>
/// <returns>Async task with optional invokeResponse.</returns>
public override async Task<InvokeResponse> ForwardActivityAsync(ITurnContext turnContext, string skillId, Activity activity, CancellationToken cancellationToken)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add a telemetry logging to log the latency for a skill call

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K, thanks, I'll do this in another push.

gabog and others added 13 commits October 16, 2019 14:37
…is no good but will get updated when carlos is done)
Moved HttpSkillServer to the skills package.
* Renamed SkillAdapter to SkillHostAdapter
* Reverted change to BotAdapter.cs methods
* Additional APIs only work if bot adapter is BotFrameworkAdapter
* Changed SkillsCallbackEndpoint to SkillHostEndpoint to match rest of naming convention
* Added Exception return so we can throw appropriately on not implemented.
…d left it as notsupported in the host for now.

Added additional constructors to BotFrameworkSkillHostAdapter
Updated names and documentation in some Auth classes as discussed with carlos.
Downgraded test project to 2.1
Applied changes fot enginetests from master
@gabog gabog changed the title [Draft] Skill Updates First pass Skill Updates First pass Oct 17, 2019
@gabog gabog removed the WIP label Oct 17, 2019
@fuselabs
Copy link
Collaborator

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.5.3
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.Luis.dll compared against version 4.5.3
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.QnA.dll compared against version 4.5.3
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.ApplicationInsights.dll compared against version 4.5.3
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Azure.dll compared against version 4.5.3
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll compared against version 4.5.3
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.TemplateManager.dll compared against version 4.5.3
✔️ No Binary Compatibility issues for Microsoft.Bot.Configuration.dll compared against version 4.5.3
✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll compared against version 4.5.3
✔️ No Binary Compatibility issues for Microsoft.Bot.Schema.dll compared against version 4.5.3

@gabog gabog marked this pull request as ready for review October 17, 2019 16:19
throw new ArgumentNullException(nameof(ServiceUrl));
}

return Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(new[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please file an issue to track this, as I believe this string is too large for our Blob and CosmosDB Storage providers. We've hit a similar bug w/ Teams in the past.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created Github issue 2736 to track.

@cleemullins cleemullins merged commit 2495b69 into master Oct 17, 2019
@gabog gabog deleted the gabog/SkillFirstPass branch October 17, 2019 16:41
@gabog gabog added the Skills label Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants