ollama

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package ollama implements stream.Stream for Ollama.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*api.Client
}

Client ollama client.

func New

func New(config Config) (*Client, error)

New creates a new Client with the given Config.

func (*Client) Request

func (c *Client) Request(ctx context.Context, request proto.Request) stream.Stream

Request implements stream.Client.

type Config

type Config struct {
	BaseURL            string
	HTTPClient         *http.Client
	EmptyMessagesLimit uint
}

Config represents the configuration for the Ollama API client.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration for the Ollama API client.

type Stream

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

Stream ollama stream.

func (*Stream) CallTools

func (s *Stream) CallTools() []proto.ToolCallStatus

CallTools implements stream.Stream.

func (*Stream) Close

func (s *Stream) Close() error

Close implements stream.Stream.

func (*Stream) Current

func (s *Stream) Current() (proto.Chunk, error)

Current implements stream.Stream.

func (*Stream) Err

func (s *Stream) Err() error

Err implements stream.Stream.

func (*Stream) Messages

func (s *Stream) Messages() []proto.Message

Messages implements stream.Stream.

func (*Stream) Next

func (s *Stream) Next() bool

Next implements stream.Stream.

Jump to

Keyboard shortcuts

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