Use Elfa AI
The Use Elfa AI
tool, part of AgentiPy, allows users to leverage the Elfa AI platform (https://api.elfa.ai
) for insights related to the Solana blockchain and crypto markets. It can fetch data such as token mentions, trending tokens, and Twitter account statistics. This tool requires an Elfa AI API key.
Functionality
This tool is implemented in the ElfaAiManager
class and interacts directly with the Elfa AI API using aiohttp
. The API key is passed via headers, which are prepared by agentipy.utils.elfa_ai.get_headers(agent)
.
Key Methods:
ping_elfa_ai_api(agent: SolanaAgentKit) -> dict
: Pings the Elfa AI API to check connectivity.get_elfa_ai_api_key_status(agent: SolanaAgentKit) -> dict
: Checks the status of the provided Elfa AI API key.get_smart_mentions(agent: SolanaAgentKit, limit: int = 100, offset: int = 0) -> dict
: Retrieves "smart mentions" (curated or important mentions) from Elfa AI.get_top_mentions_by_ticker(agent: SolanaAgentKit, ticker: str, time_window: str = "1h", page: int = 1, page_size: int = 10, include_account_details: bool = False) -> dict
: Fetches top mentions for a specific tokenticker
within atime_window
.search_mentions_by_keywords(agent: SolanaAgentKit, keywords: str, from_timestamp: int, to_timestamp: int, limit: int = 20, cursor: str = None) -> dict
: Searches for mentions based onkeywords
within a given timestamp range.get_trending_tokens_using_elfa_ai(agent: SolanaAgentKit, time_window: str = "24h", page: int = 1, page_size: int = 50, min_mentions: int = 5) -> dict
: Gets a list of trending tokens based on mention activity.get_smart_twitter_account_stats(agent: SolanaAgentKit, username: str) -> dict
: Retrieves statistics for a given Twitterusername
.
Important Considerations:
API Key: An Elfa AI API key is mandatory for using this tool. It should be set in the
SolanaAgentKit
instance asagent.elfa_ai_api_key
.External API: The tool's functionality is entirely dependent on the Elfa AI API. Check Elfa AI's documentation for rate limits, data structure details, and terms of service.
Source Code
You can find the source code for this tool on GitHub: https://github.com/niceberginc/agentipy/blob/main/agentipy/tools/use_elfa_ai.py
Last updated