From b8ec380aaaa6a44b5ad54924779f331c08eb9be2 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 18 Apr 2026 22:37:27 +0100 Subject: Capture model context length from OpenAI API. --- kaagum/openai.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kaagum/openai.scm b/kaagum/openai.scm index f57cc25..87478fd 100644 --- a/kaagum/openai.scm +++ b/kaagum/openai.scm @@ -32,7 +32,8 @@ (define-public-record-type* ( model model?) (fields (name model-name) - (description model-description))) + (description model-description) + (context-length model-context-length lensed))) ;; TODO: URIs must not be operated on using string operations. Replace with a ;; more principled implementation involving (web uri). @@ -116,7 +117,8 @@ in @code{openai-query}." (map (lambda (tree) (cons (focus (key-ref "id") tree) (model (focus (key-ref "name") tree) - (focus (key-ref "description") tree)))) + (focus (key-ref "description") tree) + (focus (key-ref "context_length") tree)))) (vector->list (focus (key-ref "data") (json-get (uri-join base-uri "/v1/models") #:headers `((authorization -- cgit 1.4.1