Skip to content

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

Open
@AbhiPrasad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions