From a2f4d78d444db222c87fff3e6553dbc430af72a7 Mon Sep 17 00:00:00 2001 From: HugoRCD <71938701+HugoRCD@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:40:40 +0000 Subject: [PATCH 1/3] docs: add cost estimation and tool timing features to AI SDK Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com> --- .vercel/project.json | 5 ++++ .../app/components/features/FeatureAiSdk.vue | 27 +++++++++++++++---- apps/docs/content/0.landing.md | 2 +- bun.lock | 1 + 4 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 .vercel/project.json diff --git a/.vercel/project.json b/.vercel/project.json new file mode 100644 index 00000000..ad59a829 --- /dev/null +++ b/.vercel/project.json @@ -0,0 +1,5 @@ +{ + "orgId": "team_X7ikPPn4YpZ4APwufE36i53l", + "projectId": "prj_GO3fYDyQKzkoreOaBBgTIBRZVvt0", + "projectName": "evlog-docs" +} diff --git a/apps/docs/app/components/features/FeatureAiSdk.vue b/apps/docs/app/components/features/FeatureAiSdk.vue index 7e4be586..277e6a67 100644 --- a/apps/docs/app/components/features/FeatureAiSdk.vue +++ b/apps/docs/app/components/features/FeatureAiSdk.vue @@ -17,6 +17,8 @@ const pills = [ { label: 'Token tracking', icon: 'i-lucide-coins' }, { label: 'Tool calls', icon: 'i-lucide-wrench' }, { label: 'Streaming metrics', icon: 'i-lucide-gauge' }, + { label: 'Cost estimation', icon: 'i-lucide-dollar-sign' }, + { label: 'Tool timing', icon: 'i-lucide-timer' }, ] const benefits = [ @@ -28,12 +30,17 @@ const benefits = [ { icon: 'i-lucide-box', title: 'Works with everything', - text: 'generateText, streamText, ToolLoopAgent, generateObject.', + text: 'generateText, streamText, ToolLoopAgent, embed, multi-step agents.', }, { icon: 'i-lucide-bar-chart-3', title: 'Cost and performance', - text: 'Token usage, cache hits, time to first chunk, tokens per second.', + text: 'Token usage, cache hits, cost estimation, time to first chunk, tokens per second.', + }, + { + icon: 'i-lucide-timer', + title: 'Telemetry integration', + text: 'Per-tool execution timing, success/failure tracking, and total generation wall time.', }, ] @@ -175,11 +182,17 @@ function setView(view: 'without' | 'with') {
-
const ai = createAILogger(log)
+            
const ai = createAILogger(log, {
+  cost: { 'claude-sonnet-4.6': { input: 3, output: 15 } },
+})
 
 const result = streamText({
   model: ai.wrap('anthropic/claude-sonnet-4.6'),
   messages,
+  experimental_telemetry: {
+    isEnabled: true,
+    integrations: [createEvlogIntegration(ai)],
+  },
 })
@@ -248,8 +261,12 @@ function setView(view: 'without' | 'with') { ["searchWeb", "queryDB"]
- ai.steps: - 3 + ai.tools: + [{name: "searchWeb", durationMs: 150, ...}] +
+
+ ai.estimatedCost: + 0.022
ai.msToFirstChunk: diff --git a/apps/docs/content/0.landing.md b/apps/docs/content/0.landing.md index d39c1684..5b058187 100644 --- a/apps/docs/content/0.landing.md +++ b/apps/docs/content/0.landing.md @@ -101,7 +101,7 @@ Wide events and structured errors for TypeScript. One log per request, full cont Make AI calls :br observable #description - Your AI endpoints are black boxes. You don't know how many tokens each request burns, which tools the model called, or how fast the stream was. Wrap your model with one line and every call is captured into the wide event. Cost tracking, tool visibility, streaming performance, cache hits, reasoning tokens. + Your AI endpoints are black boxes. You don't know how many tokens each request burns, which tools the model called, or how fast the stream was. Wrap your model with one line and every call is captured into the wide event. Cost estimation, tool execution timing, streaming performance, cache hits, reasoning tokens, and multi-step agent breakdowns. ::: :::features-feature-performance diff --git a/bun.lock b/bun.lock index ba18e7bb..0223647e 100644 --- a/bun.lock +++ b/bun.lock @@ -1,5 +1,6 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "evlog-monorepo", From 561261ab815f5e19606fea84c1c75e76cf53554c Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:42:14 +0000 Subject: [PATCH 2/3] chore: apply automated lint fixes --- bun.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/bun.lock b/bun.lock index 0223647e..ba18e7bb 100644 --- a/bun.lock +++ b/bun.lock @@ -1,6 +1,5 @@ { "lockfileVersion": 1, - "configVersion": 0, "workspaces": { "": { "name": "evlog-monorepo", From 33b4bfa3a7cd84218902e0f2c233f15cf64fb54d Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 15 Apr 2026 20:42:52 +0200 Subject: [PATCH 3/3] Delete .vercel/project.json --- .vercel/project.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .vercel/project.json diff --git a/.vercel/project.json b/.vercel/project.json deleted file mode 100644 index ad59a829..00000000 --- a/.vercel/project.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "orgId": "team_X7ikPPn4YpZ4APwufE36i53l", - "projectId": "prj_GO3fYDyQKzkoreOaBBgTIBRZVvt0", - "projectName": "evlog-docs" -}