Documentation
¶
Index ¶
- Constants
- Variables
- func Install(logger *log.Logger, installPath string) (err error)
- func InstallAll(logger *log.Logger, installPath string) (err error)
- func InstallEvaluation(logger *log.Logger, installPath string) (err error)
- func InstallPathDefault() (installPath string, err error)
- func InstallTool(logger *log.Logger, tool Tool, installPath string) (err error)
- func OllamaCheck(url string) (err error)
- func OllamaLoad(ollamaURL string, modelName string) (err error)
- func OllamaModels(ollamaURL string) (modelNames []string, err error)
- func OllamaPull(logger *log.Logger, binaryPath string, url string, modelName string) (err error)
- func OllamaStart(logger *log.Logger, binaryPath string, url string) (shutdown func() (err error), err error)
- func OllamaUnload(ollamaURL string, modelName string) (err error)
- func Register(tool Tool)
- type Ollama
- type Tool
Constants ¶
const SymflowerVersionRequired = "37153"
SymflowerVersionRequired holds the version of Symflower required for this revision of the evaluation.
Variables ¶
var ( // ErrToolVersionOutdated indicates that an installed tool is outdated. ErrToolVersionOutdated = errors.New("tool version mismatch") // ErrUnsupportedOperatingSystem indicates that the operating system is not supported by the tool. ErrUnsupportedOperatingSystem = errors.New("tool is not supported with the operating system") )
var OllamaPath = "ollama" + osutil.BinaryExtension()
OllamaPath holds the file path to the Ollama binary or the command name that should be executed.
var (
// OllamaURL holds the URL to the Ollama service.
OllamaURL = "http://127.0.0.1:11434"
)
var SymflowerPath = "symflower" + osutil.BinaryExtension()
SymflowerPath holds the file path to the Symflower binary or the command name that should be executed.
var Tools = map[string]Tool{}
Tools holds a register of all tools.
Functions ¶
func InstallAll ¶
InstallAll installs all tools.
func InstallEvaluation ¶
InstallEvaluation installs all basic evaluation tools.
func InstallPathDefault ¶
InstallPathDefault returns the default installation path for tools.
func InstallTool ¶
InstallTool installs the given tool to the installation path.
func OllamaCheck ¶
OllamaCheck checks that an Ollama service is running at the given URL.
func OllamaLoad ¶
OllamaLoad loads a model into memory.
func OllamaModels ¶
OllamaModels returns which models are available to be queried.
func OllamaPull ¶
OllamaPull pulls a model.
func OllamaStart ¶
func OllamaStart(logger *log.Logger, binaryPath string, url string) (shutdown func() (err error), err error)
OllamaStart starts an Ollama service if necessary with the given binary connected to the given URL and returns a shutdown function.
func OllamaUnload ¶
OllamaUnload unloads a model from memory.
Types ¶
type Ollama ¶
type Ollama struct{}
Ollama holds the "Ollama" tool.
func (*Ollama) BinaryName ¶
BinaryName returns the name of the tool's binary.
func (*Ollama) BinaryPath ¶
BinaryPath returns the file path of the tool's binary or the command name that should be executed. The binary path might also be just the binary name in case the tool is expected to be on the system path.
func (*Ollama) CheckVersion ¶
CheckVersion checks if the tool's version is compatible with the required version.
func (*Ollama) RequiredVersion ¶
RequiredVersion returns the required version of the tool.
type Tool ¶
type Tool interface {
// ID returns the unique ID of this tool.
ID() (id string)
// BinaryName returns the name of the tool's binary.
BinaryName() string
// BinaryPath returns the file path of the tool's binary or the command name that should be executed.
// The binary path might also be just the binary name in case the tool is expected to be on the system path.
BinaryPath() string
// CheckVersion checks if the tool's version is compatible with the required version.
CheckVersion(logger *log.Logger, binaryPath string) error
// RequiredVersion returns the required version of the tool.
RequiredVersion() string
// Install installs the tool's binary to the given install path.
Install(logger *log.Logger, installPath string) error
}
Tool defines an external tool.