Let Supermarket use Hermes' Anthropic key and model
Hermes is already set up with an Anthropic key, so AI needn't be set up twice. `supermarket hermes` asks once, then it and update.sh copy just the key and model to hermes-ai.json in the data folder (0600). The app uses them when it has no key of its own, re-reading the file on each use. Generation still calls the model directly rather than through Hermes' API: post writing feeds it text from the web, which must not reach an agent with a terminal, a browser and write access to the CRM. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"supermarket/internal/ai"
|
||||
"supermarket/internal/content"
|
||||
"supermarket/internal/core"
|
||||
"supermarket/internal/db"
|
||||
@@ -86,6 +87,9 @@ func run(log *slog.Logger) error {
|
||||
log.Warn("drafts were being published when Supermarket stopped; marked failed for review", "count", n)
|
||||
}
|
||||
|
||||
// Hermes' Anthropic key and model, if the user chose to share them
|
||||
ai.SharedFile = filepath.Join(dataDir, "hermes-ai.json")
|
||||
|
||||
sec, err := secrets.Open(filepath.Join(dataDir, "secrets.json"))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user