Skip to content

Commit

Permalink
Merge pull request elizaOS#1667 from nusk0/1634--fix_ImageDescription…
Browse files Browse the repository at this point in the history
…Service

fix: 1634  fix image description service
  • Loading branch information
monilpat authored Jan 2, 2025
2 parents 2d7aa71 + f227d69 commit 683714c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/plugin-node/src/services/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ export class ImageDescriptionService
},
},
];

// If model provider is openai, use the endpoint, otherwise use the default openai endpoint.
const endpoint =
models[this.runtime.imageModelProvider].endpoint ??
"https://api.openai.com/v1";
this.runtime.imageModelProvider === ModelProviderName.OPENAI
? models[this.runtime.imageModelProvider].endpoint
: "https://api.openai.com/v1";

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

0 comments on commit 683714c

Please sign in to comment.