Skip to content

Commit f052960

Browse files
committed
fix: support the :grounding-search key
1 parent 17d5f3b commit f052960

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

chatgpt-shell-google.el

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,15 @@ the model description needed by chatgpt-shell ."
119119
(model-cwindow (gethash "inputTokenLimit" model)))
120120
(let ((model-version (string-remove-prefix "models/" model-name)))
121121
(let ((model-shortversion (string-remove-prefix "gemini-" model-version))
122-
(model-urlpath (concat "/v1beta/" model-name)))
122+
(model-urlpath (concat "/v1beta/" model-name))
123+
;; The model descriptor does not stipulate whether grounding is supported.
124+
;; So this logic just checks the name.
125+
(model-supports-grounding (or
126+
(string-prefix-p "gemini-1.5" model-version)
127+
(string-prefix-p "gemini-2.0" model-version))))
123128
(chatgpt-shell-google-make-model :version model-version
124129
:short-version model-shortversion
130+
:grounding-search model-supports-grounding
125131
:path model-urlpath
126132
:token-width 4
127133
:context-window model-cwindow)))))

0 commit comments

Comments
 (0)