ollama

package module
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvModel   = "OLLAMA_MODEL"
	EnvBaseURL = "OLLAMA_BASE_URL"

	DefaultModel   = "kimi-k2.7-code:cloud"
	DefaultBaseURL = "http://127.0.0.1:11434"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model adapts Ollama's /api/chat endpoint to intent.LLM with tool support.

func MustNew

func MustNew(opts ...Option) *Model

MustNew is like New but panics on error.

func New

func New(opts ...Option) (*Model, error)

New returns an intent.LLM backed by Ollama. Unset fields are populated from OLLAMA_MODEL and OLLAMA_BASE_URL when present.

func (*Model) Generate

func (m *Model) Generate(ctx context.Context, req intent.Request) (intent.Response, error)

func (*Model) Model

func (m *Model) Model() intent.Model

func (*Model) Stream

func (m *Model) Stream(ctx context.Context, req intent.Request) (intent.Stream, error)

type Option

type Option func(*config)

Option configures an Ollama model adapter.

func WithBaseURL

func WithBaseURL(baseURL string) Option

WithBaseURL sets the Ollama server base URL.

func WithInfo

func WithInfo(info intent.Model) Option

WithInfo sets model metadata exposed through intent.Model.

func WithModelName

func WithModelName(name string) Option

WithModelName sets the Ollama model name.

Jump to

Keyboard shortcuts

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