GithubHelp home page GithubHelp logo

intento / intento-csharp Goto Github PK

View Code? Open in Web Editor NEW
7.0 28.0 2.0 6.56 MB

A С# adapter to query Intento API – a single API to Cognitive AI services from many vendors

Home Page: https://inten.to

C# 99.89% Batchfile 0.11%
ai translation translation-intent csharp-sdk cognitive-services cognitive-toolkit

intento-csharp's Introduction

Intento C# SDK

An adapter to query Intento API. Intento provides a single API to Cognitive AI services from many vendors. To get more information, check out the site.

API User Manual

If you don't have a key to use Intento API, please register here console.inten.to

Build

dotnet build SDK.build.proj /p:Configuration=%Configuration% /p:DoSign=%DoSign% /p:Version=%Version% /fileLogger

Sign

To sign package you need to install Intento certificate with CertificateFingerprint=d79d7faf87aa9eecc1437e7da38e81f8a547dc38

Tests

To run test set environment variable "IntentoAPIKey". Api key you can relieve from console.inten.to

Init intento client

var options = new Options
{
  ApiKey = "ApiKey",
  ClientUserAgent = $"Intento.SDK.Test/{assemblyVersion}"
};
IntentoClient.Init(options);

Init logger

You should specify ILoggerFactory instance in container to work with SDK. If you use Intento.SDK container you should create IContainerRegisterExtension implementation.

[RegisterExtension]
internal class LoggerRegisterExtension: IContainerRegisterExtension
{
     public void Register(IServiceCollection services)
     {
         services.AddSingleton<ILoggerFactory, NullLoggerFactory>();
     }
}

DI

By default, Intento SDK creates its own container for services. By the way, you can create your own container in the app and pass servicesCollection to Init function.

IntentoClient.Init(options, serviceCollection);

If you don't have your own container, you can register your own services in the container of Intento SDK (For example you want to use the injection of services)

[RegisterExtension]
internal sealed class ServicesRegisterExtension: IContainerRegisterExtension
{
  /// <inheritdoc />
  public void Register(IServiceCollection services)
  {
    services.AddSingleton<ITranslateService, TranslateDynamicService>();
  }
}

Use intento API

You can inject ITranslateService from the container (if you use your own container) or get it from Locator.

var service = Locator.Resolve<ITranslateService>();
var res = await service.AgnosticGlossariesAsync();

intento-csharp's People

Contributors

antonchi avatar dmitry-tveryanovich avatar greenmachine52 avatar oerodger avatar tyanas avatar vlabramov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.