feat(server-ai): stamp modelKey and modelVersion on AI usage events (AIC-2858)#1794
feat(server-ai): stamp modelKey and modelVersion on AI usage events (AIC-2858)#1794atornsii wants to merge 1 commit into
Conversation
…AIC-2858) Read modelKey and modelVersion from the AI Config variation payload and stamp them on emitted metric events alongside existing modelName and providerName fields. Default modelVersion to 1 when absent and exclude both fields from the resumption token. Additive and backward compatible. Co-authored-by: Anthony Torns II <atornsii@users.noreply.github.com>
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/browser size report |
|
Holding based on our conversation today and we will follow up on slack before reviewing. |
Requirements
Related issues
Describe the solution you've provided
Read
modelKeyandmodelVersionfrom the AI Config variation payload (variation.model) and stamp them on allLDAIConfigTrackermetric event payloads, alongside existingmodelName/providerNamefields.modelKey/modelVersiontoLDModelConfigLDAIConfigTrackerImplfromLDAIClientImpl._evaluatemodelVersion(always) andmodelKey(when present) ingetTrackData()modelVersionto1when absent; exclude both fields from the resumption tokenDescribe alternatives you've considered
None — this mirrors the established pattern from the Go and Python SDK implementations.
Additional context
Tech spec: Models Primitive Improvements
Test plan
yarn workspace @launchdarkly/server-sdk-ai test(241 passed)yarn workspace @launchdarkly/server-sdk-ai lintyarn workspaces foreach -pR --topological-dev --from '@launchdarkly/server-sdk-ai' run build