lex-transformer 0.3.5 → 0.3.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/.github/workflows/ci.yml +4 -4
- data/.rubocop.yml +16 -39
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -0
- data/lib/legion/extensions/transformer/client.rb +2 -2
- data/lib/legion/extensions/transformer/definitions.rb +1 -1
- data/lib/legion/extensions/transformer/engines/llm.rb +3 -3
- data/lib/legion/extensions/transformer/transport.rb +1 -1
- data/lib/legion/extensions/transformer/version.rb +1 -1
- data/lib/legion/extensions/transformer.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: 10e195224847a9d3119c19f1569959d35b68201f84e30ca0ec4cf8627e674be0
|
|
4
|
+
data.tar.gz: 414298a96a53d1f5ad820444bc6e73f0eb271dbe707aa61b3cc2eecf1532bc95
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 18888c7c12edbc4776272f958088a096d6106d776c5c43af9bb772c31694dc4473b7d098c8c79e9eac3e45e3f65a796e2a2eb485fa25a70f515586232417c614
|
|
7
|
+
data.tar.gz: 9bfbe539fe75e4283c94b0913884c3012d22f1a03cc1a0dd33d06346898934b52386be4ce3f51e97acda2e2aa5d74b700981688749a0565a6710f5ad59f8c7ae
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -10,8 +10,8 @@ jobs:
|
|
|
10
10
|
ci:
|
|
11
11
|
uses: LegionIO/.github/.github/workflows/ci.yml@main
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
uses: LegionIO/.github/.github/workflows/
|
|
13
|
+
excluded-files:
|
|
14
|
+
uses: LegionIO/.github/.github/workflows/excluded-files.yml@main
|
|
15
15
|
|
|
16
16
|
security:
|
|
17
17
|
uses: LegionIO/.github/.github/workflows/security-scan.yml@main
|
|
@@ -27,8 +27,8 @@ jobs:
|
|
|
27
27
|
uses: LegionIO/.github/.github/workflows/stale.yml@main
|
|
28
28
|
|
|
29
29
|
release:
|
|
30
|
-
needs: [ci,
|
|
30
|
+
needs: [ci, excluded-files]
|
|
31
31
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
32
32
|
uses: LegionIO/.github/.github/workflows/release.yml@main
|
|
33
33
|
secrets:
|
|
34
|
-
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
34
|
+
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
|
data/.rubocop.yml
CHANGED
|
@@ -1,49 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
NewCops: enable
|
|
4
|
-
SuggestExtensions: false
|
|
1
|
+
inherit_gem:
|
|
2
|
+
rubocop-legion: config/lex.yml
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
|
9
|
-
EnforcedStyle: space
|
|
10
|
-
Layout/HashAlignment:
|
|
11
|
-
EnforcedHashRocketStyle: table
|
|
12
|
-
EnforcedColonStyle: table
|
|
13
|
-
|
|
14
|
-
Metrics/MethodLength:
|
|
15
|
-
Max: 50
|
|
16
|
-
Metrics/ClassLength:
|
|
17
|
-
Max: 1500
|
|
18
|
-
Metrics/ModuleLength:
|
|
19
|
-
Max: 1500
|
|
20
|
-
Metrics/BlockLength:
|
|
21
|
-
Max: 40
|
|
22
|
-
Exclude:
|
|
23
|
-
- 'spec/**/*'
|
|
24
|
-
Metrics/AbcSize:
|
|
25
|
-
Max: 60
|
|
26
|
-
Metrics/CyclomaticComplexity:
|
|
27
|
-
Max: 15
|
|
28
|
-
Metrics/PerceivedComplexity:
|
|
29
|
-
Max: 17
|
|
30
|
-
Metrics/ParameterLists:
|
|
4
|
+
# data_required? true but uses legion-data tables (no own migrations directory)
|
|
5
|
+
Legion/Extension/DataRequiredWithoutMigrations:
|
|
31
6
|
Enabled: false
|
|
32
7
|
|
|
33
|
-
|
|
8
|
+
# Private helpers and non-runner methods return non-Hash values by design
|
|
9
|
+
Legion/Extension/RunnerReturnHash:
|
|
34
10
|
Enabled: false
|
|
35
|
-
Style/SymbolArray:
|
|
36
|
-
Enabled: true
|
|
37
|
-
Style/FrozenStringLiteralComment:
|
|
38
|
-
Enabled: true
|
|
39
|
-
EnforcedStyle: always
|
|
40
11
|
|
|
41
|
-
|
|
12
|
+
# Methods legitimately need many named parameters for transformation flexibility
|
|
13
|
+
Metrics/ParameterLists:
|
|
42
14
|
Enabled: false
|
|
43
|
-
|
|
15
|
+
|
|
16
|
+
# Class instance variables are used for lazy initialization patterns by design
|
|
17
|
+
ThreadSafety/ClassInstanceVariable:
|
|
44
18
|
Enabled: false
|
|
45
|
-
|
|
19
|
+
|
|
20
|
+
# Client and engine classes use Legion::JSON directly; helper mixin not included
|
|
21
|
+
Legion/HelperMigration/DirectJson:
|
|
46
22
|
Enabled: false
|
|
47
23
|
|
|
48
|
-
|
|
24
|
+
# Engine classes call Legion::LLM directly; helper mixin not included
|
|
25
|
+
Legion/HelperMigration/DirectLlm:
|
|
49
26
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
|
@@ -79,7 +79,7 @@ module Legion
|
|
|
79
79
|
client = Legion::Extensions::Conditioner::Client.new
|
|
80
80
|
result = client.evaluate(conditions: conditions, values: payload)
|
|
81
81
|
result[:passed]
|
|
82
|
-
rescue StandardError
|
|
82
|
+
rescue StandardError => _e
|
|
83
83
|
true
|
|
84
84
|
end
|
|
85
85
|
|
|
@@ -95,7 +95,7 @@ module Legion
|
|
|
95
95
|
return rendered unless rendered.is_a?(String)
|
|
96
96
|
|
|
97
97
|
Legion::JSON.load(rendered)
|
|
98
|
-
rescue StandardError
|
|
98
|
+
rescue StandardError => _e
|
|
99
99
|
rendered
|
|
100
100
|
end
|
|
101
101
|
end
|
|
@@ -52,7 +52,7 @@ module Legion
|
|
|
52
52
|
|
|
53
53
|
settings = begin
|
|
54
54
|
Legion::Settings.dig('lex-transformer', 'llm')
|
|
55
|
-
rescue StandardError
|
|
55
|
+
rescue StandardError => _e
|
|
56
56
|
nil
|
|
57
57
|
end
|
|
58
58
|
return {} unless settings.is_a?(Hash)
|
|
@@ -65,9 +65,9 @@ module Legion
|
|
|
65
65
|
content = extract_response(chat)
|
|
66
66
|
validate_json(content)
|
|
67
67
|
content
|
|
68
|
-
rescue Timeout::Error, IOError, Errno::ECONNREFUSED, Errno::ECONNRESET
|
|
68
|
+
rescue Timeout::Error, IOError, Errno::ECONNREFUSED, Errno::ECONNRESET => _e
|
|
69
69
|
:retry
|
|
70
|
-
rescue ::JSON::ParserError
|
|
70
|
+
rescue ::JSON::ParserError => _e
|
|
71
71
|
@last_raw = content
|
|
72
72
|
:retry
|
|
73
73
|
rescue RuntimeError => e
|
|
@@ -6,7 +6,7 @@ require_relative 'transformer/client'
|
|
|
6
6
|
module Legion
|
|
7
7
|
module Extensions
|
|
8
8
|
module Transformer
|
|
9
|
-
extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core
|
|
9
|
+
extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core, false
|
|
10
10
|
|
|
11
11
|
def self.data_required?
|
|
12
12
|
true
|