Skip to content

Commit 441593e

Browse files
committed
Solve Issue 1643, imageDescriptionService not working with other providers than OpenAI
1 parent 256e663 commit 441593e

File tree

1 file changed

+4
-3
lines changed
  • packages/plugin-node/src/services

1 file changed

+4
-3
lines changed

packages/plugin-node/src/services/image.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,11 @@ export class ImageDescriptionService
206206
},
207207
},
208208
];
209-
209+
// If model provider is openai, use the endpoint, otherwise use the default openai endpoint
210210
const endpoint =
211-
models[this.runtime.imageModelProvider].endpoint ??
212-
"https://api.openai.com/v1";
211+
this.runtime.imageModelProvider === ModelProviderName.OPENAI
212+
? models[this.runtime.imageModelProvider].endpoint
213+
: "https://api.openai.com/v1";
213214

214215
const response = await fetch(endpoint + "/chat/completions", {
215216
method: "POST",

0 commit comments

Comments
 (0)