Linguagem

OllamaChatCompletionService Class

Definition

Caution

Dedicated OllamaService is deprecated. Use OllamaApiClient.AsChatCompletionService() instead.

Represents a chat completion service using Ollama Original API.

[System.Obsolete("Dedicated OllamaService is deprecated. Use OllamaApiClient.AsChatCompletionService() instead.")]
public sealed class OllamaChatCompletionService : Microsoft.SemanticKernel.Connectors.Ollama.Core.ServiceBase, Microsoft.SemanticKernel.ChatCompletion.IChatCompletionService
[<System.Obsolete("Dedicated OllamaService is deprecated. Use OllamaApiClient.AsChatCompletionService() instead.")>]
type OllamaChatCompletionService = class
    inherit ServiceBase
    interface IChatCompletionService
    interface IAIService
Public NotInheritable Class OllamaChatCompletionService
Inherits ServiceBase
Implements IChatCompletionService
Inheritance
OllamaChatCompletionService
Attributes
Implements

Constructors

Name Description
OllamaChatCompletionService(String, HttpClient, ILoggerFactory)

Initializes a new instance of the OllamaChatCompletionService class.

OllamaChatCompletionService(String, Uri, ILoggerFactory)

Initializes a new instance of the OllamaChatCompletionService class.

Properties

Name Description
Attributes

Gets the AI service attributes.

Methods

Name Description
GetChatMessageContentsAsync(ChatHistory, PromptExecutionSettings, Kernel, CancellationToken)

Get chat multiple chat content choices for the prompt and settings.

GetStreamingChatMessageContentsAsync(ChatHistory, PromptExecutionSettings, Kernel, CancellationToken)

Get streaming chat contents for the chat history provided using the specified settings.

Extension Methods

Name Description
AsChatClient(IChatCompletionService)

Creates an IChatClient for the specified IChatCompletionService.

GetApiVersion(IAIService)

Gets the API version from service's Attributes

GetChatMessageContentAsync(IChatCompletionService, ChatHistory, PromptExecutionSettings, Kernel, CancellationToken)

Get a single chat message content for the chat history and settings provided.

GetChatMessageContentAsync(IChatCompletionService, String, PromptExecutionSettings, Kernel, CancellationToken)

Get a single chat message content for the prompt and settings.

GetChatMessageContentsAsync(IChatCompletionService, String, PromptExecutionSettings, Kernel, CancellationToken)

Get chat multiple chat message content choices for the prompt and settings.

GetEndpoint(IAIService)

Gets the endpoint from service's Attributes.

GetModelId(IAIService)

Gets the model identifier from service's Attributes.

GetStreamingChatMessageContentsAsync(IChatCompletionService, String, PromptExecutionSettings, Kernel, CancellationToken)

Get streaming chat message contents for the chat history provided using the specified settings.

Applies to