LogoLogo
HomeNewsSupportVideos
  • Welcome
  • Wisej.NET
  • Concepts
    • Getting Started
    • General Concepts
    • Architecture
    • Extensibility
    • AI Providers
    • Vector Databases
    • Usage Metrics
    • Logging & Error Handling
  • Markup
  • Components
    • API
      • SmartAdapter
        • SmartAudioTTSAdapter
        • SmartAudioWhisperAdapter
        • SmartCalendarAdapter
        • SmartChartAdapter
        • SmartChartJS3Adapter
        • SmartChatBoxAdapter
        • SmartComboBoxAdapter
        • SmartCopilotAdapter
        • SmartDataEntryAdapter
        • SmartDocumentAdapter
        • SmartFullCalendarAdapter
        • SmartObjectAdapter
        • SmartPictureBoxAdapter
        • SmartQueryAdapter
        • SmartRealtimeAdapter
        • SmartReportAdapter
        • SmartTextBoxAdapter
        • SmartAdapter.ExtendsAttribute
        • SmartAdapter.FieldNameAttribute
        • SmartAdapter.FieldPromptAttribute
        • SmartAdapter.FieldRectangleAttribute
        • SmartAdapter.WorksWithAttribute
      • SmartEndpoint
        • AmazonBedrockEndpoint
        • AnthropicEndpoint
        • AzureAIEndpoint
        • CerebrasEndpoint
        • DeepSeekEndpoint
        • GoogleAIEndpoint
        • GroqCloudEndpoint
        • GroqCloudEndpointWhisper
        • HuggingFaceEndpoint
        • HuggingFaceJavaScriptEndpoint
        • LocalAIEndpoint
        • LocalAIEndpointImageGen
        • LocalAIEndpointTTS
        • LocalAIEndpointWhisper
        • NvidiaAIEndpoint
        • OllamaEndpoint
        • OpenAIEndpoint
        • OpenAIEndpointDallE
        • OpenAIEndpointRealtime
        • OpenAIEndpointTTS
        • OpenAIEndpointWhisper
        • SambaNovaEndpoint
        • SmartHttpEndpoint
        • TogetherAIEndpoint
        • XAIEndpoint
        • SmartEndpoint.Metrics
        • SmartEndpoint.Response
      • SmartExtensions
      • SmartHub
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
      • SmartObject
      • SmartPrompt
        • SmartAgentPrompt
        • SmartParallelPrompt
        • SmartPrompt.Parameter
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
      • SmartRealtimeSession
      • SmartSession
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.Message
        • SmartSession.MessageCollection
        • SmartSession.MessageRole
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
        • SmartSession.TrimmingStrategy
      • SmartTool
        • SmartTool.IToolProvider
        • SmartTool.ToolAttribute
        • SmartTool.ToolContext
      • Markup
        • MarkupExtensions
      • Controls
        • UVLightOverlay
      • Embeddings
        • EmbeddedDocument
        • Embedding
        • Matches
        • Metadata
      • Helpers
        • ApiKeys
        • Markdown
        • TextTokenizer
      • Services
        • DefaultSessionTrimmingService
        • IDocumentConversionService
          • DefaultDocumentConversionService
        • IEmbeddingGenerationService
          • DefaultEmbeddingGenerationService
          • HuggingFaceEmbeddingGenerationService
        • IEmbeddingStorageService
          • AzureAISearchEmbeddingStorageService
          • ChromaEmbeddingStorageService
          • FileSystemEmbeddingStorageService
          • MemoryEmbeddingStorageService
          • PineconeEmbeddingStorageService
          • QdrantEmbeddingStorageService
        • IHttpClientService
          • DefaultHttpClientService
        • ILoggerService
          • DefaultLoggerService
        • IOCRService
          • DefaultOCRService
        • IRerankingService
          • DefaultRerankingService
          • LocalAIRerankingService
          • PineconeRerankingService
        • ISessionTrimmingService
          • DefaultSessionTrimmingService
        • ITextSplitterService
          • RecursiveCharacterTextSplitterService
          • TextSplitterServiceBase
        • ITokenizerService
          • DefaultTokenizerService
        • IWebSearchService
          • BingWebSearchService
          • BraveWebSearchService
          • GoogleWebSearchService
      • Tools
        • ArxivTools
        • ChartJS3Tools
        • DatabaseTools
        • DataTableFilterTools
        • DocumentSearchTools
        • DocumentTools
        • FullCalendarTools
        • IToolsContainer
        • MathTools
        • ToolsContainer
        • UtilityTools
        • WebSearchTools
    • Built-in Services
      • IOCRService
      • ILoggerService
      • ITextSplitterService
      • ITokenizerService
      • IHttpClientService
      • IWebSearchService
      • IRerankingService
      • ISessionTrimmingService
      • IDocumentConversionService
      • IEmbeddingStorageService
      • IEmbeddingGenerationService
    • Built-in SmartTools
      • ToolsContainer
      • MathTools
      • UtilityTools
      • DatabaseTools
      • DocumentTools
      • DocumentSearchTools
      • WebSearchTools
      • ChartJS3Tools
      • FullCalendarTools
    • Built-in SmartAdapters
      • SmartAdapter
      • SmartAudioTTSAdapter
      • SmartAudioWhisperAdapter
      • SmartCalendarAdapter
      • SmartChartAdapter
      • SmartChartJS3Adapter
      • SmartChatBoxAdapter
      • SmartComboBoxAdapter
      • SmartCopilotAdapter
      • SmartDataEntryAdapter
      • SmartDocumentAdapter
      • SmartFullCalendarAdapter
      • SmartObjectAdapter
      • SmartPictureBoxAdapter
      • SmartQueryAdapter
      • SmartRealtimeAdapter
      • SmartReportAdapter
      • SmartTextBoxAdapter
    • Configure Services
    • Using SmartHub
    • Using SmartTools
    • Using SmartPrompt
    • Using SmartSession
    • Using SmartRealTimeAdapter
    • UVLightOverlay Control
