ollama

package
v1.133.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

* ChatCLI - Command Line Interface for LLM interaction * Copyright (c) 2024 Edilson Freitas * License: Apache-2.0

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, model string, logger *zap.Logger, maxAttempts int, backoff time.Duration) *Client

NewClient cria uma nova instância de Client para Ollama. Agora sem fallback interno: usa apenas os params passados (vindos do manager/ENVs).

func (*Client) GetModelName

func (c *Client) GetModelName() string

func (*Client) LastStopReason added in v1.99.0

func (c *Client) LastStopReason() string

LastStopReason returns the stop reason from the most recent API call.

func (*Client) LastUsage added in v1.99.0

func (c *Client) LastUsage() *models.UsageInfo

LastUsage returns the token usage from the most recent API call.

func (*Client) ListModels added in v1.97.0

func (c *Client) ListModels(ctx context.Context) ([]client.ModelInfo, error)

ListModels fetches available models from the Ollama /api/tags endpoint.

func (*Client) SendPrompt

func (c *Client) SendPrompt(ctx context.Context, prompt string, history []models.Message, maxTokens int) (string, error)

Jump to

Keyboard shortcuts

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