UIMessage
Namespace: Vercel.AI.Ui
public sealed class UIMessageA message shown in a chat UI, made of parts. Maps to UIMessage.
Inheritance: object
Constructors
Section titled “Constructors”UIMessage(UIMessageRole, IReadOnlyList<UIMessagePart>)
Section titled “UIMessage(UIMessageRole, IReadOnlyList<UIMessagePart>)”public UIMessage(UIMessageRole role, IReadOnlyList<UIMessagePart> parts)Creates a UI message.
Parameters
| Name | Type | Description |
|---|---|---|
role |
UIMessageRole | |
parts |
IReadOnlyList<UIMessagePart> |
Properties
Section titled “Properties”public string Id { get; init; }A unique identifier for the message.
Value: string
Metadata
Section titled “Metadata”public JsonElement? Metadata { get; init; }The metadata of the message.
Value: JsonElement?
public IReadOnlyList<UIMessagePart> Parts { get; }The parts of the message.
Value: IReadOnlyList<UIMessagePart>
public UIMessageRole Role { get; }The role of the message.
Value: UIMessageRole
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product