ask-llm-providers 0.8.5 → 0.8.6
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/llm/version.rb +1 -1
- data/lib/ask/provider/openai_compatible.rb +12 -2
- 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: 211eb4cd29010d57e87c742adea03ee891fedcea11b55f1c9e1ef9674dbdeeee
|
|
4
|
+
data.tar.gz: da4a556126e2c2beb180b560e0045a71f689195599649b16ba3ede4e8cb6dac0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9f81cd0be9fe948bc4e01c263f24698037b3b3a9aedda82fda53d874cc314603f02f02f9820081a5c99c22ca0a6a521df38c12dd21c82125aaf11f3eb7c76d21
|
|
7
|
+
data.tar.gz: 4eb6a604ef5564e4ba722620fd47d1603876746810e4f3442ae53c2368fb983ea43dd0690d086ac99ee7cae5bd5c2a11ffcff432c803b715ad61941b6a3f6b13
|
data/lib/ask/llm/version.rb
CHANGED
|
@@ -105,8 +105,18 @@ module Ask
|
|
|
105
105
|
env_name = @compat_cfg[:api_key_env]
|
|
106
106
|
return nil unless env_name
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
s = env_name.to_s
|
|
109
|
+
# Try as a flat key (e.g., :opencode_api_key)
|
|
110
|
+
# and as a nested path by keeping the parent portion before _API_KEY
|
|
111
|
+
# as the first segment and :api_key as the second (e.g., [:opencode, :api_key])
|
|
112
|
+
flat = s.downcase.to_sym
|
|
113
|
+
nested = nil
|
|
114
|
+
if s.end_with?("_API_KEY")
|
|
115
|
+
parent = s.delete_suffix("_API_KEY").downcase
|
|
116
|
+
nested = [parent.to_sym, :api_key] unless parent.empty?
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
Ask::Auth.resolve(flat, nested)
|
|
110
120
|
rescue StandardError
|
|
111
121
|
nil
|
|
112
122
|
end
|