]> git.giacomolli.uk - onechat/blobdiff - agent.go
Keep scenario tests with their implementation
[onechat] / agent.go
index 97d668585dd42d36e7816c3d2870e0d950b613d0..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)}
 }
 
        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
 // CacheKey returns the prompt cache key of every model call of the agent.
 func (a *Agent) CacheKey() string {
        return "onechat-" + a.config.ID
@@ -117,12 +127,12 @@ func (a *Agent) Prompt() (string, error) {
 }
 
 // Tools returns the tools shared by the turns and compactions of this agent. A
 }
 
 // Tools returns the tools shared by the turns and compactions of this agent. A
-// child has no WhatsApp, child creation, or route tools.
+// child has no image output, WhatsApp, child creation, or route tools.
 func (a *Agent) Tools() []ModelTool {
        tools := promptTools()
        if a.config.Parent != "" {
                tools = slices.DeleteFunc(tools, func(tool ModelTool) bool {
 func (a *Agent) Tools() []ModelTool {
        tools := promptTools()
        if a.config.Parent != "" {
                tools = slices.DeleteFunc(tools, func(tool ModelTool) bool {
-                       return strings.HasPrefix(tool.Name, "whatsapp_") || tool.Name == "agent_create" || tool.Name == "route" || tool.Name == "unroute" || tool.Name == "routes"
+                       return strings.HasPrefix(tool.Name, "whatsapp_") || tool.Name == "image_show" || tool.Name == "agent_create" || tool.Name == "route" || tool.Name == "unroute" || tool.Name == "routes"
                })
        }
 
                })
        }