Skip to content

Problems with vercelAiIntegration for ai package on Next.js #16538

Description

@AbhiPrasad

There are a few problems with the vercelAiIntegration on Next.js. We made some improvements already (and/or they are pending):

Once all of this landed, we've done everything we can do in the SDK itself. That leaves the problem that we cannot monkey-patch ai on Next.js, for whatever reason. This PR may fix this: vercel/ai#6716 in the ai package, but this is still WIP and unclear when/how this lands.

For the time being, once all the linked PRs in the SDK are merged & released, stuff should work, if users manually enable telemetry in every call:

await generateText({
  experimental_telemetry: { isEnabled: true },
  // ...
});

We should probably inform users in the AI insights module that are using Next.js about this, somehow.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions