SmoothLingua 1.0.6

dotnet add package SmoothLingua --version 1.0.6
NuGet\Install-Package SmoothLingua -Version 1.0.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SmoothLingua" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SmoothLingua --version 1.0.6
#r "nuget: SmoothLingua, 1.0.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SmoothLingua as a Cake Addin
#addin nuget:?package=SmoothLingua&version=1.0.6

// Install SmoothLingua as a Cake Tool
#tool nuget:?package=SmoothLingua&version=1.0.6

SmoothLingua

SmoothLingua is an open-source conversational AI platform that empowers you to create and deploy intelligent conversational agents. It offers a versatile and customizable framework for building smart chatbots capable of comprehending and responding to user input.

Features

  • Intent Recognition: Train your model to recognize user intents, such as greetings, farewells, inquiries, and more.

  • Story Management: Define conversation flows using stories, specifying sequences of intents and corresponding bot responses.

  • Rule-Based Responses: Create rules to handle specific scenarios and ensure precise responses.

  • Trainer Module: Train your conversational agent with ease using the built-in trainer module.

  • Extensibility: Extend SmoothLingua to integrate with your existing systems and services.

Build status

build and test

Quick Start

Installation

Install SmoothLingua via NuGet Package Manager Console:

Install-Package SmoothLingua

Example

using SmoothLingua;
using SmoothLingua.Abstractions;
using SmoothLingua.Abstractions.Stories;

MemoryStream memoryStream = new MemoryStream();

Trainer trainer = new Trainer();

trainer.Train(new Domain(
    new List<SmoothLingua.Abstractions.NLU.Intent>()
    {
        new SmoothLingua.Abstractions.NLU.Intent("Greeting",
        new List<string>(){ "Hello", "Hi" }),
        new SmoothLingua.Abstractions.NLU.Intent("Good",
        new List<string>(){ "I am fine", "I am good, thank you" }),
        new SmoothLingua.Abstractions.NLU.Intent("Bad",
        new List<string>(){ "I am feeling bad", "I am not good" }),
        new SmoothLingua.Abstractions.NLU.Intent("Bye",
        new List<string>(){ "Good bye", "Bye" })
    },
    new List<Story>()
    {
        new Story("Good", new List<SmoothLingua.Abstractions.Stories.Step>()
        {
            new IntentStep("Greeting"),
            new ResponseStep("Hello from bot!"),
            new IntentStep("Good"),
            new ResponseStep("I am glad to hear that!")
        }),
        new Story("Bad", new List<SmoothLingua.Abstractions.Stories.Step>()
        {
            new IntentStep("Greeting"),
            new ResponseStep("Hello from bot!"),
            new IntentStep("Bad"),
            new ResponseStep("I am sorry to hear that!")
        })
    },
    new List<SmoothLingua.Abstractions.Rules.Rule>()
    {
        new SmoothLingua.Abstractions.Rules.Rule("Bye","Bye","Bye")
    }
    ), memoryStream).Wait();

var conversationId = Guid.NewGuid().ToString();
var agent = await AgentLoader.Load(new MemoryStream(memoryStream.GetBuffer()));

var response = agent.Handle(conversationId, "bye");
Console.WriteLine($"Intent:{response.IntentName}");

foreach (var text in response.Messages)
{
    Console.WriteLine($"Response:{text}");
}

response = agent.Handle(conversationId, "hello");
Console.WriteLine($"Intent:{response.IntentName}");

foreach (var text in response.Messages)
{
    Console.WriteLine($"Response:{text}");
}

response = agent.Handle(conversationId, "I am fine");
Console.WriteLine($"Intent:{response.IntentName}");

foreach (var text in response.Messages)
{
    Console.WriteLine($"Response:{text}");
}

response = agent.Handle(conversationId, "hello");
Console.WriteLine($"Intent:{response.IntentName}");

foreach (var text in response.Messages)
{
    Console.WriteLine($"Response:{text}");
}

response = agent.Handle(conversationId, "I am bad");
Console.WriteLine($"Intent:{response.IntentName}");

foreach (var text in response.Messages)
{
    Console.WriteLine($"Response:{text}");
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.6 84 3/16/2024
1.0.5 90 3/9/2024
1.0.4 92 2/18/2024
1.0.3 106 1/13/2024
1.0.2-alpha 84 1/4/2024
1.0.1-alpha 67 1/3/2024
1.0.0-alpha 82 12/31/2023