ollama

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 8 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 {
	*core.BaseClient
}

Client is an Ollama LLM client.

Ollama allows you to run large language models locally on your machine. This client connects to a local Ollama server (default: localhost:11434) and provides the same interface as cloud-based providers.

No API key is required. The client uses a longer default timeout (60s) since local models may take more time to generate responses.

func DefaultOllamaClient

func DefaultOllamaClient() (*Client, error)

DefaultOllamaClient 创建默认的 Ollama 客户端 使用 qwen3.5:0.8b 模型,适用于本地智能分块和图提取

func NewOllamaClient

func NewOllamaClient(config core.Config) (*Client, error)

New creates a new Ollama client

func (*Client) Chat

func (c *Client) Chat(ctx context.Context, messages []core.Message, opts ...core.Option) (*core.Response, error)

Chat performs a non-streaming chat completion

func (*Client) ChatStream

func (c *Client) ChatStream(ctx context.Context, messages []core.Message, opts ...core.Option) (*core.Stream, error)

ChatStream performs a streaming chat completion

Jump to

Keyboard shortcuts

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