Skip to content

Commit

Permalink
instal clients from plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Nov 17, 2024
1 parent 1d61d03 commit 3cd78ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ export async function initializeClients(
clients.push(twitterClients);
}

if (character.plugins.length > 0) {
character.plugins.forEach(async (plugin) => {
plugin.clients.forEach(async (client) => {
clients.push(await client.start(runtime));
});
});
}

return clients;
}

Expand All @@ -224,7 +232,10 @@ export async function createAgent(
token: string
) {
console.log("Creating runtime for character", character.name);
console.log("character.settings.secrets?.WALLET_PUBLIC_KEY", character.settings.secrets?.WALLET_PUBLIC_KEY)
console.log(
"character.settings.secrets?.WALLET_PUBLIC_KEY",
character.settings.secrets?.WALLET_PUBLIC_KEY
);
return new AgentRuntime({
databaseAdapter: db,
token,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ export type Plugin = {
providers?: Provider[];
evaluators?: Evaluator[];
services?: Service[];
clients?: Client[];
};

export enum Clients {
Expand Down

0 comments on commit 3cd78ae

Please sign in to comment.