https://github.com/intento/intento-csharp
A С# adapter to query Intento API – a single API to Cognitive AI services from many vendors
https://github.com/intento/intento-csharp
ai cognitive-services cognitive-toolkit csharp-sdk translation translation-intent
Last synced: 3 months ago
JSON representation
A С# adapter to query Intento API – a single API to Cognitive AI services from many vendors
- Host: GitHub
- URL: https://github.com/intento/intento-csharp
- Owner: intento
- Created: 2018-06-22T19:55:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T11:08:14.000Z (almost 2 years ago)
- Last Synced: 2025-09-23T21:43:19.492Z (7 months ago)
- Topics: ai, cognitive-services, cognitive-toolkit, csharp-sdk, translation, translation-intent
- Language: C#
- Homepage: https://inten.to
- Size: 6.39 MB
- Stars: 8
- Watchers: 26
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://inten.to/).
[API User Manual](https://github.com/intento/intento-api)
If you don't have a key to use Intento API, please register here [console.inten.to](https://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](https://console.inten.to)
# Init intento client
```csharp
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.
```csharp
[RegisterExtension]
internal class LoggerRegisterExtension: IContainerRegisterExtension
{
public void Register(IServiceCollection services)
{
services.AddSingleton();
}
}
```
# 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.
```csharp
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)
```csharp
[RegisterExtension]
internal sealed class ServicesRegisterExtension: IContainerRegisterExtension
{
///
public void Register(IServiceCollection services)
{
services.AddSingleton();
}
}
```
# Use intento API
You can inject ITranslateService from the container (if you use your own container) or get it from Locator.
```csharp
var service = Locator.Resolve();
var res = await service.AgnosticGlossariesAsync();
```