Skip to content

[Ask AI 02] refactor: upgrade Ask AI to AI SDK 7 - #229

Open
raviships wants to merge 1 commit into
feat/ask-ai-lunafrom
refactor/ask-ai-sdk-7
Open

[Ask AI 02] refactor: upgrade Ask AI to AI SDK 7#229
raviships wants to merge 1 commit into
feat/ask-ai-lunafrom
refactor/ask-ai-sdk-7

Conversation

@raviships

@raviships raviships commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Change

  • Upgrade AI SDK from v6 to v7 and update the React package to the matching major.
  • Upgrade Langfuse tracing to v5 and register its AI SDK 7 integration.
  • Start OpenTelemetry with NodeSDK from Next.js instrumentation.
  • Replace the old system prompt, stop condition, telemetry, and response helpers with their AI SDK 7 APIs.
  • Let the AI SDK create the root span. Remove the manual observe and updateActiveObservation lifecycle.
  • Remove the unused OpenAI-compatible provider package.

AI SDK 7 replaces per-call experimental telemetry with registered integrations. Langfuse v5 replaces updateActiveTrace with propagated attributes.

Benchmark after the upgrade

The benchmark asked five documentation questions twice for each configuration. Quality is the percentage of question-specific checks passed. Cost uses estimated OpenAI token pricing.

Model Complete answers One provideLinks call Quality Median first event Median total time Estimated cost per request
GPT-4.1 mini 10/10 10/10 90% 1.13 s 10.36 s $0.005391
Luna, no reasoning 10/10 10/10 90% 1.24 s 6.34 s $0.001361
Luna, low reasoning 10/10 10/10 90% 1.49 s 7.29 s $0.001795

On AI SDK 7, Luna with no reasoning matched GPT-4.1 mini's quality score. It cut estimated cost by 75% and median total time by 39%. The first event arrived 113 ms later.

Telemetry check

The live Gateway test emitted an invoke_agent root, a step 1 child, and a model-call child. The Langfuse processor attached the trace name, session ID, tags, environment, token counts, model input, and model output. Its default filter kept all three spans.

Checks

  • Frozen pnpm install passes the repository's supply-chain checks.
  • Targeted Prettier and ESLint checks pass.
  • pnpm build passes.
  • pnpm --filter docs exec tsc --noEmit --pretty false passes.
  • Next.js production compilation succeeds.

@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
edgestore-docs Ready Ready Preview Aug 22, 2026 4:00am
example-access-control Ready Ready Preview Aug 22, 2026 4:00am
example-components Ready Ready Preview Aug 22, 2026 4:00am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant