Skip to content

Commit 0317206

Browse files
committed
fix(provider): enable image support for custom OpenAI-compatible providers
Custom OpenAI-compatible providers (Ollama, longent, etc.) were unable to process image attachments because capabilities.input.image defaulted to false. Now defaults to true for @ai-sdk/openai-compatible providers. Closes #20802
1 parent f3d5a71 commit 0317206

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/opencode/src/provider/provider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,10 @@ const layer: Layer.Layer<
11631163
input: {
11641164
text: model.modalities?.input?.includes("text") ?? existingModel?.capabilities.input.text ?? true,
11651165
audio: model.modalities?.input?.includes("audio") ?? existingModel?.capabilities.input.audio ?? false,
1166-
image: model.modalities?.input?.includes("image") ?? existingModel?.capabilities.input.image ?? false,
1166+
image:
1167+
model.modalities?.input?.includes("image") ??
1168+
existingModel?.capabilities.input.image ??
1169+
(provider.npm === "@ai-sdk/openai-compatible" ? true : false),
11671170
video: model.modalities?.input?.includes("video") ?? existingModel?.capabilities.input.video ?? false,
11681171
pdf: model.modalities?.input?.includes("pdf") ?? existingModel?.capabilities.input.pdf ?? false,
11691172
},

0 commit comments

Comments
 (0)