]> git.giacomolli.uk - onechat/blobdiff - agent.go
Check the width of comment lines
[onechat] / agent.go
index dbcabd24321ffc33ed4607a00159239d598786b9..b86880e46ab465ae820303544479e4574412797e 100644 (file)
--- a/agent.go
+++ b/agent.go
@@ -80,6 +80,16 @@ type Agent struct {
        config AgentConfig
 }
 
        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
 // CacheKey returns the prompt cache key of every model call of the agent.
 func (a *Agent) CacheKey() string {
        return "onechat-" + a.config.ID
@@ -107,12 +117,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"
                })
        }
 
                })
        }