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

Cannot read properties of undefined (reading 'actions') trying to test the whatsapp plugin #2078

Open
oscody opened this issue Jan 9, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@oscody
Copy link

oscody commented Jan 9, 2025

Describe the bug
I am getting an error when trying to add whatsapp plugin
Cannot read properties of undefined (reading 'actions')

To Reproduce

`{
"name": "vybz",
"modelProvider": "openai",
"clients": [],
"plugins": [
"plugins": ["@elizaos/plugin-whatsapp"], // <--- Correct package
]
}.

// <--- and create an instance of it in createAgent
const whatsappPlugin = new WhatsAppPlugin({
accessToken: getSecret(character, "WHATSAPP_ACCESS_TOKEN"),
phoneNumberId: getSecret(character, "WHATSAPP_PHONE_NUMBER_ID"),
webhookVerifyToken: getSecret(
character,
"WHATSAPP_WEBHOOK_VERIFY_TOKEN"
),
businessAccountId: getSecret(character, "WHATSAPP_BUSINESS_ACCOUNT_ID"),
});`

Expected behavior

I am thinking that the plugin should be a client instead but i am not 100 % sure or the actions need to be defined

Screenshots

Screenshot 2025-01-09 at 2 19 32 PM

Additional context

@oscody oscody added the bug Something isn't working label Jan 9, 2025
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Hello @oscody! Welcome to the ai16z community. Thank you for opening your first issue; we appreciate your contribution. You are now a ai16z contributor!

@Created-for-a-purpose
Copy link

@oscody Seems like your plugin is not detected maybe because you are passing a string instead of a Plugin type.
Can you try doing this?

import { WhatsAppPlugin } from "../../plugin-whatsapp"  // or "@elizaos/plugin-whatsapp"
const whatsappPlugin = new WhatsAppPlugin({
    accessToken: "",
    phoneNumberId: "",
})

export const defaultCharacter: Character = {     // or whatever character you are defining
    name: "",
    plugins: [whatsappPlugin],
    ...
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants