ollama_commons

package
v0.3.71 Latest Latest
Warning

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

Go to latest
Published: May 17, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OllamaExec = "ollama"
	OllamaRoot = "{{dir_user}}/.ollama/"

	OllamaHost = "http://127.0.0.1:11434/"

	DefaultModel      = "llama3.2"
	DefaultModelTools = "llama3.2"
)

Variables

This section is empty.

Functions

func ImageData

func ImageData(files ...string) (response []string, err error)

Types

type ModelEntity

type ModelEntity struct {
	Name     string `json:"name"`
	Version  string `json:"version"`
	Id       string `json:"id"`
	Size     string `json:"size"`
	Modified string `json:"last_update"`
}

ModelEntity represents a model with its name, version, unique identifier, size, and last modification date.

func NewModelEntity

func NewModelEntity(args ...interface{}) (instance *ModelEntity, err error)

func (*ModelEntity) FullName

func (instance *ModelEntity) FullName() (response string)

type OllamaApiOptions

type OllamaApiOptions struct {
	Host string `json:"host"` // url
}

type OllamaCLIResponse

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

func NewOllamaCLIResponse

func NewOllamaCLIResponse() (instance *OllamaCLIResponse)

func NewOllamaCLIResponseError

func NewOllamaCLIResponseError(err error) (instance *OllamaCLIResponse)

func (*OllamaCLIResponse) GetContext

func (instance *OllamaCLIResponse) GetContext() []int

func (*OllamaCLIResponse) GetError

func (instance *OllamaCLIResponse) GetError() (err error)

func (*OllamaCLIResponse) GetPromptResponse

func (instance *OllamaCLIResponse) GetPromptResponse() (response string)

func (*OllamaCLIResponse) GetPromptResponseFormatted

func (instance *OllamaCLIResponse) GetPromptResponseFormatted(format string) (response interface{})

func (*OllamaCLIResponse) GetResponse

func (instance *OllamaCLIResponse) GetResponse() (response interface{})

func (*OllamaCLIResponse) GetResponseAsMap

func (instance *OllamaCLIResponse) GetResponseAsMap() (response map[string]interface{})

func (*OllamaCLIResponse) GetUid

func (instance *OllamaCLIResponse) GetUid() string

func (*OllamaCLIResponse) HasError

func (instance *OllamaCLIResponse) HasError() bool

func (*OllamaCLIResponse) Map

func (instance *OllamaCLIResponse) Map() map[string]interface{}

func (*OllamaCLIResponse) SetError

func (instance *OllamaCLIResponse) SetError(err error) *OllamaCLIResponse

func (*OllamaCLIResponse) SetResponse

func (instance *OllamaCLIResponse) SetResponse(value interface{}) *OllamaCLIResponse

func (*OllamaCLIResponse) String

func (instance *OllamaCLIResponse) String() string

func (*OllamaCLIResponse) Usage

func (instance *OllamaCLIResponse) Usage() map[string]interface{}

type OllamaOptions

type OllamaOptions struct {
	DriverOptions *llm_commons.LLMDriverOptions `json:"-"`
	Api           *OllamaApiOptions             `json:"api"`
}

func NewOllamaOptions

func NewOllamaOptions() (instance *OllamaOptions)

func (*OllamaOptions) Map

func (instance *OllamaOptions) Map() (response map[string]interface{})

func (*OllamaOptions) String

func (instance *OllamaOptions) String() (response string)

Jump to

Keyboard shortcuts

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