ollama

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: CC0-1.0 Imports: 7 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
}

func NewClient

func NewClient(baseURL string) *Client

func NewLocalClient

func NewLocalClient() *Client

func (*Client) Chat

type CompleteRequest

type CompleteRequest struct {
	Model     string         `json:"model"`
	Messages  []Message      `json:"messages"`
	Format    *string        `json:"format,omitempty"`
	Template  *string        `json:"template,omitempty"`
	Stream    bool           `json:"stream"`
	Options   map[string]any `json:"options"`
	KeepAlive time.Duration  `json:"keep_alive"`
}

type CompleteResponse

type CompleteResponse struct {
	Model              string    `json:"model"`
	CreatedAt          time.Time `json:"created_at"`
	Message            Message   `json:"message"`
	Done               bool      `json:"done"`
	TotalDuration      float64   `json:"total_duration"`
	LoadDuration       float64   `json:"load_duration"`
	PromptEvalCount    int64     `json:"prompt_eval_count"`
	PromptEvalDuration int64     `json:"prompt_eval_duration"`
	EvalCount          int64     `json:"eval_count"`
	EvalDuration       int64     `json:"eval_duration"`
}

type Message

type Message struct {
	Content string   `json:"content"`
	Role    string   `json:"role"`
	Images  [][]byte `json:"images"`
}

Jump to

Keyboard shortcuts

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