Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6bba38d
orchestrator docs pointers
Oct 26, 2020
1bba8a8
update orchestrator readme
Oct 27, 2020
546ca78
left NLR readme shell to be filled in
Oct 27, 2020
5125da6
bf orchestrator cli usage
Oct 27, 2020
2551ea5
fixed TBD
Oct 30, 2020
4ba7d34
merge from main
Nov 16, 2020
8190989
fix merge
Nov 16, 2020
563e9f6
added examples
Nov 16, 2020
2573172
more orchestrator docs
Nov 16, 2020
5561636
rm white space
Nov 16, 2020
85523c0
CR comments
Nov 17, 2020
1c661fe
one more CR item
Nov 17, 2020
7e79cb1
one more
Nov 17, 2020
4e267d6
Merge remote-tracking branch 'origin/main' into scheyal/sdk
Nov 17, 2020
cf15d80
moved perf table to nlrmodels
Nov 17, 2020
40ec92f
Merge remote-tracking branch 'origin/main' into scheyal/sdk
Nov 23, 2020
9c66322
added license term to models in docs
Nov 23, 2020
95207cc
reference to license for models
Nov 23, 2020
c025e41
updated api ref
Nov 30, 2020
2a5f759
with ptr to composer preview doc
Feb 4, 2021
817ad90
fixed link...
Feb 4, 2021
c984177
fixed link...
Feb 4, 2021
d84a554
sync from main
Feb 11, 2021
e2ea690
added tech references
Feb 11, 2021
487193c
re-added ref to composer steps
Feb 11, 2021
7e499bc
doc: LU processing in Orchestrator
Mar 8, 2021
9e129fe
Orchestrator intro pptx
Mar 18, 2021
15f5afa
updates to orchestrator readme
Mar 18, 2021
a843970
resolve conflict - revert to main
Apr 21, 2021
bb1a770
revert to main
Apr 21, 2021
244b208
Merge branch 'main' into scheyal/sdk
Apr 21, 2021
a476362
OrchestratorDispatch sample
Apr 24, 2021
d0425ec
fix condition
Apr 26, 2021
d57aa87
fix condition 2
Apr 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Orchestrator/Samples/Composer/OrchestratorDispatch/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# prevent appsettings.json get checked in
**/appsettings.json
27 changes: 27 additions & 0 deletions Orchestrator/Samples/Composer/OrchestratorDispatch/BotReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Welcome to your new bot

This Bot Project was created using the Empty Bot template, and contains a minimal set of files necessary to have a working bot.

## Next steps

### Start building your bot

Composer can help guide you through getting started building your bot. From your bot settings page (the wrench icon on the left navigation rail), click on the rocket-ship icon on the top right for some quick navigation links.

Another great resource if you're just getting started is the **[guided tutorial](https://docs.microsoft.com/en-us/composer/tutorial/tutorial-introduction)** in our documentation.

### Connect with your users

Your bot comes pre-configured to connect to our Web Chat and DirectLine channels, but there are many more places you can connect your bot to - including Microsoft Teams, Telephony, DirectLine Speech, Slack, Facebook, Outlook and more. Check out all of the places you can connect to on the bot settings page.

### Publish your bot to Azure from Composer

Composer can help you provision the Azure resources necessary for your bot, and publish your bot to them. To get started, create a publishing profile from your bot settings page in Composer (the wrench icon on the left navigation rail). Make sure you only provision the optional Azure resources you need!

### Extend your bot with packages

From Package Manager in Composer you can find useful packages to help add additional pre-built functionality you can add to your bot - everything from simple dialogs & custom actions for working with specific scenarios to custom adapters for connecting your bot to users on clients like Facebook or Slack.

### Extend your bot with code

