Skip to content

Commit e702490

Browse files
committed
chore: Add modelName, sessionId, requestId usage (#5670)
https://linear.app/thirdweb/issue/DASH-574/add-nebula-usage-tracker-events <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces additional properties to the `usageEventSchema` in the `service-utils` package, enhancing the tracking of usage events by including identifiers for the model, session, and request. ### Detailed summary - Added `modelName`, `sessionId`, and `requestId` as optional string fields to the `usageEventSchema` in `packages/service-utils/src/core/usage.ts`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 3b53732 commit e702490

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/gold-gorillas-clap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/service-utils": patch
3+
---
4+
5+
Add modelName, sessionId, requestId to usage

packages/service-utils/src/core/usage.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,8 @@ export const usageEventSchema = z.object({
7878
providerIp: z.string().optional(),
7979
promptTokens: z.number().int().nonnegative().optional(),
8080
completionTokens: z.number().int().nonnegative().optional(),
81+
modelName: z.string().optional(),
82+
sessionId: z.string().optional(),
83+
requestId: z.string().optional(),
8184
});
8285
export type UsageEvent = z.infer<typeof usageEventSchema>;

0 commit comments

Comments
 (0)