Skip to content

Commit 630cb9d

Browse files
authored
Merge branch 'main' into preact-ui
2 parents ef0d14f + b4d988f commit 630cb9d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/guides/multimodal-content.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import type { ContentPart, ImagePart, TextPart } from '@tanstack/ai'
2323
// Text content
2424
const textPart: TextPart = {
2525
type: 'text',
26-
text: 'What do you see in this image?'
26+
content: 'What do you see in this image?'
2727
}
2828

2929
// Image from base64 data
@@ -63,7 +63,7 @@ const response = await chat({
6363
{
6464
role: 'user',
6565
content: [
66-
{ type: 'text', text: 'What is in this image?' },
66+
{ type: 'text', content: 'What is in this image?' },
6767
{
6868
type: 'image',
6969
source: {
@@ -92,7 +92,7 @@ const adapter = openaiText()
9292
const message = {
9393
role: 'user' ,
9494
content: [
95-
{ type: 'text' , text: 'Describe this image' },
95+
{ type: 'text' , content: 'Describe this image' },
9696
{
9797
type: 'image' ,
9898
source: { type: 'data' , value: imageBase64 },
@@ -119,7 +119,7 @@ const adapter = anthropicText()
119119
const imageMessage = {
120120
role: 'user' ,
121121
content: [
122-
{ type: 'text' , text: 'What do you see?' },
122+
{ type: 'text' , content: 'What do you see?' },
123123
{
124124
type: 'image' ,
125125
source: { type: 'data' , value: imageBase64 },
@@ -132,7 +132,7 @@ const imageMessage = {
132132
const docMessage = {
133133
role: 'user',
134134
content: [
135-
{ type: 'text', text: 'Summarize this document' },
135+
{ type: 'text', content: 'Summarize this document' },
136136
{
137137
type: 'document',
138138
source: { type: 'data', value: pdfBase64 }
@@ -158,7 +158,7 @@ const adapter = geminiText()
158158
const message = {
159159
role: 'user',
160160
content: [
161-
{ type: 'text', text: 'Analyze this image' },
161+
{ type: 'text', content: 'Analyze this image' },
162162
{
163163
type: 'image',
164164
source: { type: 'data', value: imageBase64 },
@@ -185,7 +185,7 @@ const adapter = ollamaText('http://localhost:11434')
185185
const message = {
186186
role: 'user',
187187
content: [
188-
{ type: 'text', text: 'What is in this image?' },
188+
{ type: 'text', content: 'What is in this image?' },
189189
{
190190
type: 'image',
191191
source: { type: 'data', value: imageBase64 }
@@ -245,7 +245,7 @@ const message = {
245245
const multimodalMessage = {
246246
role: 'user',
247247
content: [
248-
{ type: 'text', text: 'Hello, world!' },
248+
{ type: 'text', content: 'Hello, world!' },
249249
{ type: 'image', source: { type: 'url', value: '...' } }
250250
]
251251
}
@@ -296,7 +296,7 @@ const stream = chat({
296296
{
297297
role: 'user',
298298
content: [
299-
{ type: 'text', text: 'What do you see?' },
299+
{ type: 'text', content: 'What do you see?' },
300300
{ type: 'image', source: { type: 'url', value: '...' } }
301301
]
302302
}

0 commit comments

Comments
 (0)