Skip to content

Commit

Permalink
Doc updates for Google Adapter (#249)
Browse files Browse the repository at this point in the history
* - Initial Alexa adapter refactor to adopt Alexa.Net
- Moved towards deprecating the AlexaHttpAdapter (kept for backwards compat)

* - Updated Directory Build Props to include StyleCop package
- Enable warnings as errors for Alexa project

* - Added attachment types for directives / cards etc.
- Updated content extension methods to use Alexa.NET and attachments model
- Updated some core adapter logic

* - Added support for Directives
- Updated logic to use attachments as opposed to TurnState
- Further adapter logic updates

* Update GitVersion tag for feature branches

* - Moved method for stylecop

* Update GitVersion to attempt to ensure package names are incremented correctly on each build.

* Updated package dependencies for Alexa adapter

* Updated Alexa Sample

* Update readme for preview package

* Amended middleware and adaper for skills support

* Updates following PR feedback

* Removed ContinueConversationAsync overload  not available until SDK 4.7. Will be re-added later for skills support.

* Add LaunchRequest -> ConversationUpdate logic to middleware as per @pavolum's idea.

* Added message activity concat and suggested actions conversion to google adapter

* Adding configurable flag which will inform the adapter if it should concat multiple text activities in one turn

* minor clean up

* removing google adapter changes, renaming functions, removing suggested action conversion

* Remove unused option

* - Some naming tweaks
- Added policy for handling multiple outgoing activities.
- Added ContinueConversationAsync method

* Move multiple activity policy enum out of options class

* Naming tweak for outgoing activity policy

* First iteration on Google refactor

* Refactor of Google Adapter

* Update samples for Alexa / Google

* Update Google Adapter Sample

* Update Google adapter to send conversation update activity when user initiates conversation without intent.

* Updated readme and sample to use latest preview

* Fix image links in readme.

* Another attempt to fix images

* Further image link fix

* Update README.md

* Update README.md

* Update README.md

* Image extension case fix

* Update README.md

* Updated response content type

* Update Startup.cs

* Update docs and add automatic end of session when no outgoing activities are sent

* Readme update

* Change default concat policy. Update readme.

* Changes following code review (#195)

* Move the activities list to within the turn context

* Update adapter to make activity processing method virtual and remove multiple activity policy. Improved concat logic.

* Update Google adapter with latest changes to mirror the Alexa adapter

* Fix speak concat bug

* Fix speak concat issue

* Add first Alexa tests

* Update README.md

* Update README.md

* Update Bot Builder NuGet references

* Updates to Alexa Adapter to pull out core package with request / activity transform logic, attachment types and context extension methods.

* Fix failing test

* Updates to move middleware into adapter. Rename helper to AlexaRequestMapper

* Further refinements of mapper

* Update AlexaRequestMapperOptions.cs

* Updates to mapper / options

* Add Alexa Auth Handler. (#204)

* Rename some methods on Alexa Mapper. Update NuGet packages to 4.8.

* Rename auth handler class name

* Removing old Alexa auth handler

* Fix test project dependencies

* Update Alexa Core project file

* Amend pipeline to try and resolve dotnet pack issue

* Remvoed and re-added Alexa projects to SLN

* Attempt to address issue with GitVersion env vars no longer shared across pipeline tasks

* Update pipeline

* Update Auth Handler (#205)

* Add Alexa Auth Handler.

* Fix crazyness in merge.

* again.

* Add Alexa Skill Id validation check.

* Tabs to spaces

* Add a couple tests.

* Separate skill id check.

* Set ExpectReplies and add more tests.

* Dont NRE when activities is null.

* Fix bug with not handling built in StopIntent

* Add virtual to auth methods (#209)

* Add Alexa Auth Handler.

* Fix crazyness in merge.

* again.

* Add Alexa Skill Id validation check.

* Tabs to spaces

* Add a couple tests.

* Separate skill id check.

* Set ExpectReplies and add more tests.

* Dont NRE when activities is null.

* Make methods virutal for mocking

* Add check for Request being null so we don't throw NRE on bad requests from Alexa.

Co-authored-by: Gary Pretty <gary@garypretty.co.uk>

* Add fallback support for Alexa request types => EventActivity

* Add a simple markdown to plain text converter (#210)

* Add Alexa Auth Handler.

* Fix crazyness in merge.

* again.

* Add Alexa Skill Id validation check.

* Tabs to spaces

* Add a couple tests.

* Separate skill id check.

* Set ExpectReplies and add more tests.

* Dont NRE when activities is null.

* Make methods virutal for mocking

* Add check for Request being null so we don't throw NRE on bad requests from Alexa.

* Add simple markdown formatter

Co-authored-by: Gary Pretty <gary@garypretty.co.uk>

* Update attachment implementation (#213)

* Update attachment implementation to align with BF SDK and work correctly with ABS.

* Added tests for new attachment implementation

* Moved text normalization logic earlier and amended markdown handling (#212)

* Moved logic for text normalization earlier in the pipeline into the MergeActivities method.

* Modified markdown renderer to use period instead of new line. Amended list rendering. Added tests. Changed default to markdown.

* Convert Alexa attachment types to their strong type if needed. (#214)

* Update utility naming to helpers (aligns with SDK / other adapters). (#216)

* Merge attachments in activities so they are available in the last message (#217)

* Merge attachments in activities so they are available in the last message.

* Fix attachments.

* Fix for attachment null property handling

* Update attachment tests

* Remove test for missing attachment properties. Attachments / directives have optional properties, so not all properties will always be present.

* Fix tests failing with equality of ref types

* Project file with additional NuGet dependency

Co-authored-by: Gary Pretty <gary@garypretty.co.uk>

* Updated the media files (#218)

As Action SDK has been changed to Assistant SDK therefore I have updated them

* Fixed typo & added .json to package file (#219)

* Update Alexa sample to use latest preview package. Fix assembly name causing Azure deployment issue. Updated sample attachment config.

* WIP on Google sync with current Alexa approach

* Sync google with current alexa approach WIP

* Further project factoring

* Further refactoring. Split out conversations / dialogflow into separate request mappers.

* Update to Google adapter WIP - addressing anonymous user id and removing attachment processing temporarily.

* WIP

* Significant updates to include Google specific attachment types for system intents and cards

* Refactor RequestToActivity and add card / intent factories

* Align DialogFlow mapper with Conversation Webhook - derive both from new abstract base class.

* Implemented feedback following review

* Updated Google Adapter Readme.

Co-authored-by: Patrick Volum <pavolum@microsoft.com>
Co-authored-by: Nick Ericson <nick.ericson@hotmail.com>
Co-authored-by: Arafat Tehsin <arafattehsin@hotmail.com>
  • Loading branch information
4 people authored May 15, 2020
1 parent 5b9cccd commit 69b5613
Show file tree
Hide file tree
Showing 13 changed files with 603 additions and 502 deletions.
796 changes: 398 additions & 398 deletions Bot.Builder.Community.sln

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public Activity RequestToActivity(DialogFlowRequest request)
var actionIntent = payload.Inputs.FirstOrDefault(i => i.Intent.ToLowerInvariant().StartsWith("actions.intent"))?.Intent;
var queryText = StripInvocation(payload.Inputs[0]?.RawInputs[0]?.Query, Options.ActionInvocationName);

if (request.QueryResult.Intent.IsFallback)
if (request.QueryResult.Intent.IsFallback || request.QueryResult.Intent.DisplayName.ToLowerInvariant() == "launch")
{
if (string.IsNullOrEmpty(queryText))
if (string.IsNullOrEmpty(queryText) || request.QueryResult.Intent.DisplayName.ToLowerInvariant() == "launch")
{
activity.Type = ActivityTypes.ConversationUpdate;
activity.MembersAdded = new List<ChannelAccount>() { new ChannelAccount() { Id = activity.From.Id } };
Expand Down
301 changes: 201 additions & 100 deletions libraries/Bot.Builder.Community.Adapters.Google/README.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions samples/Google Adapter Sample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public void ConfigureServices(IServiceCollection services)
{
return new GoogleAdapterOptions()
{
ActionInvocationName = "dialogflow adapter",
ActionInvocationName = "my awesome action",
//ActionProjectId = "YOUR-GOOGLE-ACTION-ID",
ShouldEndSessionByDefault = false,
ValidateIncomingRequests = false,
WebhookType = GoogleWebhookType.DialogFlow
WebhookType = GoogleWebhookType.Conversation
};
});

Expand Down

0 comments on commit 69b5613

Please sign in to comment.