diff options
| author | Arun Isaac | 2026-04-08 20:47:29 +0100 |
|---|---|---|
| committer | Arun Isaac | 2026-04-08 23:52:58 +0100 |
| commit | fbb9fd3f749b79e905c25b4d24b3d7e44369636f (patch) | |
| tree | 6322fe6e0b5e18c66c6beea0d34e221faf16d83f /kaakaa/tools.scm | |
| parent | 9dd7d9c74b04a1f25ac2adf75cc464a2a9149b50 (diff) | |
| download | kaagum-fbb9fd3f749b79e905c25b4d24b3d7e44369636f.tar.gz kaagum-fbb9fd3f749b79e905c25b4d24b3d7e44369636f.tar.lz kaagum-fbb9fd3f749b79e905c25b4d24b3d7e44369636f.zip | |
Raise &tool-call-parse-failure from spec->tool-call.
Diffstat (limited to 'kaakaa/tools.scm')
| -rw-r--r-- | kaakaa/tools.scm | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/kaakaa/tools.scm b/kaakaa/tools.scm index c66f3df..8142d49 100644 --- a/kaakaa/tools.scm +++ b/kaakaa/tools.scm @@ -30,7 +30,10 @@ #:use-module (kaakaa container) #:use-module (kaakaa records) #:use-module (kaakaa utils) - #:export (tool->spec + #:export (tool-call-parse-failure? + tool-call-parse-failure-message + + tool->spec spec->tool-call eval-tool-call)) @@ -135,14 +138,21 @@ (json tool-call-result-json) (success? tool-call-result-success?))) +(define-condition-type &tool-call-parse-failure &serious + tool-call-parse-failure tool-call-parse-failure? + (message tool-call-parse-failure-message)) + (define-condition-type &tool-call-failure &serious tool-call-failure tool-call-failure? (message tool-call-failure-message)) (define (spec->tool-call session-id session-cwd spec) "Deserialize JSON tool call @var{spec} into a @code{<tool-call>} -object. @var{session-id} and @var{session-cwd} are the ID and current working -directory of the session the tool call pertains to." +object. Raise a @code{&tool-call-parse-failure} condition if deserialization +fails. + +@var{session-id} and @var{session-cwd} are the ID and current working directory +of the session the tool call pertains to." ;; TODO: Assert that type is function, and do more sanitization. (tool-call session-id session-cwd |
