Documentation
¶
Index ¶
- type OllamaProvider
- func (o *OllamaProvider) Complete(ctx context.Context, req ai.CompletionRequest) (*ai.CompletionResponse, error)
- func (o *OllamaProvider) Dimension() int
- func (o *OllamaProvider) Embed(ctx context.Context, text string) ([]float64, error)
- func (o *OllamaProvider) EmbedBatch(ctx context.Context, texts []string) ([][]float64, error)
- func (o *OllamaProvider) IsConfigured() bool
- func (o *OllamaProvider) ListModels(ctx context.Context) ([]string, error)
- func (o *OllamaProvider) Name() string
- func (o *OllamaProvider) Stream(ctx context.Context, req ai.CompletionRequest) (<-chan string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OllamaProvider ¶
type OllamaProvider struct {
// contains filtered or unexported fields
}
OllamaProvider implements the LLMProvider interface for Ollama
func NewOllamaProvider ¶
func NewOllamaProvider(host string) *OllamaProvider
NewOllamaProvider creates a new Ollama provider
func (*OllamaProvider) Complete ¶
func (o *OllamaProvider) Complete(ctx context.Context, req ai.CompletionRequest) (*ai.CompletionResponse, error)
Complete generates a completion for the given request
func (*OllamaProvider) Dimension ¶
func (o *OllamaProvider) Dimension() int
Dimension returns the embedding dimension
func (*OllamaProvider) Embed ¶
Embed generates an embedding for the given text (if model supports it)
func (*OllamaProvider) EmbedBatch ¶
EmbedBatch generates embeddings for multiple texts
func (*OllamaProvider) IsConfigured ¶
func (o *OllamaProvider) IsConfigured() bool
IsConfigured checks if the provider is properly configured
func (*OllamaProvider) ListModels ¶
func (o *OllamaProvider) ListModels(ctx context.Context) ([]string, error)
ListModels returns available models
func (*OllamaProvider) Stream ¶
func (o *OllamaProvider) Stream(ctx context.Context, req ai.CompletionRequest) (<-chan string, error)
Stream generates a streaming completion
Click to show internal directories.
Click to hide internal directories.