Skip to main content
net8.0

A .NET Aspire client integration for the OllamaSharp library.

Published
Oct 23, 2024
2y ago
Total Downloads
506.1K
506,072

Install

dotnet add package CommunityToolkit.Aspire.OllamaSharp --version 8.2.1-beta.40
ProductVersions
.NET
net8.0

README

CommunityToolkit.Aspire.OllamaSharp library

Registers IOllamaClientApi in the DI container to interact with the Ollama API.

Getting Started

Prerequisites

  • Ollama HTTP(S) endpoint

Install the package

Install the .NET Aspire OllamaSharp library using the following command:

dotnet add package CommunityToolkit.Aspire.OllamaSharp

Example usage

In the Program.cs file of your project, call the AddOllamaClientApi extension method to register the IOllamaClientApi in the DI container. This method takes the connection name as a parameter:

builder.AddOllamaClientApi("ollama");

Then, in your service, inject IOllamaClientApi and use it to interact with the Ollama API:

public class MyService(IOllamaClientApi ollamaClientApi)
{
    // ...
}

Additional documentation

Feedback & contributing

https://github.com/CommunityToolkit/Aspire

Changes from Previous Version

v8.2.1-beta.39v8.2.1-beta.40
Added Frameworks
net8.0
Added Dependencies

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.