launchdarkly-server-sdk-ai 0.4.0 → 0.5.0
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 +8 -0
- data/PROVENANCE.md +1 -1
- data/SECURITY.md +5 -2
- data/lib/server/ai/ai_config_tracker.rb +11 -3
- data/lib/server/ai/client.rb +4 -0
- data/lib/server/ai/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b23fa19941fcf0773e891e61be94c5761a0889cf2c7a5b362f9b4e0e5986b6ba
|
|
4
|
+
data.tar.gz: 4ca5652c32a43e51b39f0a00bca215bd2bc4d1db1340da04441b33d48ccdc758
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a51ee90183e5421ea039d3340ca107b36100e24bfcaf8a496ded3a461424fb0e5a8adffa46ba802519db976d290f50443386aa6c8c317bb4ebac1d61675f608e
|
|
7
|
+
data.tar.gz: 84cc8dd823cd58a6880fa819ed5f1485cdfc1324422cd4124905175400287dbe351319e4581b30c821410ab74e1a6b58e4d553cb5b0e5068a39d56dd0d31348d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0](https://github.com/launchdarkly/ruby-server-sdk-ai/compare/0.4.0...0.5.0) (2026-09-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **server-ai:** stamp modelKey and modelVersion on AI usage events (AIC-2857) ([#36](https://github.com/launchdarkly/ruby-server-sdk-ai/issues/36)) ([2f7fda4](https://github.com/launchdarkly/ruby-server-sdk-ai/commit/2f7fda4d57b09483cf15fda6e3102e24b1eecb27))
|
|
9
|
+
|
|
10
|
+
|
|
3
11
|
## [0.4.0](https://github.com/launchdarkly/ruby-server-sdk-ai/compare/0.3.0...0.4.0) (2026-05-15)
|
|
4
12
|
|
|
5
13
|
|
data/PROVENANCE.md
CHANGED
data/SECURITY.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Reporting and Fixing Security Issues
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Do not open Issues or Pull Requests for security issues.**
|
|
4
|
+
This will make potential issues publicly visible before LaunchDarkly's Security Team can address them, which could lead to a compromise of the platform and negatively impact our customers.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Security issues must be reported through our [Bug Bounty program](https://bugcrowd.com/engagements/launchdarkly-mbb-og), following the program policy, for triage and remediation by the LaunchDarkly Security Team. Valid security issues may be eligible for a bounty.
|
|
7
|
+
|
|
8
|
+
Please do not attempt to directly contact members of LaunchDarkly staff.
|
|
@@ -51,7 +51,8 @@ module LaunchDarkly
|
|
|
51
51
|
# tracker reconstructed in another process share the original runId.
|
|
52
52
|
#
|
|
53
53
|
class AIConfigTracker
|
|
54
|
-
attr_reader :ld_client, :config_key, :context, :variation_key, :version, :summary, :model_name, :provider_name
|
|
54
|
+
attr_reader :ld_client, :config_key, :context, :variation_key, :version, :summary, :model_name, :provider_name,
|
|
55
|
+
:model_key, :model_version
|
|
55
56
|
|
|
56
57
|
#
|
|
57
58
|
# Initialize a new AIConfigTracker instance.
|
|
@@ -62,15 +63,20 @@ module LaunchDarkly
|
|
|
62
63
|
# @param version [Integer] The version number
|
|
63
64
|
# @param model_name [String] The name of the AI model being used
|
|
64
65
|
# @param provider_name [String] The name of the AI provider
|
|
66
|
+
# @param model_key [String, nil] The stable, unique key of the model used
|
|
67
|
+
# @param model_version [Integer] The pinned version of the model used
|
|
65
68
|
# @param context [LDContext] The context used for the flag evaluation
|
|
66
69
|
#
|
|
67
|
-
def initialize(ld_client:, run_id:, config_key:, variation_key:, version:, context:, model_name:, provider_name
|
|
70
|
+
def initialize(ld_client:, run_id:, config_key:, variation_key:, version:, context:, model_name:, provider_name:,
|
|
71
|
+
model_key: nil, model_version: 1)
|
|
68
72
|
@ld_client = ld_client
|
|
69
73
|
@variation_key = variation_key
|
|
70
74
|
@config_key = config_key
|
|
71
75
|
@version = version
|
|
72
76
|
@model_name = model_name
|
|
73
77
|
@provider_name = provider_name
|
|
78
|
+
@model_key = model_key
|
|
79
|
+
@model_version = model_version
|
|
74
80
|
@context = context
|
|
75
81
|
@summary = MetricSummary.new
|
|
76
82
|
@run_id = run_id
|
|
@@ -82,7 +88,7 @@ module LaunchDarkly
|
|
|
82
88
|
# a tracker in a different process (e.g. for deferred feedback).
|
|
83
89
|
#
|
|
84
90
|
# The token contains: runId, configKey, variationKey, version.
|
|
85
|
-
# modelName and
|
|
91
|
+
# modelName, providerName, modelKey, and modelVersion are NOT included.
|
|
86
92
|
#
|
|
87
93
|
# @return [String] the resumption token
|
|
88
94
|
#
|
|
@@ -328,8 +334,10 @@ module LaunchDarkly
|
|
|
328
334
|
version: @version,
|
|
329
335
|
modelName: @model_name,
|
|
330
336
|
providerName: @provider_name,
|
|
337
|
+
modelVersion: @model_version,
|
|
331
338
|
}
|
|
332
339
|
data[:variationKey] = @variation_key if @variation_key && !@variation_key.empty?
|
|
340
|
+
data[:modelKey] = @model_key if @model_key && !@model_key.empty?
|
|
333
341
|
data
|
|
334
342
|
end
|
|
335
343
|
|
data/lib/server/ai/client.rb
CHANGED
|
@@ -294,6 +294,8 @@ module LaunchDarkly
|
|
|
294
294
|
version = variation.dig(:_ldMeta, :version) || 1
|
|
295
295
|
model_name = model&.name || ''
|
|
296
296
|
provider_name = provider_config&.name || ''
|
|
297
|
+
model_key = variation.dig(:_ldMeta, :modelKey)
|
|
298
|
+
model_version = (variation.dig(:_ldMeta, :modelVersion) || 1).to_i
|
|
297
299
|
|
|
298
300
|
tracker_factory = lambda {
|
|
299
301
|
LaunchDarkly::Server::AI::AIConfigTracker.new(
|
|
@@ -304,6 +306,8 @@ module LaunchDarkly
|
|
|
304
306
|
version: version,
|
|
305
307
|
model_name: model_name,
|
|
306
308
|
provider_name: provider_name,
|
|
309
|
+
model_key: model_key,
|
|
310
|
+
model_version: model_version,
|
|
307
311
|
context: context
|
|
308
312
|
)
|
|
309
313
|
}
|
data/lib/server/ai/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: launchdarkly-server-sdk-ai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- LaunchDarkly
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|