Skip to content

Commit a17bbc3

Browse files
authored
Merge branch 'main' into fix/langgraph-concurrent-requests-and-tool-name-none
2 parents 2a5f054 + 1cedb73 commit a17bbc3

39 files changed

Lines changed: 14618 additions & 204 deletions

File tree

docs/concepts/messages.mdx

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,59 @@ interface UserMessage {
5555
name?: string // Optional user identifier
5656
}
5757

58-
type InputContent = TextInputContent | BinaryInputContent
58+
type InputContent =
59+
| TextInputContent
60+
| ImageInputContent
61+
| AudioInputContent
62+
| VideoInputContent
63+
| DocumentInputContent
64+
65+
interface InputContentDataSource {
66+
type: "data"
67+
value: string
68+
mimeType: string
69+
}
70+
71+
interface InputContentUrlSource {
72+
type: "url"
73+
value: string
74+
mimeType?: string
75+
}
76+
77+
type InputContentSource = InputContentDataSource | InputContentUrlSource
5978

6079
interface TextInputContent {
6180
type: "text"
6281
text: string
6382
}
6483

65-
interface BinaryInputContent {
66-
type: "binary"
67-
mimeType: string
68-
id?: string
69-
url?: string
70-
data?: string
71-
filename?: string
84+
interface ImageInputContent {
85+
type: "image"
86+
source: InputContentSource
87+
metadata?: Record<string, unknown>
88+
}
89+
90+
interface AudioInputContent {
91+
type: "audio"
92+
source: InputContentSource
93+
metadata?: Record<string, unknown>
94+
}
95+
96+
interface VideoInputContent {
97+
type: "video"
98+
source: InputContentSource
99+
metadata?: Record<string, unknown>
100+
}
101+
102+
interface DocumentInputContent {
103+
type: "document"
104+
source: InputContentSource
105+
metadata?: Record<string, unknown>
72106
}
73107
```
74108

75-
> For `BinaryInputContent`, provide at least one of `id`, `url`, or `data` to
76-
> reference the payload.
109+
> In Python, the previous `BinaryInputContent` model is deprecated and remains
110+
> temporarily available as a compatibility path.
77111
78112
This structure keeps traditional plain-text inputs working while enabling richer
79113
payloads such as images, audio clips, or uploaded files in the same message.

docs/docs.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://mintlify.com/docs.json",
3-
"theme": "willow",
3+
"theme": "aspen",
44
"name": "Agent User Interaction Protocol",
55
"colors": {
66
"primary": "#09090b",
@@ -90,6 +90,7 @@
9090
"pages": [
9191
"sdk/js/core/overview",
9292
"sdk/js/core/types",
93+
"sdk/js/core/multimodal-inputs",
9394
"sdk/js/core/events"
9495
]
9596
},
@@ -116,6 +117,7 @@
116117
"pages": [
117118
"sdk/python/core/overview",
118119
"sdk/python/core/types",
120+
"sdk/python/core/multimodal-inputs",
119121
"sdk/python/core/events"
120122
]
121123
},
@@ -193,4 +195,4 @@
193195
"destination": "/quickstart/server"
194196
}
195197
]
196-
}
198+
}

docs/drafts/multimodal-messages.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ straightforward to map to any LLM provider's API.
3333
### Overview
3434

3535
Extend 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
3939
provider'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 =
118118
type 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
423423
TypeScript 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
441441
Frameworks 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

Comments
 (0)