Conversation
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| @@ -203,6 +224,11 @@ def config(config_key, context, default_value = nil, variables = nil) | |||
| provider: provider_config | |||
| ) | |||
| end | |||
There was a problem hiding this comment.
There should be a break between methods here.
There was a problem hiding this comment.
Added a blank line between the methods.
lib/server/ai/client.rb
Outdated
| TRACK_SDK_INFO, | ||
| INIT_TRACK_CONTEXT, | ||
| { | ||
| aiSdkName: 'launchdarkly-server-sdk-ai', |
There was a problem hiding this comment.
In other sdk's we kept this information in an sdk info / meta type file so it could be used in other places if needed.
There was a problem hiding this comment.
Extracted SDK info into a dedicated lib/server/ai/sdk_info.rb module with SDK_NAME and SDK_LANGUAGE constants (similar to sdkInfo.ts in JS and sdk_info.py in Python). The client now references those constants instead of hardcoded strings.
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
Requirements
Related issues
Describe the solution you've provided
Aligns the Ruby AI SDK's usage tracking with the updated spec from sdk-specs PR #132. Three categories of changes:
Renamed usage tracking event key from
$ld:ai:config:function:singleto$ld:ai:usage:completion-config, matching the new unified$ld:ai:usage:*namespace. (This SDK only has the single completion config method — no judge, agent, or createChat methods — so only one key needed updating.)Added SDK info tracking on initialization (
$ld:ai:sdk-info). WhenClientis constructed, it fires a single tracking event with SDK name, version, and language using an anonymous internal context. This satisfies spec requirement 1.2.2.1 and ensures data is captured even if the config tracker is never used. SDK identity constants are kept in a dedicatedsdk_info.rbmodule (similar tosdkInfo.tsin JS andsdk_info.pyin Python).Renamed
configtocompletion_configto align with the updated spec method naming. The oldconfigmethod is preserved as a deprecated proxy that emits a warning and delegates tocompletion_config.Human review checklist
$ld:ai:usage:completion-configexactly matches the spec — a typo here would silently break reportingLDContext.create(key: 'ld-internal-tracking', anonymous: true)) matches spec requirement 1.2.2.1INIT_TRACK_CONTEXTbeing created at module load time (outsideclass Client) is acceptable — it callsLDContext.createwhen the module is first loadedconfig(emittingwarnon every call) is acceptable for existing consumers — this could be noisy if callers haven't migrated yetAdditional context