Skip to content

Commit

Permalink
check if duplicated service type
Browse files Browse the repository at this point in the history
  • Loading branch information
tcm390 committed Jan 16, 2025
1 parent d8008cf commit 34b1ead
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ export class AgentRuntime implements IAgentRuntime {
this.services.set(serviceType, service);

if (typeof (service as any).getMethods === "function") {
if (this.serviceMethods.has(serviceType)) {
elizaLogger.error(
`Methods for service '${serviceType}' already registered.`
);
return;
}

const methods = (service as any).getMethods();
this.serviceMethods.set(serviceType, methods);
console.log(
Expand Down

0 comments on commit 34b1ead

Please sign in to comment.