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

ElfaAi Tool #258

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

ElfaAi Tool #258

wants to merge 9 commits into from

Conversation

AdwitM
Copy link

@AdwitM AdwitM commented Feb 4, 2025

Changes Made

  • Integrated the Elfa AI API into the Solana Agent Kit by adding a dedicated tool file (src/tools/elfa/elfa_api.ts) that wraps all the Elfa API endpoints.
  • Updated the SolanaAgentKit class to include supporting functions for Elfa API calls (e.g., pingElfaAiApi(), getElfaAiApiKeyStatus(), getSmartMentions(), etc.).
  • Implemented multiple LangChain tool classes (in src/langchain/elfa/elfa_tools.ts) for each Elfa API endpoint, including ping, API key status, smart mentions, top mentions by ticker, keyword search for mentions, trending tokens, and smart Twitter account stats.
  • Created corresponding Action classes (in src/actions/elfa_ai_actions.ts) for all seven endpoints, complete with input validation via zod, example outputs, and detailed descriptions.

Implementation Details

  • /v1/ping - Checks the health of the Elfa AI API (implemented via pingElfaAiApi()).

  • /v1/key-status - Retrieves the status and usage details of the Elfa AI API key (implemented via getElfaAiApiKeyStatus()).

  • /v1/mentions - Retrieves tweets by smart accounts with smart engagement (implemented via getSmartMentions(limit, offset)).

  • /v1/top-mentions - Retrieves top tweets for a given ticker symbol (implemented via getTopMentionsByTicker(ticker, timeWindow, page, pageSize, includeAccountDetails)).

  • /v1/mentions/search - Searches for tweets by keywords within a specified date range (implemented via searchMentionsByKeywords(keywords, from, to, limit)).

  • /v1/trending-tokens - Retrieves trending tokens based on mentions (implemented via getTrendingTokens()).

  • /v1/account/smart-stats - Retrieves smart stats and social metrics for a specified Twitter account (implemented via getSmartTwitterAccountStats(username)).

Prompt Used

image

Checklist

  • I have tested these changes locally
  • I have added the prompt used to test it

@AdwitM AdwitM marked this pull request as ready for review February 4, 2025 10:09
@michaelessiet
Copy link
Collaborator

hey @AdwitM , please can you share screenshots showcasing the other actions as well

@AdwitM
Copy link
Author

AdwitM commented Feb 5, 2025

  • /v1/ping - screenshot provided in pr message

  • /v1/key-status
    image

  • /v1/mentions
    image

  • /v1/trending-tokens
    image

  • /v1/mentions/search
    image

  • /v1/account/smart-stats
    image

  • /v1/top-mentions
    image

@michaelessiet
Copy link
Collaborator

For the mentions function that isn't working, have you tried testing with the vercel-ai sdk and verified that it doesn't work with that too?

@AdwitM
Copy link
Author

AdwitM commented Feb 6, 2025

For the mentions function that isn't working, have you tried testing with the vercel-ai sdk and verified that it doesn't work with that too?

Hey, thanks for the suggestion @michaelessiet
it seems to have worked with using vercel ai, updated the original comment

src/tools/elfa_ai/elfa_ai_api.ts Outdated Show resolved Hide resolved
@AdwitM AdwitM requested a review from michaelessiet February 7, 2025 05:52
@AdwitM
Copy link
Author

AdwitM commented Feb 8, 2025

Hey @michaelessiet
requesting to merge the branch if it looks good
thanks

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.

2 participants