Skip to content

Commit 95e1540

Browse files
authored
Merge pull request #237 from editor-code-assistant/add-gemini-to-github-copilot-models
Add Gemini 3 models to github-copilot models
2 parents f5d5e4f + 3e12e25 commit 95e1540

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
- Support for Gemini 3 models in Github-copilot.
56
- Support Google Gemini thought signatures.
67
- Support `gemini-3-pro-preview` model.
78
- Fix deepseek reasoning with openai-chat API #228

integration-test/integration/initialize_test.clj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"github-copilot/claude-opus-4.5"
2222
"github-copilot/claude-sonnet-4.5"
2323
"github-copilot/gemini-2.5-pro"
24+
"github-copilot/gemini-3-flash-preview"
25+
"github-copilot/gemini-3-pro-preview"
2426
"github-copilot/gpt-4.1"
2527
"github-copilot/gpt-4o"
2628
"github-copilot/gpt-5"
@@ -86,6 +88,8 @@
8688
"github-copilot/claude-opus-4.5"
8789
"github-copilot/claude-sonnet-4.5"
8890
"github-copilot/gemini-2.5-pro"
91+
"github-copilot/gemini-3-flash-preview"
92+
"github-copilot/gemini-3-pro-preview"
8993
"github-copilot/gpt-4.1"
9094
"github-copilot/gpt-4o"
9195
"github-copilot/gpt-5"

src/eca/config.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@
7676
"gpt-4.1" {}
7777
"gpt-4o" {}
7878
"grok-code-fast-1" {}
79-
"gemini-2.5-pro" {}}}
79+
"gemini-2.5-pro" {}
80+
"gemini-3-pro-preview" {}
81+
"gemini-3-flash-preview" {}}}
8082
"google" {:api "openai-chat"
8183
:url "${env:GOOGLE_API_URL:https://generativelanguage.googleapis.com/v1beta/openai}"
8284
:key "${env:GOOGLE_API_KEY}"
@@ -302,8 +304,7 @@
302304
(map? m*)
303305
(let [apply-kebab-key? (applies? kc-paths cur-path)
304306
apply-string-key? (applies? str-paths cur-path)
305-
apply-keywordize-val? (applies? keywordize-paths cur-path)
306-
]
307+
apply-keywordize-val? (applies? keywordize-paths cur-path)]
307308
(into {}
308309
(map (fn [[k v]]
309310
(let [base-name (cond

src/eca/llm_providers/openai_chat.clj

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,22 @@
7373
tools-to-call (->> (:tool_calls message)
7474
(map (fn [tool-call]
7575
(cond-> {:id (:id tool-call)
76-
:full-name (:name (:function tool-call))
77-
:arguments (json/parse-string (:arguments (:function tool-call)))}
76+
:full-name (:name (:function tool-call))
77+
:arguments (json/parse-string (:arguments (:function tool-call)))}
7878
;; Preserve Google Gemini thought signatures
79-
(get-in tool-call [:extra_content :google :thought_signature])
80-
(assoc :external-id
81-
(get-in tool-call [:extra_content :google :thought_signature]))))))
79+
(get-in tool-call [:extra_content :google :thought_signature])
80+
(assoc :external-id
81+
(get-in tool-call [:extra_content :google :thought_signature]))))))
8282
;; DeepSeek returns reasoning_content, OpenAI o1 returns reasoning
8383
reasoning-content (:reasoning_content message)]
8484
{:usage (parse-usage usage)
8585
:reason-id (str (random-uuid))
8686
:tools-to-call tools-to-call
8787
:call-tools-fn (fn [on-tools-called]
8888
(on-tools-called-wrapper tools-to-call on-tools-called nil))
89-
:reason-text (or (:reasoning message) reasoning-content)
89+
:reason-text (or (:reasoning message)
90+
(:reasoning_text message)
91+
reasoning-content)
9092
:reasoning-content reasoning-content
9193
:output-text (:content message)}))
9294

@@ -438,7 +440,8 @@
438440

439441
;; Process reasoning if present (o1 models and compatible providers)
440442
(when-let [reasoning-text (or (:reasoning delta)
441-
(:reasoning_content delta))]
443+
(:reasoning_content delta)
444+
(:reasoning_text delta))]
442445
(when-not (= (:type @reasoning-state*) :delta)
443446
(start-delta-reasoning))
444447
(on-reason {:status :thinking
@@ -450,7 +453,8 @@
450453
(when (and (= (:type state) :delta)
451454
(:id state) ;; defensive check
452455
(nil? (:reasoning delta))
453-
(nil? (:reasoning_content delta)))
456+
(nil? (:reasoning_content delta))
457+
(nil? (:reasoning_text delta)))
454458
;; Flush any buffered content before finishing reasoning
455459
(flush-content-buffer)
456460
(finish-reasoning! reasoning-state* on-reason)))

0 commit comments

Comments
 (0)