Share via


OllamaTextGenerationService Constructors

Definition

Overloads

OllamaTextGenerationService(OllamaApiClient, ILoggerFactory)

Initializes a new instance of the OllamaTextGenerationService class.

public OllamaTextGenerationService(OllamaSharp.OllamaApiClient ollamaClient, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
new Microsoft.SemanticKernel.Connectors.Ollama.OllamaTextGenerationService : OllamaSharp.OllamaApiClient * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.SemanticKernel.Connectors.Ollama.OllamaTextGenerationService
Public Sub New (ollamaClient As OllamaApiClient, Optional loggerFactory As ILoggerFactory = Nothing)

Parameters

ollamaClient
OllamaSharp.OllamaApiClient

The Ollama API client.

loggerFactory
ILoggerFactory

Optional logger factory to be used for logging.

Applies to

OllamaTextGenerationService(String, OllamaApiClient, ILoggerFactory)

Initializes a new instance of the OllamaTextGenerationService class.

public OllamaTextGenerationService(string modelId, OllamaSharp.OllamaApiClient ollamaClient, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
new Microsoft.SemanticKernel.Connectors.Ollama.OllamaTextGenerationService : string * OllamaSharp.OllamaApiClient * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.SemanticKernel.Connectors.Ollama.OllamaTextGenerationService
Public Sub New (modelId As String, ollamaClient As OllamaApiClient, Optional loggerFactory As ILoggerFactory = Nothing)

Parameters

modelId
String

The hosted model.

ollamaClient
OllamaSharp.OllamaApiClient

The Ollama API client.

loggerFactory
ILoggerFactory

Optional logger factory to be used for logging.

Applies to

OllamaTextGenerationService(String, HttpClient, ILoggerFactory)

Initializes a new instance of the OllamaTextGenerationService class.

public OllamaTextGenerationService(string modelId, System.Net.Http.HttpClient httpClient, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
new Microsoft.SemanticKernel.Connectors.Ollama.OllamaTextGenerationService : string * System.Net.Http.HttpClient * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.SemanticKernel.Connectors.Ollama.OllamaTextGenerationService
Public Sub New (modelId As String, httpClient As HttpClient, Optional loggerFactory As ILoggerFactory = Nothing)

Parameters

modelId
String

The Ollama model for the text generation service.

httpClient
HttpClient

HTTP client to be used for communication with the Ollama API.

loggerFactory
ILoggerFactory

Optional logger factory to be used for logging.

Applies to

OllamaTextGenerationService(String, Uri, ILoggerFactory)

Initializes a new instance of the OllamaTextGenerationService class.

public OllamaTextGenerationService(string modelId, Uri endpoint, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
new Microsoft.SemanticKernel.Connectors.Ollama.OllamaTextGenerationService : string * Uri * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.SemanticKernel.Connectors.Ollama.OllamaTextGenerationService
Public Sub New (modelId As String, endpoint As Uri, Optional loggerFactory As ILoggerFactory = Nothing)

Parameters

modelId
String

The Ollama model for the text generation service.

endpoint
Uri

The endpoint including the port where Ollama server is hosted

loggerFactory
ILoggerFactory

Optional logger factory to be used for logging.

Applies to