Skip to content

Commit 3b7d9e3

Browse files
authored
Merge pull request #1667 from nusk0/1634--fix_ImageDescriptionService
fix: 1634 fix image description service
2 parents f5c3dab + cf2d305 commit 3b7d9e3

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)