Skip to content

Commit ea5b58a

Browse files
committed
fix: LLMVisionProvider passes ContentPart[] directly instead of JSON.stringify
1 parent 788f6d1 commit ea5b58a

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/vision/providers/LLMVisionProvider.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,19 @@ export class LLMVisionProvider implements IVisionProvider {
177177
const { generateText } = await import('../../api/generateText.js');
178178

179179
// Build the multimodal message with text prompt + image.
180-
// The content array format is the standard multimodal message shape
181-
// accepted by all major vision LLM providers (OpenAI, Anthropic, Gemini).
180+
// Message.content now natively accepts MessageContentPart[] so we
181+
// pass the structured array directly instead of JSON.stringify.
182182
const result = await generateText({
183183
provider: this._config.provider,
184184
model: this._config.model,
185185
apiKey: this._config.apiKey,
186186
baseUrl: this._config.baseUrl,
187187
messages: [{
188188
role: 'user',
189-
// Serialize the content parts array as JSON. The provider adapter
190-
// will parse it back into the appropriate multimodal format.
191-
content: JSON.stringify([
189+
content: [
192190
{ type: 'text', text: this._prompt },
193191
{ type: 'image_url', image_url: { url: image } },
194-
]),
192+
],
195193
}],
196194
});
197195

0 commit comments

Comments
 (0)