Skip to content

Commit 503ccc5

Browse files
atornsiiclaude
andcommitted
fix(server-ai): rename tracked_model_version to model_version
Addresses Jason's review nit: renames the local var to match its sibling model_key and moves its assignment down next to it, instead of computing it early and separately from the rest of the meta reads. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 25d962e commit 503ccc5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/server/ai/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ def _completion_config(key:, context:, default:, variables: nil)
280280
provider_config = ProviderConfig.new(provider_config.fetch(:name, ''))
281281
end
282282

283-
tracked_model_version = (variation.dig(:_ldMeta, :modelVersion) || 1).to_i
284283
if (model = variation[:model]) && model.is_a?(Hash)
285284
parameters = variation[:model][:parameters]
286285
custom = variation[:model][:custom]
@@ -296,6 +295,7 @@ def _completion_config(key:, context:, default:, variables: nil)
296295
model_name = model&.name || ''
297296
provider_name = provider_config&.name || ''
298297
model_key = variation.dig(:_ldMeta, :modelKey)
298+
model_version = (variation.dig(:_ldMeta, :modelVersion) || 1).to_i
299299

300300
tracker_factory = lambda {
301301
LaunchDarkly::Server::AI::AIConfigTracker.new(
@@ -307,7 +307,7 @@ def _completion_config(key:, context:, default:, variables: nil)
307307
model_name: model_name,
308308
provider_name: provider_name,
309309
model_key: model_key,
310-
model_version: tracked_model_version,
310+
model_version: model_version,
311311
context: context
312312
)
313313
}

0 commit comments

Comments
 (0)