diff options
| author | Arun Isaac | 2026-04-14 00:20:30 +0100 |
|---|---|---|
| committer | Arun Isaac | 2026-04-14 00:20:30 +0100 |
| commit | 1741c47933912435ed6b401540bf32f72fc5f2b4 (patch) | |
| tree | d85791dbf0dd0dd5b14c8d0cc8501cdf4138bb5f | |
| parent | ee80ab2258cf7c75613891837cf4444bffef133d (diff) | |
| download | kaagum-1741c47933912435ed6b401540bf32f72fc5f2b4.tar.gz kaagum-1741c47933912435ed6b401540bf32f72fc5f2b4.tar.lz kaagum-1741c47933912435ed6b401540bf32f72fc5f2b4.zip | |
Add json-get.
| -rw-r--r-- | kaagum/openai.scm | 5 |
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} |
