Skip to content

Commit cba49d2

Browse files
committed
[ImageGenerator] throw error when api key missing for Runware
1 parent 5cd3a11 commit cba49d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/core/src/Components/ImageGenerator.class.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ const imageGenerator = {
262262
const teamId = agent.teamId;
263263
const apiKey = (await getCredentials(AccessCandidate.team(teamId), 'runware')) as string;
264264

265+
if (!apiKey) {
266+
throw new Error('Runware API key is missing. Please provide a valid key to continue.');
267+
}
268+
265269
const runware = new Runware({ apiKey });
266270
await runware.ensureConnection();
267271

0 commit comments

Comments
 (0)