Eliassen.Ollama 0.1.85

This package has a SemVer 2.0.0 package version: 0.1.85+2.
dotnet add package Eliassen.Ollama --version 0.1.85                
NuGet\Install-Package Eliassen.Ollama -Version 0.1.85                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Eliassen.Ollama" Version="0.1.85" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Eliassen.Ollama --version 0.1.85                
#r "nuget: Eliassen.Ollama, 0.1.85"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Eliassen.Ollama as a Cake Addin
#addin nuget:?package=Eliassen.Ollama&version=0.1.85

// Install Eliassen.Ollama as a Cake Tool
#tool nuget:?package=Eliassen.Ollama&version=0.1.85                

Eliassen.Ollama

Eliassen.Ollama provides functionality for interacting with the Ollama API, including text embedding, message completion, and language model responses. Let's explore its features:

IOllamaApiClientFactory

Represents a factory for creating instances of the OllamaApiClient.

Methods

  • Build: Builds an instance of the OllamaApiClient for the specified host.

OllamaApiClientExtensions

Provides extension methods for the OllamaSharp.OllamaApiClient class.

Methods

  • EnsureModelExistsAsync(ollama, modelName, logger): Ensures that the specified model exists in the Ollama API client.
  • GetEmbeddingSingle(client, text, modelName): Retrieves the embedding for the specified text using the specified model synchronously.
  • GetEmbeddingSingleAsync(client, text, modelName): Retrieves the embedding for the specified text using the specified model asynchronously.
  • GetEmbeddingDouble(client, text, modelName): Retrieves the embedding for the specified text using the specified model synchronously.
  • GetEmbeddingDoubleAsync(client, text, modelName): Retrieves the embedding for the specified text using the specified model asynchronously.

OllamaApiClientFactory

Factory class for creating instances of the OllamaSharp.OllamaApiClient.

Methods

  • Constructor(options): Initializes a new instance of the Eliassen.Ollama.OllamaApiClientFactory class with the specified options.
  • Build: Builds a new instance of the OllamaSharp.OllamaApiClient with the specified host.

OllamaApiClientOptions

Represents the configuration options for the Ollama API client.

Properties

  • Url: Gets or initializes the URL of the Ollama API.
  • DefaultModel: Gets or initializes the default model to use with the Ollama API.

OllamaMessageCompletion

Responsible for generating message completions using the Ollama API.

Methods

  • Constructor(client): Initializes a new instance of the Eliassen.Ollama.OllamaMessageCompletion class.
  • GetCompletionAsync(modelName, prompt): Generates a completion for the given prompt using the specified model asynchronously.
  • GetResponseAsync(promptDetails, userInput): Retrieves a response from the language model based on the provided prompt details and user input asynchronously.
  • GetStreamedResponseAsync(promptDetails, userInput, cancellationToken): Gets a streamed response asynchronously based on the provided prompt details and user input.

ServiceCollectionExtensions

Provides extension methods for configuring services related to Ollama.

Methods

  • TryAddOllamaServices(services, configuration, ollamaApiClientOptionSection): Configures services for Ollama.

Eliassen.Ollama facilitates easy integration with the Ollama API, enabling various text-related tasks such as embedding, completion, and language model responses.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Eliassen.Ollama:

Package Downloads
Eliassen.Common.Extensions

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.85 41 10/10/2024
0.1.84 40 10/10/2024
0.1.83 43 9/27/2024
0.1.82 142 8/23/2024
0.1.81 115 8/1/2024
0.1.81-dev-gh-pipline.3 47 8/1/2024