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