ollama

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements llm.ChatModel over Ollama /api/chat.

func NewClient

func NewClient(cfg Config) (*Client, error)

func (*Client) Chat

Chat (non-streaming).

func (*Client) Name

func (c *Client) Name() string

func (*Client) StreamChat

func (c *Client) StreamChat(ctx context.Context, req protocol.ChatRequest) (protocol.ChatStream, error)

StreamChat streams /api/chat with stream=true (line-delimited JSON).

type Config

type Config struct {
	BaseURL    string
	APIKey     string // optional, if gateway uses key
	HTTPClient *http.Client
}

Config for Ollama HTTP API.

Jump to

Keyboard shortcuts

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