From 78d230c7eb9de54d95e41b41e2adf48b18e9872b Mon Sep 17 00:00:00 2001 From: CardinalError Date: Thu, 2 Jan 2025 12:00:48 +0100 Subject: [PATCH] add runtime variable --- packages/plugin-gitcoin-passport/README.md | 2 +- .../plugin-gitcoin-passport/src/actions/getScore.ts | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/plugin-gitcoin-passport/README.md b/packages/plugin-gitcoin-passport/README.md index 71056a4ad5..a67f025244 100644 --- a/packages/plugin-gitcoin-passport/README.md +++ b/packages/plugin-gitcoin-passport/README.md @@ -11,7 +11,7 @@ Just add it under your character profile in plugins as ``` "plugins": [ - "@elizaos/plugin-passport" + "@elizaos/plugin-gitcoin-passport" ], ``` diff --git a/packages/plugin-gitcoin-passport/src/actions/getScore.ts b/packages/plugin-gitcoin-passport/src/actions/getScore.ts index e553a8cc60..dee274eabd 100644 --- a/packages/plugin-gitcoin-passport/src/actions/getScore.ts +++ b/packages/plugin-gitcoin-passport/src/actions/getScore.ts @@ -6,6 +6,7 @@ import { HandlerCallback, State, getEmbeddingZeroVector, + Content, composeContext, generateMessageResponse, ModelClass, @@ -49,11 +50,11 @@ export const getPassportScoreAction: Action = { description: "Get score from Passport API for an address", validate: async (runtime: IAgentRuntime, _message: Memory) => { elizaLogger.log("Validating runtime for GET_PASSPORT_SCORE..."); - const apiKey = process.env.PASSPORT_API_KEY; - const scorerId = process.env.PASSPORT_SCORER; + const apiKey = runtime.getSetting("PASSPORT_API_KEY"); + const scorerId = runtime.getSetting("PASSPORT_SCORER"); if (!apiKey || !scorerId) { elizaLogger.error( - "Missing PASSPORT_API_KEY or PASSPORT_SCORER environment variables" + "Missing PASSPORT_API_KEY or PASSPORT_SCORER settings" ); return false; } @@ -67,8 +68,8 @@ export const getPassportScoreAction: Action = { callback: HandlerCallback ) => { elizaLogger.log("Starting GET_PASSPORT_SCORE handler..."); - const apiKey = process.env.PASSPORT_API_KEY; - const scorerId = process.env.PASSPORT_SCORER; + const apiKey = runtime.getSetting("PASSPORT_API_KEY"); + const scorerId = runtime.getSetting("PASSPORT_SCORER"); if (!state) { state = (await runtime.composeState(_message)) as State;