Share via


OllamaTextGenerationService Class

Definition

Represents a text generation service using Ollama Original API.

public sealed class OllamaTextGenerationService : Microsoft.SemanticKernel.Connectors.Ollama.Core.ServiceBase, Microsoft.SemanticKernel.TextGeneration.ITextGenerationService
type OllamaTextGenerationService = class
    inherit ServiceBase
    interface ITextGenerationService
    interface IAIService
Public NotInheritable Class OllamaTextGenerationService
Inherits ServiceBase
Implements ITextGenerationService
Inheritance
OllamaTextGenerationService
Implements

Constructors

OllamaTextGenerationService(OllamaApiClient, ILoggerFactory)

Initializes a new instance of the OllamaTextGenerationService class.

OllamaTextGenerationService(String, HttpClient, ILoggerFactory)

Initializes a new instance of the OllamaTextGenerationService class.

OllamaTextGenerationService(String, OllamaApiClient, ILoggerFactory)

Initializes a new instance of the OllamaTextGenerationService class.

OllamaTextGenerationService(String, Uri, ILoggerFactory)

Initializes a new instance of the OllamaTextGenerationService class.

Properties

Attributes

Gets the AI service attributes.

Methods

GetStreamingTextContentsAsync(String, PromptExecutionSettings, Kernel, CancellationToken)

Get streaming results for the prompt using the specified execution settings. Each modality may support for different types of streaming contents.

GetTextContentsAsync(String, PromptExecutionSettings, Kernel, CancellationToken)

Get completion results for the prompt and settings.

Extension Methods

GetApiVersion(IAIService)

Gets the API version from service's Attributes

GetEndpoint(IAIService)

Gets the endpoint from service's Attributes.

GetModelId(IAIService)

Gets the model identifier from service's Attributes.

GetTextContentAsync(ITextGenerationService, String, PromptExecutionSettings, Kernel, CancellationToken)

Get a single text generation result for the prompt and settings.

Applies to