about summary refs log tree commit diff
diff options
context:
space:
mode:
-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}