diff options
| author | Arun Isaac | 2026-08-07 02:13:23 +0100 |
|---|---|---|
| committer | Arun Isaac | 2026-08-07 02:13:23 +0100 |
| commit | f384343c32d08c605f975da67ccfbd8d3729fe53 (patch) | |
| tree | 59aa298dbdfd716c8d6c8883f0405ed14ce5b69c | |
| parent | e5cb9fb2e32d12fbf2275f68fcf17ebb60ccac04 (diff) | |
| download | kaagum-f384343c32d08c605f975da67ccfbd8d3729fe53.tar.gz kaagum-f384343c32d08c605f975da67ccfbd8d3729fe53.tar.lz kaagum-f384343c32d08c605f975da67ccfbd8d3729fe53.zip | |
Enable Kagi tools with --kagi-api-key-command.
| -rwxr-xr-x | bin/kaagum | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/bin/kaagum b/bin/kaagum index 9d5353d..e2ff91f 100755 --- a/bin/kaagum +++ b/bin/kaagum @@ -29,6 +29,7 @@ exec guile --no-auto-compile -e main -s "$0" "$@" (kaagum tea) (kaagum tools base) (kaagum tools forges) + (kaagum tools kagi) (kaagum trace) (kaagum utils)) @@ -49,6 +50,9 @@ exec guile --no-auto-compile -e main -s "$0" "$@" (option (list #\k "api-key-command") #t #f (lambda (opt name arg result) (acons 'api-key-command arg result))) + (option (list "kagi-api-key-command") #t #f + (lambda (opt name arg result) + (acons 'kagi-api-key-command arg result))) (option (list "trace-file") #t #f (lambda (opt name arg result) (acons 'trace-file arg result))) @@ -72,6 +76,8 @@ Run kaagum AI agent. --model=MODEL LLM model name to start new sessions with (default: \"anthropic/claude-opus-4.6\") + --kagi-api-key-command=COMMAND command to run to get Kagi API key + --trace-file=FILE trace out all interactions in FILE --version print version and exit @@ -112,15 +118,22 @@ Run kaagum AI agent. (exit #t)) (unless (assq-ref args 'api-key-command) (die "--api-key-command not specified")) - (let ((thunk (cut run-tea-loop - (assq-ref args 'api-base-uri) - (get-api-key (assq-ref args 'api-key-command)) - (assq-ref args 'model) - (append %base-tools - %forge-tools)))) - (if (assq-ref args 'trace-file) - (call-with-output-file (assq-ref args 'trace-file) - (lambda (trace-port) - (parameterize ((%trace-port trace-port)) - (thunk)))) - (thunk))))))) + (let* ((kagi-api-key-command (assq-ref args 'kagi-api-key-command)) + (thunk (cut run-tea-loop + (assq-ref args 'api-base-uri) + (get-api-key (assq-ref args 'api-key-command)) + (assq-ref args 'model) + (append %base-tools + %forge-tools + (if kagi-api-key-command + %kagi-tools + '()))))) + (parameterize ((%kagi-api-key (pk (and kagi-api-key-command + (get-api-key kagi-api-key-command))))) + ;; (trace 'kagi "Key ~a" (%kagi-api-key)) + (if (assq-ref args 'trace-file) + (call-with-output-file (assq-ref args 'trace-file) + (lambda (trace-port) + (parameterize ((%trace-port trace-port)) + (thunk)))) + (thunk)))))))) |
