ollama

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 10 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
}

func NewClient

func NewClient(config Config) *Client

func (*Client) SendPrompt

func (c *Client) SendPrompt(ctx context.Context, prompt string) (string, error)

func (*Client) SendRequest

func (c *Client) SendRequest(ctx context.Context, prompt string, stream bool, callback func(string)) (string, error)

func (*Client) StreamPrompt

func (c *Client) StreamPrompt(ctx context.Context, prompt string, callback func(string)) error

type Config

type Config struct {
	Host     string
	Port     int
	Model    string
	Timeout  time.Duration
	MaxRetry int
	Client   *http.Client
}

type Request

type Request struct {
	Model   string `json:"model"`
	Prompt  string `json:"prompt"`
	Stream  bool   `json:"stream,omitempty"`
	NumPred int    `json:"num_predict,omitempty"`
}

type Response

type Response struct {
	Response string `json:"response"`
	Done     bool   `json:"done,omitempty"`
	Error    string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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