Skip to content

Commit

Permalink
chore: prefix action name
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRAG committed Jan 31, 2025
1 parent 0390365 commit 1fbe4fa
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export type StoredActionMetadata = Map<string, ActionMetadata>;
*/
export function CreateAction(params: CreateActionDecoratorParams) {
return (target: object, propertyKey: string, descriptor: PropertyDescriptor) => {
const prefixedActionName = `${target.constructor.name}.${propertyKey}`;

const originalMethod = descriptor.value;

const { isWalletProvider } = validateActionMethodArguments(target, propertyKey);
Expand All @@ -105,7 +107,7 @@ export function CreateAction(params: CreateActionDecoratorParams) {
name: "agent_action_invocation",
action: "invoke_action",
component: "agent_action",
action_name: params.name,
action_name: prefixedActionName,
class_name: target.constructor.name,
method_name: propertyKey,
...walletMetrics,
Expand All @@ -118,7 +120,7 @@ export function CreateAction(params: CreateActionDecoratorParams) {
Reflect.getMetadata(ACTION_DECORATOR_KEY, target.constructor) || new Map();

const metaData: ActionMetadata = {
name: params.name,
name: prefixedActionName,
description: params.description,
schema: params.schema,
invoke: descriptor.value,
Expand Down

0 comments on commit 1fbe4fa

Please sign in to comment.