eliza icon indicating copy to clipboard operation
eliza copied to clipboard

feat: improve GOAT integration by allowing tool calling when using generateText

Open 0xaguspunk opened this issue 2 months ago • 8 comments

Relates to:

https://x.com/sunosuporno/status/1870967395780792741

Risks

Low

Background

What does this PR do?

Two main things:

  1. Update generateText API to be able to pass through tool options to leverage the model's tool calling capabilities
  2. Update the GOAT plugin to use tool calling allowing it to perform complex onchain actions that require multiple steps. Now developers can define high level actions (swap, bet on Polymarket, stake, etc.) and GOAT will take care of handling each action (see the screenshots below)

What kind of change is this?

Improvements (misc. changes to existing features)

Documentation changes needed?

I have updated the documentation accordingly.

Testing

Detailed testing steps

  1. Clone the repo and build it
  2. Set up the EVM_PRIVATE_KEY and EVM_PROVIDER_URL env variables
  3. Uncomment lines 70-72 in the actions.ts file in the GOAT plugin
  4. Prompt the agent with "Swap 0.1 USDC for MODE using KIM in a single hop"
  5. In the agent logs you should see all the different steps that the agent is making
  6. The tx should fail unless you have ETH and USDC in MODE :)

Screenshots

Before

Agent can just do one function call so you need to specify the inputs like this:

image

After

Agent can do multiple function calls in an action so inputs are more human friendly: image

In the background you can also log all the different tool interactions: Screenshot 2024-12-23 at 16 24 49

Discord username

aguspunk

0xaguspunk avatar Dec 23 '24 15:12 0xaguspunk