Feat/data hub#59
Conversation
…ASIC_USAGE, update codegen
Signed-off-by: Devyash Saini <dysaini2004@gmail.com>
Greptile SummaryThis PR renames the
Confidence Score: 3/5The rename is internally consistent, but the changeset labels a breaking public API removal as a patch release, which would cause silent runtime failures for existing consumers without a proper version signal. The removal of the .changeset/eager-bottles-train.md needs the bump type corrected before this ships; examples/ai-sdk-wrapper-usage.ts has an unused result variable worth addressing. Important Files Changed
|
| --- | ||
| "@scrawn/analytics": patch | ||
| --- |
There was a problem hiding this comment.
The changeset bump type is
patch, but removing sdkEvent from the publicly exported EventQueries interface and replacing it with basicUsage is a breaking change for any consumer currently calling analytics.query.sdkEvent. Per semver, dropping a named property from a published interface requires at minimum a minor bump, and strictly a major if the package is >= 1.0. Existing user code that destructures sdkEvent will fail at runtime with no compile-time warning until they update.
| --- | |
| "@scrawn/analytics": patch | |
| --- | |
| --- | |
| "@scrawn/analytics": major | |
| --- |
| const result1 = await ai.streamText({ | ||
| model: google("gemini-2.5-flash"), | ||
| prompt: "Write a 2 sentence story about a robot.", | ||
| onFinish: (event) => { | ||
| biller.trackAI({ | ||
| userId: "c0971bcb-b901-4c3e-a191-c9a97871c39f", | ||
| event, | ||
| inputDebit: biller.tag("PREMIUM_CALL"), | ||
| outputDebit: mul(outputTokens(), 0.0001), | ||
| }); | ||
| }, | ||
| }); | ||
|
|
||
| console.log(`Generated: "${await result.text}"\n`); |
There was a problem hiding this comment.
result1 is assigned but never used — the console.log at the end only reads result.text. Since ai.streamText returns a StreamTextResult, the stream is opened but its output is silently discarded. If the intent is to show the response, result1.text should be logged; if the intent is only to demonstrate the onFinish billing hook, the assignment can be dropped entirely.
| const result1 = await ai.streamText({ | |
| model: google("gemini-2.5-flash"), | |
| prompt: "Write a 2 sentence story about a robot.", | |
| onFinish: (event) => { | |
| biller.trackAI({ | |
| userId: "c0971bcb-b901-4c3e-a191-c9a97871c39f", | |
| event, | |
| inputDebit: biller.tag("PREMIUM_CALL"), | |
| outputDebit: mul(outputTokens(), 0.0001), | |
| }); | |
| }, | |
| }); | |
| console.log(`Generated: "${await result.text}"\n`); | |
| const result1 = await ai.streamText({ | |
| model: google("gemini-2.5-flash"), | |
| prompt: "Write a 2 sentence story about a robot.", | |
| onFinish: (event) => { | |
| biller.trackAI({ | |
| userId: "c0971bcb-b901-4c3e-a191-c9a97871c39f", | |
| event, | |
| inputDebit: biller.tag("PREMIUM_CALL"), | |
| outputDebit: mul(outputTokens(), 0.0001), | |
| }); | |
| }, | |
| }); | |
| console.log(`Generated (wrapped): "${await result.text}"\n`); | |
| console.log(`Generated (raw): "${await result1.text}"\n`); |
No description provided.