Skip to content

Comments

feat (ai): inject message id in createUIMessageStream#6726

Merged
lgrammel merged 10 commits intov5from
lg/8APxsSS
Jun 12, 2025
Merged

feat (ai): inject message id in createUIMessageStream#6726
lgrammel merged 10 commits intov5from
lg/8APxsSS

Conversation

@lgrammel
Copy link
Collaborator

@lgrammel lgrammel commented Jun 12, 2025

Background

When createUIMessageStream is used to construct the final UI message for persistence, it relies on the message id from the inner stream. If that is not available, it'll be the empty string. This currently makes it necessary to pass the original messages in several places.

Summary

  • remove newMessageId from streamText result ui message stream methods
  • add support for inserting the ui message id in createUIMessageStream
  • metadata is undefined by default (and not {} which is not matching the expected type)

@lgrammel lgrammel changed the title 1 feat (ai): inject message id in createUIMessageStream Jun 12, 2025
@lgrammel lgrammel marked this pull request as ready for review June 12, 2025 13:22
@lgrammel lgrammel merged commit 33eb499 into v5 Jun 12, 2025
8 checks passed
@lgrammel lgrammel deleted the lg/8APxsSS branch June 12, 2025 13:24
chrisvariety added a commit to chrisvariety/ai that referenced this pull request Jul 2, 2025
`newMessageId` was removed in vercel#6726 but leftover in the documentation.
lgrammel pushed a commit that referenced this pull request Jul 2, 2025
## Background
Documentation for `newMessageId ` within `streamText` in v5 is outdated.
`newMessageId` was removed in #6726 but leftover in the documentation.

## Summary
Removed out-of-date documentation.
botirk38 pushed a commit to Nordlys-Labs/ai that referenced this pull request Jul 6, 2025
Documentation for `sendStart` within `streamText` in v5 is outdated. As
of vercel#6499 `sendStart` is used to control whether the start message is
sent or not.

https://github.com/vercel/ai/blob/1ed028703999fe3a897f5a3dc240c452791e3555/packages/ai/core/generate-text/stream-text.ts#L1541-L1550

Removed out-of-date documentation.

docs: remove `newMessageId` in `streamText` (vercel#6971)

Documentation for `newMessageId ` within `streamText` in v5 is outdated.
`newMessageId` was removed in vercel#6726 but leftover in the documentation.

Removed out-of-date documentation.

chore: add .envrc to .gitignore (vercel#6965)

`.envrc` files are commonly used with [direnv](https://direnv.net/) to
automatically set environment variables when entering a directory. These
files often contain sensitive information, local development settings,
or personal configuration that should not be committed to version
control.

Added `.envrc` to `.gitignore` to prevent direnv environment files from
being accidentally committed to the repository.

This change can be verified by:
1. Creating a `.envrc` file in the project root
2. Running `git status` to confirm the file is ignored
3. Checking that the file doesn't appear in git tracking

docs: add Amazon Nova Canvas availability regions (vercel#6977)

The documentation for Amazon Bedrock's `amazon.nova-canvas-v1:0` image
model was outdated. It only listed `us-east-1` as the available region,
but the model is now available in additional regions.

Updated the region availability for the `amazon.nova-canvas-v1:0` image
model:
* Added `eu-west-1` region
* Added `ap-northeast-1` region

The model is now documented as available in: `us-east-1`, `eu-west-1`,
and `ap-northeast-1`.

Add Vercel SDK Provider list (vercel#6863) (vercel#6961)

I noticed that in the [Providers and Models
docs](https://ai-sdk.dev/docs/foundations/providers-and-models), we
mention the Vercel (v0) model in the [Model

Capabilities](https://ai-sdk.dev/docs/foundations/providers-and-models#model-capabilities)
but not in the [AI SDK

Providers](https://ai-sdk.dev/docs/foundations/providers-and-models#ai-sdk-providers).

This PR adds the Vercel Provider to the [Providers and Models
docs](https://ai-sdk.dev/docs/foundations/providers-and-models#ai-sdk-providers)
list.

- [x] Formatting issues have been fixed (run `pnpm prettier-fix` in the
project root)

Co-authored-by: Anshuman Bhardwaj <anshu5074@gmail.com>

refactor(adaptive): simplify usage properties by replacing providers array with a single provider string and removing cost_saved to streamline the data structure and improve clarity

feat: update readme and changelog
botirk38 pushed a commit to Nordlys-Labs/ai that referenced this pull request Jul 6, 2025
Documentation for `sendStart` within `streamText` in v5 is outdated. As
of vercel#6499 `sendStart` is used to control whether the start message is
sent or not.

https://github.com/vercel/ai/blob/1ed028703999fe3a897f5a3dc240c452791e3555/packages/ai/core/generate-text/stream-text.ts#L1541-L1550

Removed out-of-date documentation.

docs: remove `newMessageId` in `streamText` (vercel#6971)

Documentation for `newMessageId ` within `streamText` in v5 is outdated.
`newMessageId` was removed in vercel#6726 but leftover in the documentation.

Removed out-of-date documentation.

chore: add .envrc to .gitignore (vercel#6965)

`.envrc` files are commonly used with [direnv](https://direnv.net/) to
automatically set environment variables when entering a directory. These
files often contain sensitive information, local development settings,
or personal configuration that should not be committed to version
control.

Added `.envrc` to `.gitignore` to prevent direnv environment files from
being accidentally committed to the repository.

This change can be verified by:
1. Creating a `.envrc` file in the project root
2. Running `git status` to confirm the file is ignored
3. Checking that the file doesn't appear in git tracking

docs: add Amazon Nova Canvas availability regions (vercel#6977)

The documentation for Amazon Bedrock's `amazon.nova-canvas-v1:0` image
model was outdated. It only listed `us-east-1` as the available region,
but the model is now available in additional regions.

Updated the region availability for the `amazon.nova-canvas-v1:0` image
model:
* Added `eu-west-1` region
* Added `ap-northeast-1` region

The model is now documented as available in: `us-east-1`, `eu-west-1`,
and `ap-northeast-1`.

Add Vercel SDK Provider list (vercel#6863) (vercel#6961)

I noticed that in the [Providers and Models
docs](https://ai-sdk.dev/docs/foundations/providers-and-models), we
mention the Vercel (v0) model in the [Model

Capabilities](https://ai-sdk.dev/docs/foundations/providers-and-models#model-capabilities)
but not in the [AI SDK

Providers](https://ai-sdk.dev/docs/foundations/providers-and-models#ai-sdk-providers).

This PR adds the Vercel Provider to the [Providers and Models
docs](https://ai-sdk.dev/docs/foundations/providers-and-models#ai-sdk-providers)
list.

- [x] Formatting issues have been fixed (run `pnpm prettier-fix` in the
project root)

Co-authored-by: Anshuman Bhardwaj <anshu5074@gmail.com>

refactor(adaptive): simplify usage properties by replacing providers array with a single provider string and removing cost_saved to streamline the data structure and improve clarity

feat: update readme and changelog
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.

2 participants