]> git.giacomolli.uk - onechat/blobdiff - agent.go
Separate commands from the entry point
[onechat] / agent.go
index b86880e46ab465ae820303544479e4574412797e..d95a81cadad9547c982e928303aff9cce5391234 100644 (file)
--- a/agent.go
+++ b/agent.go
@@ -90,6 +90,16 @@ func (a *Agent) Images() *ImageStore {
        return &ImageStore{dir: filepath.Join(filepath.Dir(root), imageDirName)}
 }
 
+// Voices returns the shared data-directory audio store, also for a child.
+func (a *Agent) Voices() *VoiceStore {
+       root := a.dir
+       if a.config.Parent != "" {
+               root = filepath.Dir(filepath.Dir(root))
+       }
+
+       return &VoiceStore{dir: filepath.Join(filepath.Dir(root), voiceDirName)}
+}
+
 // CacheKey returns the prompt cache key of every model call of the agent.
 func (a *Agent) CacheKey() string {
        return "onechat-" + a.config.ID