lex-azure-ai 0.1.4 → 0.1.5
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/CHANGELOG.md +5 -0
- data/CLAUDE.md +5 -3
- data/README.md +4 -0
- data/lib/legion/extensions/azure_ai/identity.rb +44 -0
- data/lib/legion/extensions/azure_ai/version.rb +1 -1
- data/lib/legion/extensions/azure_ai.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 50b44ac86434baef4d4785bba33648f17e07b96a6125577eb25b29e3c86f5afd
|
|
4
|
+
data.tar.gz: 78fe4d4f72b77b6dafd0e345f899f7fb6cfc2c25579d9bf12730dbd26b076c1a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a7847f2bc75bc194f658d2905e7de87a4861806cdc64f619af4239ae2011a5f1594ea54b8e6f375c9d21ffeea050b5c87a5d6ac8682d8ef16b2831454347b581
|
|
7
|
+
data.tar.gz: 0024aa7e40b52c94845561b379d3d2e668420209806ca149b903851189606924e4ea69cd1eea38c66d2a2ef79fcb1113e5dea6e342768ffe5768266d6bb41cbc
|
data/CHANGELOG.md
CHANGED
data/CLAUDE.md
CHANGED
|
@@ -10,8 +10,8 @@ Legion Extension that connects LegionIO to Azure AI Services (Azure OpenAI). Pro
|
|
|
10
10
|
|
|
11
11
|
**GitHub**: https://github.com/LegionIO/lex-azure-ai
|
|
12
12
|
**License**: MIT
|
|
13
|
-
**Version**: 0.1.
|
|
14
|
-
**Specs**:
|
|
13
|
+
**Version**: 0.1.5
|
|
14
|
+
**Specs**: 35 examples (4 spec files)
|
|
15
15
|
|
|
16
16
|
## Architecture
|
|
17
17
|
|
|
@@ -44,15 +44,17 @@ Legion::Extensions::AzureAi
|
|
|
44
44
|
|-----|---------|
|
|
45
45
|
| `faraday` >= 2.0 | HTTP client for Azure OpenAI API |
|
|
46
46
|
| `multi_json` | JSON parser abstraction |
|
|
47
|
+
| `legion-cache`, `legion-crypt`, `legion-data`, `legion-json`, `legion-logging`, `legion-settings`, `legion-transport` | LegionIO core |
|
|
47
48
|
|
|
48
49
|
## Testing
|
|
49
50
|
|
|
50
51
|
```bash
|
|
51
52
|
bundle install
|
|
52
|
-
bundle exec rspec #
|
|
53
|
+
bundle exec rspec # 35 examples
|
|
53
54
|
bundle exec rubocop
|
|
54
55
|
```
|
|
55
56
|
|
|
56
57
|
---
|
|
57
58
|
|
|
58
59
|
**Maintained By**: Matthew Iverson (@Esity)
|
|
60
|
+
**Last Updated**: 2026-04-06
|
data/README.md
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module AzureAi
|
|
6
|
+
module Identity
|
|
7
|
+
module_function
|
|
8
|
+
|
|
9
|
+
def provider_name = :azure
|
|
10
|
+
def provider_type = :credential
|
|
11
|
+
def facing = nil
|
|
12
|
+
def capabilities = %i[credentials]
|
|
13
|
+
|
|
14
|
+
def resolve(canonical_name: nil) # rubocop:disable Lint/UnusedMethodArgument
|
|
15
|
+
nil
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def provide_token
|
|
19
|
+
api_key = resolve_api_key
|
|
20
|
+
return nil unless api_key
|
|
21
|
+
|
|
22
|
+
Legion::Identity::Lease.new(
|
|
23
|
+
provider: :azure,
|
|
24
|
+
credential: api_key,
|
|
25
|
+
expires_at: nil,
|
|
26
|
+
renewable: false,
|
|
27
|
+
issued_at: Time.now,
|
|
28
|
+
metadata: { credential_type: :api_key }
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def resolve_api_key
|
|
33
|
+
return nil unless defined?(Legion::Settings)
|
|
34
|
+
|
|
35
|
+
value = Legion::Settings.dig(:llm, :providers, :azure, :api_key)
|
|
36
|
+
value = value.find { |v| v && !v.empty? } if value.is_a?(Array)
|
|
37
|
+
value unless value.nil? || (value.is_a?(String) && (value.empty? || value.start_with?('env://')))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
private_class_method :resolve_api_key
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -6,6 +6,7 @@ require 'legion/extensions/azure_ai/runners/chat'
|
|
|
6
6
|
require 'legion/extensions/azure_ai/runners/embeddings'
|
|
7
7
|
require 'legion/extensions/azure_ai/runners/models'
|
|
8
8
|
require 'legion/extensions/azure_ai/client'
|
|
9
|
+
require 'legion/extensions/azure_ai/identity'
|
|
9
10
|
|
|
10
11
|
module Legion
|
|
11
12
|
module Extensions
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lex-azure-ai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esity
|
|
@@ -157,6 +157,7 @@ files:
|
|
|
157
157
|
- lib/legion/extensions/azure_ai.rb
|
|
158
158
|
- lib/legion/extensions/azure_ai/client.rb
|
|
159
159
|
- lib/legion/extensions/azure_ai/helpers/client.rb
|
|
160
|
+
- lib/legion/extensions/azure_ai/identity.rb
|
|
160
161
|
- lib/legion/extensions/azure_ai/runners/chat.rb
|
|
161
162
|
- lib/legion/extensions/azure_ai/runners/embeddings.rb
|
|
162
163
|
- lib/legion/extensions/azure_ai/runners/models.rb
|