Custom Function for Bot composer #9086
Replies: 3 comments 3 replies
-
Yes, google bot framework composer custom function example |
Beta Was this translation helpful? Give feedback.
-
Here is the link: https://learn.microsoft.com/en-us/composer/how-to-create-custom-actions Closing this. Feel free to reopen |
Beta Was this translation helpful? Give feedback.
-
In your using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Extensions;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using AdaptiveExpressions; // Add this
namespace Empty
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers().AddNewtonsoftJson(options =>
{
options.SerializerSettings.MaxDepth = HttpHelper.BotMessageSerializerSettings.MaxDepth;
});
services.AddBotRuntime(Configuration);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
Expression.Functions.Add("myCustomFunction", (args) =>
{
return "customFunctionReturnValue";
});
.
.
. Then in your {
"customFunctions": [
"*myCustomFunction*"
],
.
.
. Then use it in your
|
Beta Was this translation helpful? Give feedback.
-
Is there a way to create a custom function for bot in cases where we could n't use prebuilt functions?
Beta Was this translation helpful? Give feedback.
All reactions