Table of Contents

Connectors

AI Toolbox supports available Semantic Kernel connectors. To add connectors to the AI Toolbox use the AddConnectors() method. This method is required. After adding the respective connector NuGet package you can include the connector.

Configuration

The AddConnectors() method provides a convenient way to configure the connector connection settings globally.

Tip

For connectors configuration options please check the AIToolbox.Options.Connectors namespace reference.

services
    .AddAIToolbox()
    .AddConnectors(options => options.Ollama = new OllamaConnectorOptions { })
    .IncludeOllamaConnector();
services
    .AddAIToolbox()
    .AddConnectors()
    .IncludeOllamaConnector(options => ...);

With global configuration

By providing the connector configuration globally AI Toolbox takes care of configuring the AI provider services automatically.

services
    .AddAIToolbox()
    .AddConnectors()
    .IncludeOllamaConnector(options => options.Endpoint = "http://localhost:11434")
    .AddKernel(options =>
    {
        options.Ollama = new OllamaOptions
        {
            ChatCompletion = new OllamaChatCompletionOptions { ModelId = "llama3" },
            TextEmbeddingGeneration = new OllamaTextEmbeddingGenerationOptions { ModelId = "llama3" },
            TextGeneration = new OllamaTextGenerationOptions { ModelId = "llama3" }
        };
    })

Without global configuration

If you don't provide the connector configuration globally you must configure the AI provider services accordingly.

services
    .AddAIToolbox()
    .AddConnectors()
    .IncludeOllamaConnector()
    .AddKernel(options =>
    {
        options.Ollama = new OllamaOptions
        {
            ChatCompletion = new OllamaChatCompletionOptions
            {
                Endpoint = "http://localhost:11434",
                ModelId = "llama3"
            },
            TextEmbeddingGeneration = new OllamaTextEmbeddingGenerationOptions
            {
                Endpoint = "http://localhost:11434",
                ModelId = "llama3"
            },
            TextGeneration = new OllamaTextGenerationOptions
            {
                Endpoint = "http://localhost:11434",
                ModelId = "llama3"
            }
        };
    })

Packages

AI Toolbox provides following NuGet packages for the Semantic Kernel connectors.