Skip to content

Commit f798211

Browse files
committed
updates
1 parent be682b5 commit f798211

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

agent/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"@elizaos/plugin-tee-marlin": "workspace:*",
7272
"@elizaos/plugin-multiversx": "workspace:*",
7373
"@elizaos/plugin-near": "workspace:*",
74+
"@elizaos/plugin-nft-collections": "workspace:*",
7475
"@elizaos/plugin-zksync-era": "workspace:*",
7576
"@elizaos/plugin-twitter": "workspace:*",
7677
"@elizaos/plugin-primus": "workspace:*",

agent/src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,6 @@ export async function createAgent(
736736
// character.plugins are handled when clients are added
737737
plugins: [
738738
bootstrapPlugin,
739-
newsPlugin,
740739
getSecret(character, "CONFLUX_CORE_PRIVATE_KEY")
741740
? confluxPlugin
742741
: null,

packages/plugin-news/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "@ai16z/plugin-news",
2+
"name": "@elizaos/plugin-news",
33
"version": "0.1.5-alpha.5",
44
"main": "dist/index.js",
55
"type": "module",
66
"types": "dist/index.d.ts",
77
"dependencies": {
8-
"@ai16z/eliza": "workspace:*",
8+
"@elizaos/core": "workspace:*",
99
"tsup": "8.3.5"
1010
},
1111
"scripts": {

packages/plugin-news/src/actions/news.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ import {
88
ModelClass,
99
State,
1010
type Action,
11-
} from "@ai16z/eliza";
11+
} from "@elizaos/core";
1212

1313

1414
export const currentNewsAction: Action = {
1515
name: "CURRENT_NEWS",
1616
similes: ["NEWS", "GET_NEWS", "GET_CURRENT_NEWS"],
1717
validate: async (_runtime: IAgentRuntime, _message: Memory) => {
18+
const apiKey = process.env.NEWS_API_KEY;
19+
if (!apiKey) {
20+
throw new Error('NEWS_API_KEY environment variable is not set');
21+
}
1822
return true;
1923
},
2024
description:
@@ -28,11 +32,6 @@ export const currentNewsAction: Action = {
2832
): Promise<boolean> => {
2933
async function getCurrentNews(searchTerm: string) {
3034
try {
31-
const apiKey = process.env.NEWS_API_KEY;
32-
if (!apiKey) {
33-
throw new Error('NEWS_API_KEY environment variable is not set');
34-
}
35-
3635
// Add quotes and additional context terms
3736
const enhancedSearchTerm = encodeURIComponent(`"${searchTerm}" AND (Spain OR Spanish OR Madrid OR Felipe)`);
3837

@@ -43,15 +42,15 @@ export const currentNewsAction: Action = {
4342
`sortBy=relevancy&` +
4443
`language=en&` +
4544
`pageSize=50&` +
46-
`apiKey=${apiKey}`
45+
`apiKey=${process.env.NEWS_API_KEY}`
4746
),
4847
fetch(
4948
`https://newsapi.org/v2/top-headlines?` +
5049
`q=${searchTerm}&` +
5150
`country=es&` +
5251
`language=en&` +
5352
`pageSize=50&` +
54-
`apiKey=${apiKey}`
53+
`apiKey=${process.env.NEWS_API_KEY}`
5554
)
5655
]);
5756

packages/plugin-news/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Plugin } from "@ai16z/eliza";
1+
import { Plugin } from "@elizaos/core";
22
import { currentNewsAction } from "./actions/news";
33

44
export const newsPlugin: Plugin = {

0 commit comments

Comments
 (0)