controller

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOptions

func GetOptions(c *Controller, icon []byte, assets embed.FS) *options.App

Types

type AssetMeta added in v0.6.0

type AssetMeta struct {
	Path     string
	Url      string
	MimeType string
}

type Controller

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

func BuildFromConfig

func BuildFromConfig(cfg *config.Config, lastState string) (ctrl *Controller, err error)

func (*Controller) AppMounted

func (c *Controller) AppMounted()

AppMounted is called when the frontend application is mounted (decided by the frontend itself)

func (*Controller) GetApplicationConfig

func (c *Controller) GetApplicationConfig() config.Config

func (*Controller) GetAssetMeta added in v0.6.0

func (c *Controller) GetAssetMeta(path string) (AssetMeta, error)

func (*Controller) GetLastState added in v0.9.0

func (c *Controller) GetLastState() string

func (*Controller) IsAppMounted added in v0.9.0

func (c *Controller) IsAppMounted() bool

func (*Controller) LLMAsk

func (c *Controller) LLMAsk(args LLMAskArgs) (result string, err error)

func (*Controller) LLMInterrupt

func (c *Controller) LLMInterrupt() (err error)

func (*Controller) LLMWait added in v0.3.0

func (c *Controller) LLMWait() (result string, err error)

func (*Controller) Log added in v0.8.0

func (c *Controller) Log(level string, jsonArgs string)

func (*Controller) OpenFileDialog added in v0.5.0

func (c *Controller) OpenFileDialog(args OpenFileDialogArgs) ([]string, error)

func (*Controller) Restart added in v0.9.0

func (c *Controller) Restart(state string)

func (*Controller) Shutdown added in v0.8.0

func (c *Controller) Shutdown()

func (*Controller) TriggerRestart added in v0.9.0

func (c *Controller) TriggerRestart()

type LLMAskArgs

type LLMAskArgs struct {
	History LLMMessages
}

type LLMMessage

type LLMMessage struct {
	Role         string
	ContentParts []LLMMessageContentPart
}

type LLMMessageContentPart added in v0.5.0

type LLMMessageContentPart struct {
	Type    LLMMessageContentPartType
	Content string
}

type LLMMessageContentPartType added in v0.5.0

type LLMMessageContentPartType string
const (
	LLMMessageContentPartTypeAttachment LLMMessageContentPartType = "attachment"
	LLMMessageContentPartTypeText       LLMMessageContentPartType = "text"
)

type LLMMessages

type LLMMessages []LLMMessage

func (LLMMessages) ToMessageContent

func (m LLMMessages) ToMessageContent(systemPrompt string) ([]llms.MessageContent, error)

type OpenFileDialogArgs added in v0.5.0

type OpenFileDialogArgs struct {
	Title string
}

Jump to

Keyboard shortcuts

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