From 1741c47933912435ed6b401540bf32f72fc5f2b4 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 14 Apr 2026 00:20:30 +0100 Subject: Add json-get. --- kaagum/openai.scm | 5 +++++ 1 file changed, 5 insertions(+) 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} -- cgit 1.4.1