ollama

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OllamaEmbeddingProvider

type OllamaEmbeddingProvider struct {
	// contains filtered or unexported fields
}

OllamaEmbeddingProvider implements the EmbeddingProvider interface for Ollama

func NewOllamaEmbeddingProvider

func NewOllamaEmbeddingProvider(model string, dimensions int, baseURL string) (*OllamaEmbeddingProvider, error)

NewOllamaEmbeddingProvider creates a new Ollama embedding provider

func (*OllamaEmbeddingProvider) BatchSize

func (o *OllamaEmbeddingProvider) BatchSize() int

BatchSize returns the maximum batch size

func (*OllamaEmbeddingProvider) Dimensions

func (o *OllamaEmbeddingProvider) Dimensions() int

Dimensions returns the embedding vector dimensions

func (*OllamaEmbeddingProvider) EmbedChunks

EmbedChunks embeds multiple chunks in a batch

func (*OllamaEmbeddingProvider) EmbedQuery

func (o *OllamaEmbeddingProvider) EmbedQuery(ctx context.Context, query string) []float32

EmbedQuery embeds a single query for search

func (*OllamaEmbeddingProvider) MaxTokens

func (o *OllamaEmbeddingProvider) MaxTokens() int

MaxTokens returns the maximum token limit for the model

func (*OllamaEmbeddingProvider) Name

func (o *OllamaEmbeddingProvider) Name() string

Name returns the provider name

func (*OllamaEmbeddingProvider) Validate

func (o *OllamaEmbeddingProvider) Validate(ctx context.Context) error

Validate tests the provider connection

type OllamaLLMProvider

type OllamaLLMProvider struct {
	// contains filtered or unexported fields
}

OllamaLLMProvider implements the LLMProvider interface for Ollama

func NewOllamaLLMProvider

func NewOllamaLLMProvider(model, fallbackModel, baseURL string) (*OllamaLLMProvider, error)

NewOllamaLLMProvider creates a new Ollama LLM provider

func (*OllamaLLMProvider) Call

Call makes a non-streaming LLM request

func (*OllamaLLMProvider) Name

func (o *OllamaLLMProvider) Name() string

Name returns the provider name

func (*OllamaLLMProvider) Stream

Stream makes a streaming LLM request

func (*OllamaLLMProvider) Validate

func (o *OllamaLLMProvider) Validate(ctx context.Context) error

Validate tests the provider connection

type OllamaModelSpec

type OllamaModelSpec struct {
	Dimensions int
	MaxTokens  int
}

OllamaModelSpec holds default specifications for an Ollama embedding model

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL