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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1bdaa1e6cd790510ce57f6e0d63b3719f571ec7b5299cecc430995158240897
4
- data.tar.gz: bca165be2cc34d56f742d1d36ed89f199ba9a48c6d9e9f9fea88d1397d5af89f
3
+ metadata.gz: b23fa19941fcf0773e891e61be94c5761a0889cf2c7a5b362f9b4e0e5986b6ba
4
+ data.tar.gz: 4ca5652c32a43e51b39f0a00bca215bd2bc4d1db1340da04441b33d48ccdc758
5
5
  SHA512:
6
- metadata.gz: 3586d99728f38b474dce7a35d9721a1871610f65eb1336070cce5bad4dbff557181c4956fb25e4b6d5230e18fe0da5c43281164bdb387de4a98d3d4b3d42f09c
7
- data.tar.gz: 1f80b447eb3f615380b353ec87b88fb2c997e332a6515adf60bb9322d3d76a625e4a4f061ca536c1a19ecca052d67e90a433df67cd717ad3836d14c5a7dfd8fe
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
@@ -9,7 +9,7 @@ To verify build provenance attestations, we recommend using the [GitHub CLI `att
9
9
  <!-- x-release-please-start-version -->
10
10
  ```
11
11
  # Set the version of the library to verify
12
- VERSION=0.4.0
12
+ VERSION=0.5.0
13
13
  ```
14
14
  <!-- x-release-please-end -->
15
15
 
data/SECURITY.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Reporting and Fixing Security Issues
2
2
 
3
- Please report all security issues to the LaunchDarkly security team by submitting a bug bounty report to our [HackerOne program](https://hackerone.com/launchdarkly?type=team). LaunchDarkly will triage and address all valid security issues following the response targets defined in our program policy. Valid security issues may be eligible for a bounty.
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
- Please do not open issues or pull requests for security issues. This makes the problem immediately visible to everyone, including potentially malicious actors.
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 providerName are NOT included.
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
 
@@ -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
  }
@@ -3,7 +3,7 @@
3
3
  module LaunchDarkly
4
4
  module Server
5
5
  module AI
6
- VERSION = '0.4.0' # x-release-please-version
6
+ VERSION = '0.5.0' # x-release-please-version
7
7
  end
8
8
  end
9
9
  end
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.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-05-15 00:00:00.000000000 Z
11
+ date: 2026-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64