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.0-beta.33
| Product | Versions |
|---|---|
| .NET |
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
- https://github.com/awaescher/OllamaSharp
- https://learn.microsoft.com/dotnet/aspire/community-toolkit/hosting-ollama
Feedback & contributing
Changes from Previous Version
v8.2.0-beta.32v8.2.0-beta.33
Added Frameworks
net8.0
Added Dependencies
Aspire.Hosting(net8.0)
OllamaSharp(net8.0)
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.