File tree 1 file changed +5
-5
lines changed
packages/plugin-node/src/services
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -187,22 +187,22 @@ export class ImageDescriptionService
187
187
) : Promise < string > {
188
188
for ( let attempt = 0 ; attempt < 3 ; attempt ++ ) {
189
189
try {
190
- const shouldUseBase64 = isGif || isLocalFile ;
190
+ const shouldUseBase64 = ( isGif || isLocalFile ) && ! ( this . runtime . imageModelProvider === ModelProviderName . OPENAI ) ;
191
191
const mimeType = isGif
192
192
? "png"
193
193
: path . extname ( imageUrl ) . slice ( 1 ) || "jpeg" ;
194
194
195
195
const base64Data = imageData . toString ( "base64" ) ;
196
- // const imageUrlToUse = shouldUseBase64
197
- // ? `data:image/${mimeType};base64,${base64Data}`
198
- // : imageUrl;
196
+ const imageUrlToUse = shouldUseBase64
197
+ ? `data:image/${ mimeType } ;base64,${ base64Data } `
198
+ : imageUrl ;
199
199
200
200
const content = [
201
201
{ type : "text" , text : prompt } ,
202
202
{
203
203
type : "image_url" ,
204
204
image_url : {
205
- url : imageUrl ,
205
+ url : imageUrlToUse ,
206
206
} ,
207
207
} ,
208
208
] ;
You can’t perform that action at this time.
0 commit comments