-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Labels
bugSomething isn't workingSomething isn't workingpackage: sdk/server-aiLabel for issues affecting the server AI package.Label for issues affecting the server AI package.
Description
Describe the bug
AI SDK v5’s streamText and generateText functions return usage with inputTokens/outputTokens/totalTokens. The LD helper trackVercelAISDKStreamTextMetrics and createVercelAISDKTokenUsage is still looking for promptTokens/completionTokens from v4, so it reads undefined and emits 0.
To reproduce
wrap streamText in trackVercelAISDKStreamTextMetrics - duration metrics are tracked but token use is not
Expected behavior
Token use is appropriately tracked in Vercel AI SDK v4 and v5
Logs
n/a
SDK version
"@launchdarkly/server-sdk-ai": "^0.11.0"
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpackage: sdk/server-aiLabel for issues affecting the server AI package.Label for issues affecting the server AI package.