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

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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

0xaguspunk
Copy link
Contributor

@0xaguspunk 0xaguspunk commented Dec 23, 2024

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 0xaguspunk changed the base branch from main to develop December 23, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants