ollama

package module
v0.0.0-...-ac6641e Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

agent-api ollama-provider

The Ollama provider for agent-api


👷🏗️ The Ollama provider is a work in progress and the API may change unexpectedly.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider implements the LLMProvider interface for Ollama

func NewProvider

func NewProvider(opts *ProviderOpts) *Provider

NewProvider creates a new Ollama provider

TODO: - need to handle base URL better (with trailing slashes, etc.) - need to construct actual URL using baseURL, port, etc.

func (*Provider) Generate

func (p *Provider) Generate(ctx context.Context, opts *core.GenerateOptions) (*core.Message, error)

Generate implements the LLMProvider interface for basic responses

func (*Provider) GenerateStream

func (p *Provider) GenerateStream(ctx context.Context, opts *core.GenerateOptions) (<-chan *core.Message, <-chan string, <-chan error)

GenerateStream streams the response token by token

func (*Provider) GetCapabilities

func (p *Provider) GetCapabilities(ctx context.Context) (*core.Capabilities, error)

func (*Provider) UseModel

func (p *Provider) UseModel(ctx context.Context, model *core.Model) error

type ProviderOpts

type ProviderOpts struct {
	BaseURL string
	Port    int
	Logger  *logr.Logger
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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