From 9c81aaf921cc0880f9028c913d3d436bd3c4f5c4 Mon Sep 17 00:00:00 2001 From: 9547 <29431502+9547@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:43:55 +0800 Subject: [PATCH] feat(plugin-story): migrate generateObjectDeprecated to generateObject --- packages/plugin-story/src/actions/attachTerms.ts | 4 ++-- packages/plugin-story/src/actions/getAvailableLicenses.ts | 4 ++-- packages/plugin-story/src/actions/getIPDetails.ts | 4 ++-- packages/plugin-story/src/actions/licenseIP.ts | 4 ++-- packages/plugin-story/src/actions/registerIP.ts | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/plugin-story/src/actions/attachTerms.ts b/packages/plugin-story/src/actions/attachTerms.ts index a175aacbc3..dd1c248adb 100644 --- a/packages/plugin-story/src/actions/attachTerms.ts +++ b/packages/plugin-story/src/actions/attachTerms.ts @@ -1,7 +1,7 @@ import { composeContext, elizaLogger, - generateObjectDeprecated, + generateObject, HandlerCallback, ModelClass, IAgentRuntime, @@ -98,7 +98,7 @@ export const attachTermsAction = { template: attachTermsTemplate, }); - const content = await generateObjectDeprecated({ + const content = await generateObject({ runtime, context: attachTermsContext, modelClass: ModelClass.SMALL, diff --git a/packages/plugin-story/src/actions/getAvailableLicenses.ts b/packages/plugin-story/src/actions/getAvailableLicenses.ts index 466100084b..620b541868 100644 --- a/packages/plugin-story/src/actions/getAvailableLicenses.ts +++ b/packages/plugin-story/src/actions/getAvailableLicenses.ts @@ -1,7 +1,7 @@ import { composeContext, elizaLogger, - generateObjectDeprecated, + generateObject, HandlerCallback, ModelClass, IAgentRuntime, @@ -114,7 +114,7 @@ export const getAvailableLicensesAction = { : await runtime.updateRecentMessageState(state); // Generate parameters from context - const content = await generateObjectDeprecated({ + const content = await generateObject({ runtime, context: composeContext({ state, diff --git a/packages/plugin-story/src/actions/getIPDetails.ts b/packages/plugin-story/src/actions/getIPDetails.ts index 68d7f13287..eecc5b99e1 100644 --- a/packages/plugin-story/src/actions/getIPDetails.ts +++ b/packages/plugin-story/src/actions/getIPDetails.ts @@ -1,7 +1,7 @@ import { composeContext, elizaLogger, - generateObjectDeprecated, + generateObject, HandlerCallback, ModelClass, IAgentRuntime, @@ -81,7 +81,7 @@ export const getIPDetailsAction = { : await runtime.updateRecentMessageState(state); // Generate content using template - const content = await generateObjectDeprecated({ + const content = await generateObject({ runtime, context: composeContext({ state, template: getIPDetailsTemplate }), modelClass: ModelClass.SMALL, diff --git a/packages/plugin-story/src/actions/licenseIP.ts b/packages/plugin-story/src/actions/licenseIP.ts index 1d834136ce..4182ade0f6 100644 --- a/packages/plugin-story/src/actions/licenseIP.ts +++ b/packages/plugin-story/src/actions/licenseIP.ts @@ -1,7 +1,7 @@ import { composeContext, elizaLogger, - generateObjectDeprecated, + generateObject, HandlerCallback, ModelClass, IAgentRuntime, @@ -69,7 +69,7 @@ export const licenseIPAction = { template: licenseIPTemplate, }); - const content = await generateObjectDeprecated({ + const content = await generateObject({ runtime, context: licenseIPContext, modelClass: ModelClass.SMALL, diff --git a/packages/plugin-story/src/actions/registerIP.ts b/packages/plugin-story/src/actions/registerIP.ts index ae579ca074..87432d4488 100644 --- a/packages/plugin-story/src/actions/registerIP.ts +++ b/packages/plugin-story/src/actions/registerIP.ts @@ -1,7 +1,7 @@ import { composeContext, elizaLogger, - generateObjectDeprecated, + generateObject, HandlerCallback, ModelClass, IAgentRuntime, @@ -96,7 +96,7 @@ export const registerIPAction = { template: registerIPTemplate, }); - const content = await generateObjectDeprecated({ + const content = await generateObject({ runtime, context: registerIPContext, modelClass: ModelClass.SMALL,