Skip to content

Commit b47049a

Browse files
authored
Merge pull request #331 from DinoChiesa/goog-model-lacks-descrip
fix: handle case where google model lacks description
2 parents 79a4300 + 5f29117 commit b47049a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

chatgpt-shell-google.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ supports \"generateContent\".
9494
This is used to filter the list of models returned from
9595
https://generativelanguage.googleapis.com"
9696
(let-alist api-response
97-
(unless (string-match-p (rx (or "discontinued" "deprecated")) .description)
98-
(seq-contains-p .supportedGenerationMethods "generateContent"))))
97+
(and .supportedGenerationMethods
98+
(not (and .description (string-match-p (rx (or "discontinued" "deprecated")) .description)))
99+
(seq-contains-p .supportedGenerationMethods "generateContent"))))
99100

100101
(defun chatgpt-shell-google--fetch-model-versions ()
101102
"Retrieves the list of generative models from the Google API."

0 commit comments

Comments
 (0)