about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2026-04-14 00:20:30 +0100
committerArun Isaac2026-04-14 00:20:30 +0100
commit1741c47933912435ed6b401540bf32f72fc5f2b4 (patch)
treed85791dbf0dd0dd5b14c8d0cc8501cdf4138bb5f
parentee80ab2258cf7c75613891837cf4444bffef133d (diff)
downloadkaagum-1741c47933912435ed6b401540bf32f72fc5f2b4.tar.gz
kaagum-1741c47933912435ed6b401540bf32f72fc5f2b4.tar.lz
kaagum-1741c47933912435ed6b401540bf32f72fc5f2b4.zip
Add json-get.
-rw-r--r--kaagum/openai.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/kaagum/openai.scm b/kaagum/openai.scm
index 8f13de2..646d15a 100644
--- a/kaagum/openai.scm
+++ b/kaagum/openai.scm
@@ -60,6 +60,11 @@ additional @var{headers}. Return JSON response."
                     (string-append "JSON API request failed with code "
                                    (number->string (response-code response))))))))))
 
+(define* (json-get url #:key (headers '()))
+  "Send a GET request to @var{url}. Return JSON response."
+  (json-request 'GET url
+                #:headers headers))
+
 (define* (json-post url #:key (headers '()) json)
   "Send a POST request to @var{url} with @var{json} body and additional
 @var{headers}. The @samp{Content-Type} header is set to @samp{application/json}