Lensophy 1.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Lensophy --version 1.0.0
NuGet\Install-Package Lensophy -Version 1.0.0
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="Lensophy" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Lensophy --version 1.0.0
#r "nuget: Lensophy, 1.0.0"
#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 Lensophy as a Cake Addin
#addin nuget:?package=Lensophy&version=1.0.0

// Install Lensophy as a Cake Tool
#tool nuget:?package=Lensophy&version=1.0.0

Lensophy

Introduction

This API provides developers with the ability to enhance their comment systems (such as forums, blogs, or websites) by analyzing, filtering, and encouraging good behavior through suggested responses that guide towards a friendly perspective rather than censoring it.

An OpenAI account is required to use it

Getting Started

Installing the package with the last version.

dotnet add package Lensophy --version 1.0.0

In your appSettings.json, add the following configuration:

{
  "OpenAiConfig": {
    "Secret": "your OpenAi secret"
  }
}

In Program.cs, perform the following registration:

var builder = WebApplication.CreateBuilder(args);

...
//code hidden for brevity.

var secret = builder.Configuration.GetSection("openaiconfig:secret").Value;
builder.Services.AddLensophy(secret);

In the SampleController (or where you need it), inject the dependency:

[ApiController]
[Route("[controller]")]
public class SampleController : ControllerBase
{
    private readonly LensophyService _lensophyService;

    public SampleController(LensophyService lensophyService) => _lensophyService = lensophyService;
}

Call the AnalyseAsync routine at the desired place.

[HttpPost(Name = "Analyse")]
public async Task<ContentAnalysed> Analyse([FromBody]ContentAnalyse contentToAnalyse)
{
    var contentAnalysed = await _lensophyService.AnalyseAsync(contentToAnalyse).ConfigureAwait(false);
    return contentAnalysed;
}

Release notes

Every version governs a basic principle of change, although it may carry other minor improvements.

GitHub milestone details

  • Provides developers with the ability to enhance their comment systems (such as forums, blogs, or websites) by analyzing, filtering, and encouraging good behavior through suggested responses that guide towards a friendly perspective.

Examples

A suggestion for your message system.

How to use it

Contributing & Feedback

If you encounter a bug or have a feature request, please use the Issue Tracker or the Project Board. The project is also open to contributions, so feel free to fork the project and open pull requests. Contributions are highly appreciated! Please make sure it is covered by unit or integrations tests.

About the project

Remind people that, even physically distant from the interlocutor, respect must be maintained. Check the Lensowiki if you wanna read more about it.

License

Copyright © Raphael Moreira | MIT

Lensophy

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.0 143 10/13/2023

Provides a service for message analysis, returning a gentle suggestion if the content is offensive in any way.