Powered by GitBook
On this page
  • Constructors
  • OllamaEndpoint()
  • Properties
  • EmbeddingModel
  • MaxContextTokens
  • Methods
  • AddOptions(message, session)
  • AskEmbeddingsAsync(inputs)
  • BuildEmbeddingsPayload(inputs)
  • GetApiURL()
  • GetEmbeddingsURL()
  • ReadAssistantMessage(response, message)
  • ReadEmbeddingsResponse(response)
  • ReadUsage(message, reply)
Export as PDF
  1. Components
  2. API
  3. SmartEndpoint

OllamaEndpoint

Wisej.AI.Endpoints.OllamaEndpoint

PreviousNvidiaAIEndpointNextOpenAIEndpoint

Last updated 5 days ago

Namespace: Wisej.AI.Endpoints

Assembly: Wisej.AI (3.5.0.0)

Represents an endpoint that connects to Ollama services, providing functionalities for chat and embeddings.

public class OllamaEndpoint : SmartHttpEndpoint
Public Class OllamaEndpoint
    Inherits SmartHttpEndpoint

This class extends the to interact with Ollama endpoints. It provides methods to construct API URLs, add options to messages, and handle responses.

Constructors

OllamaEndpoint()

Initializes a new instance of the class with default settings.

Properties

EmbeddingModel

: Gets or sets the embedding model used by the endpoint. (Default: "all-minilm")

Methods

Adds options to the message for the current session.

Parameter
Type
Description

message

The dynamic message object to which options are added.

session

The current session containing model options.

Throws:

Asynchronously requests embeddings for the specified inputs.

Parameter
Type
Description

inputs

An array of input strings for which embeddings are requested.

Throws:

Builds the payload for the embeddings request.

Parameter
Type
Description

inputs

An array of input strings for which the payload is built.

Throws:

Constructs the API URL for chat interactions.

Constructs the API URL for embeddings interactions.

Reads the assistant's message from the response and updates the message object.

Parameter
Type
Description

response

The response received from the API.

message

The message object to be updated with the assistant's response.

Throws:

Reads the embeddings response and extracts the embeddings data.

Parameter
Type
Description

response

The response received from the API.

Throws:

Reads the usage statistics from the reply and updates the message usage.

Parameter
Type
Description

message

The message object to be updated with usage statistics.

reply

The dynamic reply object containing usage information.

MaxContextTokens

: Gets or sets the maximum number of tokens the context window for the specified can hold. (Default: 8192)

AddOptions(message, session)

Thrown when the message is null.

AskEmbeddingsAsync(inputs)

Returns: . A task representing the asynchronous operation, with a result of type .

Thrown when the inputs are null.

BuildEmbeddingsPayload(inputs)

Returns: . An object representing the payload for the embeddings request.

Thrown when the inputs are null.

GetApiURL()

Returns: . A string representing the chat API URL.

GetEmbeddingsURL()

Returns: . A string representing the embeddings API URL.

ReadAssistantMessage(response, message)

Thrown when the response or message is null.

ReadEmbeddingsResponse(response)

Returns: . A jagged array of floats representing the embeddings.

Thrown when the response is null.

ReadUsage(message, reply)

ArgumentNullException
Task<Embedding>
Embedding
ArgumentNullException
Object
ArgumentNullException
String
String
ArgumentNullException
Single[][]
ArgumentNullException
Object
SmartSession
String[]
String[]
Response
Message
Response
Message
Object
SmartEndpoint
SmartHttpEndpoint
OllamaEndpoint
SmartHttpEndpoint
OllamaEndpoint
String
Int32
Model