ask-agent 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ask/agent/chat.rb +14 -6
- data/lib/ask/agent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 23e169387a3dfe5b2f74e623ebe467d11a51518f7258aff69467955d7cd8b006
|
|
4
|
+
data.tar.gz: 1953b7ad69838440837864b8d39b56cced33ab4959eea3ffdc5eaa479dc8946a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be8d999d26b967e996b8f3b72e5a1bbdf34b79446d3903e91e3d2ff1e65ba102cdd63a77a5abf40bcbbb5b9855b969cd79e6509c42c491ef749c0e2437474ed6
|
|
7
|
+
data.tar.gz: 3e96cd7d4bbebddf7ef7131a7adae6f086fd57c84740f88c50f21175f482e6d29a366936c174953e4217302721d565cb1b7f1dfeaf83206d3652202527cb4333
|
data/lib/ask/agent/chat.rb
CHANGED
|
@@ -119,13 +119,21 @@ module Ask
|
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
def provider_config(slug)
|
|
122
|
-
# Try
|
|
123
|
-
#
|
|
124
|
-
#
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
# Try credential names from most to least specific:
|
|
123
|
+
# 1. Flat key with full slug (opencode_go_api_key)
|
|
124
|
+
# 2. Nested path with full slug ([:opencode, :go, :api_key])
|
|
125
|
+
# 3. Flat key with base slug (opencode_api_key)
|
|
126
|
+
# 4. Nested path with base slug ([:opencode, :api_key])
|
|
127
|
+
slug_s = slug.to_s
|
|
128
|
+
base_s = slug_s.include?("_") ? slug_s.split("_").first : nil
|
|
129
|
+
|
|
130
|
+
cred_names = [:"#{slug_s}_api_key"]
|
|
131
|
+
cred_names << slug_s.split("_").map(&:to_sym).push(:api_key) if slug_s.include?("_")
|
|
132
|
+
if base_s
|
|
133
|
+
cred_names << :"#{base_s}_api_key"
|
|
134
|
+
cred_names << [base_s.to_sym, :api_key]
|
|
128
135
|
end
|
|
136
|
+
|
|
129
137
|
key = Ask::Auth.resolve(*cred_names) rescue nil
|
|
130
138
|
|
|
131
139
|
base_url = Ask::Auth.resolve(:"#{slug}_api_base") rescue nil
|
data/lib/ask/agent/version.rb
CHANGED