You can also extend your bot with code - simply open up the folder that was generated for you in the location you chose during the creation process with your favorite IDE (like Visual Studio). You can do things like create custom actions that can be used during dialog flows, create custom middleware to pre-process (or post-process) messages, and more. See [our documentation](https://aka.ms/bf-extend-with-code) for more information.
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Settings;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace OrchestratorDispatch.Controllers
{
// This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot
// implementation at runtime. Multiple different IBot implementations running at different endpoints can be
// achieved by specifying a more specific type for the bot constructor argument.
[ApiController]
public class BotController : ControllerBase
{
private readonly Dictionary<string, IBotFrameworkHttpAdapter> _adapters = new Dictionary<string, IBotFrameworkHttpAdapter>();
private readonly IBot _bot;
private readonly ILogger<BotController> _logger;

public BotController(
IConfiguration configuration,
IEnumerable<IBotFrameworkHttpAdapter> adapters,
IBot bot,
ILogger<BotController> logger)
{
_bot = bot ?? throw new ArgumentNullException(nameof(bot));
_logger = logger;

var adapterSettings = configuration.GetSection(AdapterSettings.AdapterSettingsKey).Get<List<AdapterSettings>>() ?? new List<AdapterSettings>();
adapterSettings.Add(AdapterSettings.CoreBotAdapterSettings);

foreach (var adapter in adapters ?? throw new ArgumentNullException(nameof(adapters)))
{
var settings = adapterSettings.FirstOrDefault(s => s.Enabled && s.Type == adapter.GetType().FullName);

if (settings != null)
{
_adapters.Add(settings.Route, adapter);
}
}
}

[HttpPost]
[HttpGet]
[Route("api/{route}")]
public async Task PostAsync(string route)
{
if (string.IsNullOrEmpty(route))
{
_logger.LogError($"PostAsync: No route provided.");
throw new ArgumentNullException(nameof(route));
}

if (_adapters.TryGetValue(route, out IBotFrameworkHttpAdapter adapter))
{
if (_logger.IsEnabled(LogLevel.Debug))
{
_logger.LogInformation($"PostAsync: routed '{route}' to {adapter.GetType().Name}");
}

// Delegate the processing of the HTTP POST to the appropriate adapter.
// The adapter will invoke the bot.
await adapter.ProcessAsync(Request, Response, _bot).ConfigureAwait(false);
}
else
{
_logger.LogError($"PostAsync: No adapter registered and enabled for route {route}.");
throw new KeyNotFoundException($"No adapter registered and enabled for route {route}.");
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Schema;
using Microsoft.Extensions.Logging;

namespace OrchestratorDispatch.Controllers
{
/// <summary>
/// A controller that handles skill replies to the bot.
/// </summary>
[ApiController]
[Route("api/skills")]
public class SkillController : ChannelServiceController
{
private readonly ILogger<SkillController> _logger;

public SkillController(ChannelServiceHandlerBase handler, ILogger<SkillController> logger)
: base(handler)
{
_logger = logger;
}

public override Task<IActionResult> ReplyToActivityAsync(string conversationId, string activityId, Activity activity)
{
try
{
if (_logger.IsEnabled(LogLevel.Debug))
{
_logger.LogDebug($"ReplyToActivityAsync: conversationId={conversationId}, activityId={activityId}");
}

return base.ReplyToActivityAsync(conversationId, activityId, activity);
}
catch (Exception ex)
{
_logger.LogError(ex, $"ReplyToActivityAsync: {ex}");
throw;
}
}

public override Task<IActionResult> SendToConversationAsync(string conversationId, Activity activity)
{
try
{
if (_logger.IsEnabled(LogLevel.Debug))
{
_logger.LogDebug($"SendToConversationAsync: conversationId={conversationId}");
}

return base.SendToConversationAsync(conversationId, activity);
}
catch (Exception ex)
{
_logger.LogError(ex, $"SendToConversationAsync: {ex}");
throw;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="BotBuilder.myget.org" value="https://botbuilder.myget.org/F/botbuilder-v4-dotnet-daily/api/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/BotFramework-Composer/main/Composer/packages/server/schemas/botproject.schema",
"name": "OrchestratorDispatch",
"skills": {
"theSkill": {
"manifest": "https://theskill.azurewebsites.net/manifests/TheSkill-2-1-manifest.json",
"remote": true,
"endpointName": "Prod"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
<UserSecretsId>f24230a7-de92-41e1-a10c-5c5f4b350bb4</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<Content Include="**/*.blu;**/*.dialog;**/*.lg;**/*.lu;**/*.onnx;**/*.qna;**/*.txt" Exclude="$(BaseOutputPath)/**;$(BaseIntermediateOutputPath)/**;wwwroot/**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.8" />
<PackageReference Include="Microsoft.Bot.Builder.AI.Orchestrator" Version="4.14.0-daily.preview.20210414.235020.dcacf50" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime" Version="4.13.0" />
</ItemGroup>
</Project>
Loading