summaryrefslogtreecommitdiff
path: root/Omni/Bot.scm
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-16 08:20:54 -0500
committerBen Sima <ben@bensima.com>2025-12-16 08:20:54 -0500
commit122d73ac9d2472f91ed00965d03d1e761da72699 (patch)
treef84e21139113cf7d8e4ff2d3f7bf4c81d11e6fd2 /Omni/Bot.scm
parenta7dcb30c7a465d9fce72b7fc3e605470b2b59814 (diff)
refactor: Rename Bot to Ava, remove cost guardrail
- Rename Omni/Bot.hs to Omni/Ava.hs - Delete Omni/Bot.scm (unused Guile version) - Remove cost limit (was 10 cents, now 0) - Increase max iterations from 10 to 50
Diffstat (limited to 'Omni/Bot.scm')
-rwxr-xr-xOmni/Bot.scm61
1 files changed, 0 insertions, 61 deletions
diff --git a/Omni/Bot.scm b/Omni/Bot.scm
deleted file mode 100755
index ff81c53..0000000
--- a/Omni/Bot.scm
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env run.sh
-!#
-;; : out omnibot
-;;
-;; Usage with ii:
-;;
-;; tail -f \#omni/out | guile -L $CODEROOT -s Omni/Bot.scm
-;;
-(define-module (Omni Bot) #:export (main))
-
-(import (ice-9 rdelim))
-(import (ice-9 match))
-(import (ice-9 regex))
-(import (ice-9 receive))
-(import (bs core))
-(import (prefix (bs string) string.))
-
-(define (log msg)
- (display msg (current-error-port)))
-
-(define (is-command? msg)
- (string.prefix? msg "omnibot:"))
-
-(define (parse-line line)
- (if (eof-object? line)
- (exit)
- (let ([matches (regexp-exec
- (make-regexp "<(\\S*)>(.*)" regexp/extended)
- (string-drop line 11))])
- (if matches
- `(user
- ,(match:substring matches 1)
- ,(string.lstrip (match:substring matches 2) #\space))
- `(system ,(string-drop line 11))))))
-
-(define (dispatch user msg)
- (let ([msg (-> msg
- (string-drop (string-length "omnibot:"))
- (string.lstrip #\space))])
- (cond
- ((equal? msg "hi")
- (display (fmt "~a: well, hello!" user)))
-
- (else
- (display (fmt "command not understood: ~a" msg))))))
-
-(define (main args)
- (while #t
- (match (parse-line (read-line))
- [('user user msg)
- (if (is-command? msg)
- (dispatch user msg)
- (begin
- (log (fmt "user: ~a " user))
- (log (fmt "message: ~a" msg))))]
-
- [('system msg)
- (log (fmt "system: ~a" msg))])
-
- (newline)
- (force-output)))