Skip to content

Commit 86f4d67

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 anomalyco#20802
1 parent 2ace237 commit 86f4d67

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/opencode/src/provider/provider.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,10 @@ export const layer = Layer.effect(
14351435
input: {
14361436
text: model.modalities?.input?.includes("text") ?? existingModel?.capabilities.input.text ?? true,
14371437
audio: model.modalities?.input?.includes("audio") ?? existingModel?.capabilities.input.audio ?? false,
1438-
image: model.modalities?.input?.includes("image") ?? existingModel?.capabilities.input.image ?? false,
1438+
image:
1439+
model.modalities?.input?.includes("image") ??
1440+
existingModel?.capabilities.input.image ??
1441+
(provider.npm === "@ai-sdk/openai-compatible" ? true : false),
14391442
video: model.modalities?.input?.includes("video") ?? existingModel?.capabilities.input.video ?? false,
14401443
pdf: model.modalities?.input?.includes("pdf") ?? existingModel?.capabilities.input.pdf ?? false,
14411444
},

0 commit comments

Comments
 (0)