@@ -33,9 +33,9 @@ straightforward to map to any LLM provider's API.
3333### Overview
3434
3535Extend the ` UserMessage ` ` content ` property to be either a string or an array of
36- ` InputContentPart ` objects. Each modality (image, audio, video, document) has
37- its own dedicated part type with a typed ` source ` that is either inline ` data `
38- or a ` url ` reference. This makes it trivial to map content parts to any LLM
36+ ` InputContent ` objects. Each modality (image, audio, video, document) has its
37+ own dedicated part type with a typed ` source ` that is either inline ` data ` or a
38+ ` url ` reference. This makes it trivial to map content parts to any LLM
3939provider's API.
4040
4141``` typescript
@@ -106,7 +106,7 @@ interface DocumentInputPart<TMetadata = unknown> {
106106 metadata? : TMetadata
107107}
108108
109- type InputContentPart =
109+ type InputContent =
110110 | TextInputPart
111111 | ImageInputPart
112112 | AudioInputPart
@@ -118,7 +118,7 @@ type InputContentPart =
118118type UserMessage = {
119119 id: string
120120 role: " user"
121- content: string | InputContentPart []
121+ content: string | InputContent []
122122 name? : string
123123}
124124` ` `
@@ -422,9 +422,9 @@ Examples:
422422
423423TypeScript SDK:
424424
425- - New ` Modality ` type and all ` InputContentPart ` types in ` @ag -ui /core `
425+ - New ` Modality ` type and all ` InputContent ` types in ` @ag -ui /core `
426426- ` InputContentSource ` , ` InputContentDataSource ` , ` InputContentUrlSource ` types
427- - Updated ` UserMessage ` with ` content : string | InputContentPart []`
427+ - Updated ` UserMessage ` with ` content : string | InputContent []`
428428- Helper methods for constructing typed content parts
429429- Provider-specific metadata generics on each content part type
430430
@@ -440,7 +440,7 @@ Python SDK:
440440
441441Frameworks need to:
442442
443- - Parse typed ` InputContentPart ` parts and dispatch on ` part .type `
443+ - Parse typed ` InputContent ` parts and dispatch on ` part .type `
444444- Map content parts to provider-specific formats (the typed structure makes this
445445 straightforward)
446446- Use ` source .type ` to determine whether to send inline data or a URL to the
@@ -479,7 +479,7 @@ Share screenshots (`ImageInputPart`) for UI/UX feedback or debugging assistance.
479479
480480## Testing Strategy
481481
482- - Unit tests for each ` InputContentPart ` type and ` InputContentSource ` variant
482+ - Unit tests for each ` InputContent ` type and ` InputContentSource ` variant
483483- Validate ` source .type ` discriminator correctly narrows the union
484484- Integration tests with multimodal LLMs (OpenAI, Anthropic, Google)
485485- Backward compatibility tests with plain ` string ` content
0 commit comments