Skip to content

Commit 35f28a8

Browse files
committed
Fix login for google provider.
Fixes #134
1 parent d02b7b5 commit 35f28a8

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- More tolerant whitespace handling after `data:`.
6+
- Fix login for google provider.
67

78
## 0.61.0
89

src/eca/features/login.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@
9090
(swap! db* assoc-in [:chats chat-id :login-provider] nil)
9191
(swap! db* assoc-in [:chats chat-id :status] :idle)
9292
(when-not silent?
93-
(send-msg! (format "Login successful! You can now use the '%s' models." provider))))
93+
(send-msg! (format "\nLogin successful! You can now use the '%s' models." provider))))

src/eca/llm_api.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[eca.llm-providers.azure]
88
[eca.llm-providers.copilot]
99
[eca.llm-providers.deepseek]
10+
[eca.llm-providers.google]
1011
[eca.llm-providers.ollama :as llm-providers.ollama]
1112
[eca.llm-providers.openai :as llm-providers.openai]
1213
[eca.llm-providers.openai-chat :as llm-providers.openai-chat]

src/eca/llm_providers/google.clj

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,12 @@
22
(:require
33
[clojure.string :as string]
44
[eca.config :as config]
5-
[eca.features.login :as f.login]
6-
[eca.shared :refer [multi-str]]))
5+
[eca.features.login :as f.login]))
76

87
(defmethod f.login/login-step ["google" :login/start] [{:keys [db* chat-id provider send-msg!]}]
98
(swap! db* assoc-in [:chats chat-id :login-provider] provider)
10-
(swap! db* assoc-in [:auth provider] {:step :login/waiting-login-method})
11-
(send-msg! (multi-str "Now, inform the login method:"
12-
""
13-
"manual: Manually enter API Key")))
14-
15-
(defmethod f.login/login-step ["google" :login/waiting-login-method] [{:keys [db* input provider send-msg!]}]
16-
(case input
17-
"manual"
18-
(do
19-
(swap! db* assoc-in [:auth provider] {:step :login/waiting-api-key
20-
:mode :manual})
21-
(send-msg! "Paste your google API Key"))
22-
(send-msg! (format "Unknown login method '%s'. Inform one of the options: max, console, manual" input))))
9+
(swap! db* assoc-in [:auth provider] {:step :login/waiting-api-key})
10+
(send-msg! "Paste your google API Key"))
2311

2412
(defmethod f.login/login-step ["google" :login/waiting-api-key] [{:keys [db* input provider send-msg!] :as ctx}]
2513
(if (not (string/blank? input))

0 commit comments

Comments
 (0)