Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: activate web-search plugin in agents/ #1577

Merged
merged 8 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ TOGETHER_API_KEY=
# Server Configuration
SERVER_PORT=3000

# Web Search Config
ENABLE_WEBSEARCH=false # boolean value, defaults to false

# Abstract Configuration
ABSTRACT_ADDRESS=
ABSTRACT_PRIVATE_KEY=
Expand Down
114 changes: 57 additions & 57 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
node_modules
/out
.env
.env.production
.env.local
.env_main
concatenated-output.ts
embedding-cache.json
packages/plugin-buttplug/intiface-engine
.idea
.DS_Store
dist/
# Allow models directory but ignore model files
models/*.gguf
cookies.json
db.sqlite
searches/
tweets/
*.gguf
*.onnx
*.wav
*.mp3
logs/
test-report.json
content_cache/
test_data/
tokencache/
tweetcache/
twitter_cookies.json
timeline_cache.json
*.sqlite
characters/
packages/core/src/providers/cache
packages/core/src/providers/cache/*
cache/*
packages/plugin-coinbase/src/plugins/transactions.csv
tsup.config.bundled_*.mjs
.turbo
.cursorrules
coverage
.eslintcache
agent/content
node_modules
/out

.env
.env.production
.env.local
.env_main
concatenated-output.ts
embedding-cache.json
packages/plugin-buttplug/intiface-engine

.idea
.DS_Store

dist/
# Allow models directory but ignore model files
models/*.gguf

cookies.json

db.sqlite
searches/
tweets/

*.gguf
*.onnx
*.wav
*.mp3

logs/

test-report.json
content_cache/
test_data/
tokencache/
tweetcache/
twitter_cookies.json
timeline_cache.json

*.sqlite

characters/

packages/core/src/providers/cache
packages/core/src/providers/cache/*
cache/*
packages/plugin-coinbase/src/plugins/transactions.csv

tsup.config.bundled_*.mjs

.turbo
.cursorrules

coverage
.eslintcache

agent/content
1 change: 1 addition & 0 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@elizaos/plugin-3d-generation": "workspace:*",
"@elizaos/plugin-fuel": "workspace:*",
"@elizaos/plugin-avalanche": "workspace:*",
"@elizaos/plugin-web-search": "workspace:*",
"readline": "1.3.0",
"ws": "8.18.0",
"yargs": "17.7.2"
Expand Down
6 changes: 6 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { LensAgentClient } from "@elizaos/client-lens";
import { SlackClientInterface } from "@elizaos/client-slack";
import { TelegramClientInterface } from "@elizaos/client-telegram";
import { TwitterClientInterface } from "@elizaos/client-twitter";
import { webSearchPlugin } from "@elizaos/plugin-web-search";
import {
AgentRuntime,
CacheManager,
Expand All @@ -26,6 +27,7 @@ import {
CacheStore,
Client,
ICacheManager,
parseBooleanFromText,
} from "@elizaos/core";
import { RedisClient } from "@elizaos/adapter-redis";
import { zgPlugin } from "@elizaos/plugin-0g";
Expand Down Expand Up @@ -521,6 +523,10 @@ export async function createAgent(
// character.plugins are handled when clients are added
plugins: [
bootstrapPlugin,
parseBooleanFromText(getSecret(character, "ENABLE_WEBSEARCH")) ===
true
? webSearchPlugin
: null,
getSecret(character, "CONFLUX_CORE_PRIVATE_KEY")
? confluxPlugin
: null,
Expand Down
2 changes: 1 addition & 1 deletion packages/client-twitter/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export class ClientBase extends EventEmitter {
// Sometimes this fails because we are rate limited. in this case, we just need to return an empty array
// if we dont get a response in 5 seconds, something is wrong
const timeoutPromise = new Promise((resolve) =>
setTimeout(() => resolve({ tweets: [] }), 10000)
setTimeout(() => resolve({ tweets: [] }), 15000)
);

try {
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading