Skip to content

Vercel AI: Allow DataUIPart in user message #4704

@sudonickk

Description

@sudonickk

Initial Checks

Description

Currently, in the Vercel AI Adapter, converting a [UIMessage] to a [ModelMessage] throws an error if a user message contains any part other than TextUIPart or FileUIPart.

This is too restrictive. DataUIPart should be allowed in user messages, but simply ignored during conversion rather than causing a failure.

Current behavior:

  • TextUIPart → allowed
  • FileUIPart → allowed
  • Any other part (including DataUIPart) → throws error

Proposed change:

  • Allow DataUIPart in user messages
  • Ignore DataUIPart during conversion (no-op)
  • Continue throwing errors only for truly unsupported/unknown part types

Python, Pydantic AI & LLM client version

  • Python: 3.14.2
  • Pydantic AI: 1.69.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugReport that something isn't working, or PR implementing a fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions