X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/723f6e18adc6482ed913e1618c8a76e981720c2b..4343ca5fb6cc86eb887951f4fe16063bab29a238:/agent.go?ds=sidebyside diff --git a/agent.go b/agent.go index dbcabd2..97d6685 100644 --- a/agent.go +++ b/agent.go @@ -80,6 +80,16 @@ type Agent struct { config AgentConfig } +// Images returns the shared data-directory image store, also for a child. +func (a *Agent) Images() *ImageStore { + root := a.dir + if a.config.Parent != "" { + root = filepath.Dir(filepath.Dir(root)) + } + + return &ImageStore{dir: filepath.Join(filepath.Dir(root), imageDirName)} +} + // CacheKey returns the prompt cache key of every model call of the agent. func (a *Agent) CacheKey() string { return "onechat-" + a.config.ID