-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat: add goat plugin #736
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM outside of addressing comments great work :)
packages/plugin-goat/src/actions.ts
Outdated
runtime: IAgentRuntime, | ||
context: string | ||
): Promise<unknown> { | ||
return generateObject({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend generateObjectV2 instead as it is much more deterministic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! 😄 Just moved to that!! Thanks for the rec 🙏
packages/plugin-goat/src/wallet.ts
Outdated
|
||
const walletClient = createWalletClient({ | ||
account: privateKeyToAccount(privateKey as `0x${string}`), | ||
chain: base, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be hardcoded or can we configure it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be added as an .env
variable but we would need a map from string to viem
object which would still require you to change the code if you want to use a chain that is not contemplated in the map.
I centralized the definition inside provider.ts
to make it easier to update 😄
Would that work?
@monilpat I moved to generateObjectV2 and added a wallet provider. Let me know if this works 🙌 Thank you for the review! |
Relates to:
#735
#644
Risks
Low
Background
What does this PR do?
Goat is an open-source framework for connecting AI agents to any onchain app.
This PR demonstrates how to integrate Goat with Eliza, enabling AI agents to execute a wide range of onchain actions with minimal effort. Using Goat’s plugin system, developers can enable agents to:
all with just a single line of code.
The framework supports multichain by either defining actions for a specific set of chains or dynamically selecting chains per action.
This concrete example simply enables transferring and checking the balance for USDC and ETH on the Base network.
What kind of change is this?
Features (non-breaking change which adds functionality)
Why are we doing this? Any context or related work?
Enable to easily add more onchain capabilities by leveraging Goat.
Documentation changes needed?
My changes do not require a change to the project documentation.
Testing
Where should a reviewer start?
plugin-goat
Detailed testing steps
EVM_PRIVATE_KEY
,EVM_PUBLIC_KEY
andEVM_PROVIDER_URL
for Base setplugin-goat
to the dependencies of thepackage.json
from theagent
diragent/src/index.ts
, exchange it for theevmPlugin
0x18Bead774f927Af586F86F6d054C269416E163DD
0x18Bead774f927Af586F86F6d054C269416E163DD
To test actions on Base Sepolia simply:
plugin-goat/src/index.ts
and changeto
plugin-goat/src/wallet.ts
file and do the sameEVM_PROVIDER_URL
works for SepoliaDiscord username
aguspunk