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: Implement framework-independent Action interface #72

Merged
merged 12 commits into from
Dec 31, 2024

Conversation

FahriBilici
Copy link
Contributor

@FahriBilici FahriBilici commented Dec 26, 2024

This PR implements a framework-independent Action interface inspired by Eliza, making the tools more flexible and reusable across different frameworks.

Changes:

  • Created independent actions under src/actions/
  • Implemented Zod validation for type safety
  • Converted all LangChain tools to use actions
  • Added natural language matching with similes
  • Improved error handling and response formats

- Introduced action system for Solana tools, allowing for better modularity and maintainability.
- Updated SolanaBalanceTool, SolanaTransferTool, SolanaDeployTokenTool, SolanaDeployCollectionTool, SolanaMintNFTTool, SolanaTradeTool, and SolanaRequestFundsTool to utilize action handlers.
- Added new action exports in index.ts for better organization and accessibility.
@FahriBilici FahriBilici deleted the gib-bounty-sol756670 branch December 26, 2024 21:00
@FahriBilici FahriBilici restored the gib-bounty-sol756670 branch December 26, 2024 21:04
@FahriBilici FahriBilici reopened this Dec 26, 2024
@FahriBilici FahriBilici deleted the gib-bounty-sol756670 branch December 26, 2024 21:23
@FahriBilici FahriBilici restored the gib-bounty-sol756670 branch December 27, 2024 09:41
@FahriBilici FahriBilici reopened this Dec 27, 2024
@arihantbansal
Copy link
Member

Looks great! Have you tested this out locally? If so, could you please attach screenshots for it

@FahriBilici
Copy link
Contributor Author

FahriBilici commented Dec 27, 2024

here is the test case example

screenshot

…unctionality

- Added a new function to convert Action interfaces into LangChain Tools, improving the integration of action handlers within the Solana agent.
- Updated the agent initialization process to utilize the new conversion, allowing for dynamic tool creation based on defined actions.
- Enhanced error handling and input validation within the action execution flow.
@thearyanag
Copy link
Member

@FahriBilici this is awesome

as i can see, not all tools are converted to actions, is it something WIP

@arihantbansal
Copy link
Member

@FahriBilici Why is that in some action files you are using the agent.action format to resolve, whereas in some of the action tools you are copying from the tool file itself? Please maintain uniformity. Better to separate tools and actions imo, wdyt @thearyanag?

@FahriBilici
Copy link
Contributor Author

@FahriBilici Why is that in some action files you are using the agent.action format to resolve, whereas in some of the action tools you are copying from the tool file itself? Please maintain uniformity. Better to separate tools and actions imo, wdyt @thearyanag?

I tried to make all of them using tools. Let me know your thoughts

@arihantbansal
Copy link
Member

@FahriBilici Why is that in some action files you are using the agent.action format to resolve, whereas in some of the action tools you are copying from the tool file itself? Please maintain uniformity. Better to separate tools and actions imo, wdyt @thearyanag?

I tried to make all of them using tools. Let me know your thoughts

Looks great. Only one question, do you think it's better to transfer(agent, xyz) or agent.transfer(xyz) @thearyanag ?

I'm still undecided, but I think agent.transfer makes more sense in this context. As each action defines what the agent can do.

@arihantbansal arihantbansal mentioned this pull request Dec 29, 2024
4 tasks
@FahriBilici
Copy link
Contributor Author

FahriBilici commented Dec 30, 2024

@thearyanag, do you have any feedback or additional comments?

@thearyanag
Copy link
Member

hey @FahriBilici - I was trying to test it out, but was facing many bugs

can you just share a working video for it

@FahriBilici
Copy link
Contributor Author

hey @FahriBilici - I was trying to test it out, but was facing many bugs

can you just share a working video for it

How are you testing it? I run tests in auto mode.

@thearyanag
Copy link
Member

I tested the pyth price feed, the prompt I used was

price of 49f6b65cb1de6b10eaf75e7c03ca029c306d0357e91b5311b175084a5ad55688 feed

@FahriBilici
Copy link
Contributor Author

@thearyanag I fixed the bug and here is the video

sendai.mov

@thearyanag
Copy link
Member

looks good now

@FahriBilici can you just run pnpm lint:fix and push it pls

@FahriBilici
Copy link
Contributor Author

@thearyanag done

@thearyanag
Copy link
Member

hey @FahriBilici - just checked, not every tool under LangChain is using the action, any specific reason?

@FahriBilici
Copy link
Contributor Author

@thearyanag I have made some changes, but I noticed a few tools are missing as actions. I will add them soon. Do you have any other feedback in the meantime?

@thearyanag thearyanag merged commit 16f7dc6 into sendaifun:main Dec 31, 2024
@thearyanag
Copy link
Member

heyo @FahriBilici - can you dm me on twitter?

@FahriBilici
Copy link
Contributor Author

heyo @FahriBilici - can you dm me on twitter?

I sent

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