Skip to content

Commit

Permalink
Have agent construct the character plugins for the runtime.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtbc committed Feb 13, 2025
1 parent c7152f9 commit 133b45b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,16 @@ async function jsonToCharacter(
...character.settings.secrets,
};
}
// Handle plugins
character.plugins = await handlePluginImporting(character.plugins);
elizaLogger.debug(
`Constructing plugins for ${character.name} character ` +
`(count=${character.plugins.length})`,
);
const pluginConstructors = await handlePluginImporting(character.plugins);
const getSetting = (key: string) => settings[key];
character.plugins = [];
for (const pluginConstructor of pluginConstructors) {
character.plugins.push(await pluginConstructor(getSetting));
}
if (character.extends) {
elizaLogger.info(
`Merging ${character.name} character with parent characters`
Expand Down

0 comments on commit 133b45b

Please sign in to comment.