utils

package
v0.0.0-...-f63e32a Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// please change the version when the version is updated
	WREN_PRODUCT_VERSION    string = "0.13.1"
	DOCKER_COMPOSE_YAML_URL string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/docker-compose.yaml"
	DOCKER_COMPOSE_ENV_URL  string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/.env.example"
	AI_SERVICE_CONFIG_URL   string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/config.example.yaml"
)

Variables

This section is empty.

Functions

func CheckAIServiceStarted

func CheckAIServiceStarted(port int) error

func CheckDockerDaemonRunning

func CheckDockerDaemonRunning() (bool, error)

func CheckUIServiceStarted

func CheckUIServiceStarted(url string) error

func FindAvailablePort

func FindAvailablePort(defaultPort int) int

func IfPortUsedByWrenUI

func IfPortUsedByWrenUI(port int) bool

func OpenDockerDaemon

func OpenDockerDaemon() error

func Openbrowser

func Openbrowser(url string) error

func PrepareConfigFileForOpenAI

func PrepareConfigFileForOpenAI(projectDir string, generationModel string) error

func PrepareDockerFiles

func PrepareDockerFiles(openaiApiKey string, openaiGenerationModel string, hostPort int, aiPort int, projectDir string, telemetryEnabled bool) error

func RunDockerCompose

func RunDockerCompose(projectName string, projectDir string, llmProvider string) error

Types

type OS

type OS int
const (
	// Windows is the Windows operating system.
	Windows OS = iota
	// Darwin is the Apple operating system.
	Darwin
	// Linux is the Linux operating system.
	Linux
	// Unknown is an unknown operating system.
	Unknown
)

func DetectOS

func DetectOS() OS

type WrenRC

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

func (*WrenRC) Read

func (w *WrenRC) Read(key string) (string, error)

read the value of a key from the rc file

func (*WrenRC) Set

func (w *WrenRC) Set(key string, value string, override bool) error

set a key value pair to the rc file

Jump to

Keyboard shortcuts

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