Skip to content

Commit

Permalink
add runtime variable
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCardinalError committed Jan 2, 2025
1 parent 64aa193 commit 78d230c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-gitcoin-passport/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Just add it under your character profile in plugins as

```
"plugins": [
"@elizaos/plugin-passport"
"@elizaos/plugin-gitcoin-passport"
],
```

Expand Down
11 changes: 6 additions & 5 deletions packages/plugin-gitcoin-passport/src/actions/getScore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
HandlerCallback,
State,
getEmbeddingZeroVector,
Content,
composeContext,
generateMessageResponse,
ModelClass,
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down

0 comments on commit 78d230c

Please sign in to comment.