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)],
+ },
})