@@ -23,7 +23,7 @@ import type { ContentPart, ImagePart, TextPart } from '@tanstack/ai'
2323// Text content
2424const 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()
9292const 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()
119119const 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 = {
132132const 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()
158158const 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')
185185const 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 = {
245245const 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