intentkit 0.5.1__py3-none-any.whl → 0.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of intentkit might be problematic. Click here for more details.
- intentkit/__init__.py +17 -0
- {abstracts → intentkit/abstracts}/skill.py +12 -0
- intentkit/clients/cdp.py +151 -0
- {config → intentkit/config}/config.py +12 -4
- {core → intentkit/core}/engine.py +39 -31
- {core → intentkit/core}/node.py +8 -4
- {core → intentkit/core}/prompt.py +5 -6
- {core → intentkit/core}/skill.py +11 -0
- {models → intentkit/models}/agent.py +2 -9
- {models → intentkit/models}/agent_data.py +18 -0
- {models → intentkit/models}/agent_schema.json +12 -0
- {models → intentkit/models}/chat.py +50 -0
- {models → intentkit/models}/skill.py +19 -0
- {skills → intentkit/skills}/base.py +37 -17
- {skills → intentkit/skills}/cdp/__init__.py +6 -14
- intentkit/skills/cdp/get_balance.py +133 -0
- {skills → intentkit/skills}/cdp/schema.json +0 -64
- {skills → intentkit/skills}/cryptocompare/fetch_news.py +2 -2
- {skills → intentkit/skills}/cryptocompare/fetch_price.py +2 -2
- {skills → intentkit/skills}/cryptocompare/fetch_top_exchanges.py +2 -2
- {skills → intentkit/skills}/cryptocompare/fetch_top_market_cap.py +2 -2
- {skills → intentkit/skills}/cryptocompare/fetch_top_volume.py +2 -2
- {skills → intentkit/skills}/cryptocompare/fetch_trading_signals.py +2 -2
- {skills → intentkit/skills}/defillama/base.py +3 -3
- {skills → intentkit/skills}/enso/base.py +27 -4
- {skills → intentkit/skills}/enso/networks.py +1 -1
- {skills → intentkit/skills}/enso/route.py +24 -23
- {skills → intentkit/skills}/enso/tokens.py +1 -1
- {skills → intentkit/skills}/enso/wallet.py +27 -23
- intentkit/skills/firecrawl/README.md +211 -0
- intentkit/skills/firecrawl/__init__.py +107 -0
- intentkit/skills/firecrawl/base.py +28 -0
- intentkit/skills/firecrawl/clear.py +87 -0
- intentkit/skills/firecrawl/crawl.py +399 -0
- intentkit/skills/firecrawl/firecrawl.png +0 -0
- intentkit/skills/firecrawl/query.py +123 -0
- intentkit/skills/firecrawl/schema.json +153 -0
- intentkit/skills/firecrawl/scrape.py +318 -0
- intentkit/skills/firecrawl/utils.py +306 -0
- {skills → intentkit/skills}/heurist/image_generation_animagine_xl.py +1 -1
- {skills → intentkit/skills}/heurist/image_generation_arthemy_comics.py +1 -1
- {skills → intentkit/skills}/heurist/image_generation_arthemy_real.py +1 -1
- {skills → intentkit/skills}/heurist/image_generation_braindance.py +1 -1
- {skills → intentkit/skills}/heurist/image_generation_cyber_realistic_xl.py +1 -1
- {skills → intentkit/skills}/heurist/image_generation_flux_1_dev.py +1 -1
- {skills → intentkit/skills}/heurist/image_generation_sdxl.py +1 -1
- intentkit/skills/http/README.md +78 -0
- intentkit/skills/http/__init__.py +100 -0
- intentkit/skills/http/base.py +21 -0
- intentkit/skills/http/get.py +96 -0
- intentkit/skills/http/http.svg +15 -0
- intentkit/skills/http/post.py +113 -0
- intentkit/skills/http/put.py +113 -0
- intentkit/skills/http/schema.json +80 -0
- {skills → intentkit/skills}/lifi/token_execute.py +1 -1
- {skills → intentkit/skills}/openai/dalle_image_generation.py +1 -1
- {skills → intentkit/skills}/openai/gpt_image_generation.py +1 -1
- {skills → intentkit/skills}/openai/gpt_image_to_image.py +1 -1
- intentkit/skills/supabase/__init__.py +116 -0
- intentkit/skills/supabase/base.py +72 -0
- intentkit/skills/supabase/delete_data.py +102 -0
- intentkit/skills/supabase/fetch_data.py +120 -0
- intentkit/skills/supabase/insert_data.py +70 -0
- intentkit/skills/supabase/invoke_function.py +74 -0
- intentkit/skills/supabase/schema.json +170 -0
- intentkit/skills/supabase/supabase.svg +15 -0
- intentkit/skills/supabase/update_data.py +105 -0
- intentkit/skills/supabase/upsert_data.py +77 -0
- {skills → intentkit/skills}/system/read_agent_api_key.py +1 -1
- {skills → intentkit/skills}/system/regenerate_agent_api_key.py +1 -1
- {skills → intentkit/skills}/token/base.py +1 -39
- {skills → intentkit/skills}/twitter/follow_user.py +3 -3
- {skills → intentkit/skills}/twitter/get_mentions.py +6 -6
- {skills → intentkit/skills}/twitter/get_timeline.py +5 -5
- {skills → intentkit/skills}/twitter/get_user_by_username.py +3 -3
- {skills → intentkit/skills}/twitter/get_user_tweets.py +5 -5
- {skills → intentkit/skills}/twitter/like_tweet.py +3 -3
- {skills → intentkit/skills}/twitter/post_tweet.py +4 -4
- {skills → intentkit/skills}/twitter/reply_tweet.py +4 -4
- {skills → intentkit/skills}/twitter/retweet.py +3 -3
- {skills → intentkit/skills}/twitter/search_tweets.py +5 -5
- {skills → intentkit/skills}/unrealspeech/text_to_speech.py +1 -1
- {skills → intentkit/skills}/web_scraper/README.md +35 -4
- {skills → intentkit/skills}/web_scraper/__init__.py +16 -0
- intentkit/skills/web_scraper/document_indexer.py +143 -0
- {skills → intentkit/skills}/web_scraper/schema.json +28 -0
- intentkit/skills/web_scraper/scrape_and_index.py +262 -0
- intentkit/skills/web_scraper/utils.py +684 -0
- intentkit/skills/web_scraper/website_indexer.py +456 -0
- {utils → intentkit/utils}/logging.py +1 -1
- {intentkit-0.5.1.dist-info → intentkit-0.6.0.dist-info}/METADATA +1 -1
- intentkit-0.6.0.dist-info/RECORD +396 -0
- clients/cdp.py +0 -53
- intentkit-0.5.1.dist-info/RECORD +0 -364
- skills/cdp/get_balance.py +0 -81
- skills/web_scraper/scrape_and_index.py +0 -327
- {abstracts → intentkit/abstracts}/__init__.py +0 -0
- {abstracts → intentkit/abstracts}/agent.py +0 -0
- {abstracts → intentkit/abstracts}/api.py +0 -0
- {abstracts → intentkit/abstracts}/engine.py +0 -0
- {abstracts → intentkit/abstracts}/exception.py +0 -0
- {abstracts → intentkit/abstracts}/graph.py +0 -0
- {abstracts → intentkit/abstracts}/twitter.py +0 -0
- {clients → intentkit/clients}/__init__.py +0 -0
- {clients → intentkit/clients}/twitter.py +0 -0
- {config → intentkit/config}/__init__.py +0 -0
- {core → intentkit/core}/__init__.py +0 -0
- {core → intentkit/core}/agent.py +0 -0
- {core → intentkit/core}/api.py +0 -0
- {core → intentkit/core}/client.py +0 -0
- {core → intentkit/core}/credit.py +0 -0
- {models → intentkit/models}/app_setting.py +0 -0
- {models → intentkit/models}/base.py +0 -0
- {models → intentkit/models}/conversation.py +0 -0
- {models → intentkit/models}/credit.py +0 -0
- {models → intentkit/models}/db.py +0 -0
- {models → intentkit/models}/db_mig.py +0 -0
- {models → intentkit/models}/generator.py +0 -0
- {models → intentkit/models}/llm.py +0 -0
- {models → intentkit/models}/redis.py +0 -0
- {models → intentkit/models}/user.py +0 -0
- {skills → intentkit/skills}/__init__.py +0 -0
- {skills → intentkit/skills}/acolyt/__init__.py +0 -0
- {skills → intentkit/skills}/acolyt/acolyt.jpg +0 -0
- {skills → intentkit/skills}/acolyt/ask.py +0 -0
- {skills → intentkit/skills}/acolyt/base.py +0 -0
- {skills → intentkit/skills}/acolyt/schema.json +0 -0
- {skills → intentkit/skills}/aixbt/README.md +0 -0
- {skills → intentkit/skills}/aixbt/__init__.py +0 -0
- {skills → intentkit/skills}/aixbt/aixbt.jpg +0 -0
- {skills → intentkit/skills}/aixbt/base.py +0 -0
- {skills → intentkit/skills}/aixbt/projects.py +0 -0
- {skills → intentkit/skills}/aixbt/schema.json +0 -0
- {skills → intentkit/skills}/allora/__init__.py +0 -0
- {skills → intentkit/skills}/allora/allora.jpeg +0 -0
- {skills → intentkit/skills}/allora/base.py +0 -0
- {skills → intentkit/skills}/allora/price.py +0 -0
- {skills → intentkit/skills}/allora/schema.json +0 -0
- {skills → intentkit/skills}/carv/README.md +0 -0
- {skills → intentkit/skills}/carv/__init__.py +0 -0
- {skills → intentkit/skills}/carv/base.py +0 -0
- {skills → intentkit/skills}/carv/carv.webp +0 -0
- {skills → intentkit/skills}/carv/fetch_news.py +0 -0
- {skills → intentkit/skills}/carv/onchain_query.py +0 -0
- {skills → intentkit/skills}/carv/schema.json +0 -0
- {skills → intentkit/skills}/carv/token_info_and_price.py +0 -0
- {skills → intentkit/skills}/cdp/base.py +0 -0
- {skills → intentkit/skills}/cdp/cdp.png +0 -0
- {skills → intentkit/skills}/chainlist/README.md +0 -0
- {skills → intentkit/skills}/chainlist/__init__.py +0 -0
- {skills → intentkit/skills}/chainlist/base.py +0 -0
- {skills → intentkit/skills}/chainlist/chain_lookup.py +0 -0
- {skills → intentkit/skills}/chainlist/chainlist.png +0 -0
- {skills → intentkit/skills}/chainlist/schema.json +0 -0
- {skills → intentkit/skills}/common/__init__.py +0 -0
- {skills → intentkit/skills}/common/base.py +0 -0
- {skills → intentkit/skills}/common/common.jpg +0 -0
- {skills → intentkit/skills}/common/current_time.py +0 -0
- {skills → intentkit/skills}/common/schema.json +0 -0
- {skills → intentkit/skills}/cookiefun/README.md +0 -0
- {skills → intentkit/skills}/cookiefun/__init__.py +0 -0
- {skills → intentkit/skills}/cookiefun/base.py +0 -0
- {skills → intentkit/skills}/cookiefun/constants.py +0 -0
- {skills → intentkit/skills}/cookiefun/cookiefun.png +0 -0
- {skills → intentkit/skills}/cookiefun/get_account_details.py +0 -0
- {skills → intentkit/skills}/cookiefun/get_account_feed.py +0 -0
- {skills → intentkit/skills}/cookiefun/get_account_smart_followers.py +0 -0
- {skills → intentkit/skills}/cookiefun/get_sectors.py +0 -0
- {skills → intentkit/skills}/cookiefun/schema.json +0 -0
- {skills → intentkit/skills}/cookiefun/search_accounts.py +0 -0
- {skills → intentkit/skills}/cryptocompare/__init__.py +0 -0
- {skills → intentkit/skills}/cryptocompare/api.py +0 -0
- {skills → intentkit/skills}/cryptocompare/base.py +0 -0
- {skills → intentkit/skills}/cryptocompare/cryptocompare.png +0 -0
- {skills → intentkit/skills}/cryptocompare/schema.json +0 -0
- {skills → intentkit/skills}/cryptopanic/__init__.py +0 -0
- {skills → intentkit/skills}/cryptopanic/base.py +0 -0
- {skills → intentkit/skills}/cryptopanic/cryptopanic.png +0 -0
- {skills → intentkit/skills}/cryptopanic/fetch_crypto_news.py +0 -0
- {skills → intentkit/skills}/cryptopanic/fetch_crypto_sentiment.py +0 -0
- {skills → intentkit/skills}/cryptopanic/schema.json +0 -0
- {skills → intentkit/skills}/dapplooker/README.md +0 -0
- {skills → intentkit/skills}/dapplooker/__init__.py +0 -0
- {skills → intentkit/skills}/dapplooker/base.py +0 -0
- {skills → intentkit/skills}/dapplooker/dapplooker.jpg +0 -0
- {skills → intentkit/skills}/dapplooker/dapplooker_token_data.py +0 -0
- {skills → intentkit/skills}/dapplooker/schema.json +0 -0
- {skills → intentkit/skills}/defillama/__init__.py +0 -0
- {skills → intentkit/skills}/defillama/api.py +0 -0
- {skills → intentkit/skills}/defillama/coins/__init__.py +0 -0
- {skills → intentkit/skills}/defillama/coins/fetch_batch_historical_prices.py +0 -0
- {skills → intentkit/skills}/defillama/coins/fetch_block.py +0 -0
- {skills → intentkit/skills}/defillama/coins/fetch_current_prices.py +0 -0
- {skills → intentkit/skills}/defillama/coins/fetch_first_price.py +0 -0
- {skills → intentkit/skills}/defillama/coins/fetch_historical_prices.py +0 -0
- {skills → intentkit/skills}/defillama/coins/fetch_price_chart.py +0 -0
- {skills → intentkit/skills}/defillama/coins/fetch_price_percentage.py +0 -0
- {skills → intentkit/skills}/defillama/config/__init__.py +0 -0
- {skills → intentkit/skills}/defillama/config/chains.py +0 -0
- {skills → intentkit/skills}/defillama/defillama.jpeg +0 -0
- {skills → intentkit/skills}/defillama/fees/__init__.py +0 -0
- {skills → intentkit/skills}/defillama/fees/fetch_fees_overview.py +0 -0
- {skills → intentkit/skills}/defillama/schema.json +0 -0
- {skills → intentkit/skills}/defillama/stablecoins/__init__.py +0 -0
- {skills → intentkit/skills}/defillama/stablecoins/fetch_stablecoin_chains.py +0 -0
- {skills → intentkit/skills}/defillama/stablecoins/fetch_stablecoin_charts.py +0 -0
- {skills → intentkit/skills}/defillama/stablecoins/fetch_stablecoin_prices.py +0 -0
- {skills → intentkit/skills}/defillama/stablecoins/fetch_stablecoins.py +0 -0
- {skills → intentkit/skills}/defillama/tests/__init__.py +0 -0
- {skills → intentkit/skills}/defillama/tests/api_integration.test.py +0 -0
- {skills → intentkit/skills}/defillama/tests/api_unit.test.py +0 -0
- {skills → intentkit/skills}/defillama/tvl/__init__.py +0 -0
- {skills → intentkit/skills}/defillama/tvl/fetch_chain_historical_tvl.py +0 -0
- {skills → intentkit/skills}/defillama/tvl/fetch_chains.py +0 -0
- {skills → intentkit/skills}/defillama/tvl/fetch_historical_tvl.py +0 -0
- {skills → intentkit/skills}/defillama/tvl/fetch_protocol.py +0 -0
- {skills → intentkit/skills}/defillama/tvl/fetch_protocol_current_tvl.py +0 -0
- {skills → intentkit/skills}/defillama/tvl/fetch_protocols.py +0 -0
- {skills → intentkit/skills}/defillama/volumes/__init__.py +0 -0
- {skills → intentkit/skills}/defillama/volumes/fetch_dex_overview.py +0 -0
- {skills → intentkit/skills}/defillama/volumes/fetch_dex_summary.py +0 -0
- {skills → intentkit/skills}/defillama/volumes/fetch_options_overview.py +0 -0
- {skills → intentkit/skills}/defillama/yields/__init__.py +0 -0
- {skills → intentkit/skills}/defillama/yields/fetch_pool_chart.py +0 -0
- {skills → intentkit/skills}/defillama/yields/fetch_pools.py +0 -0
- {skills → intentkit/skills}/dexscreener/__init__.py +0 -0
- {skills → intentkit/skills}/dexscreener/base.py +0 -0
- {skills → intentkit/skills}/dexscreener/dexscreener.png +0 -0
- {skills → intentkit/skills}/dexscreener/model/__init__.py +0 -0
- {skills → intentkit/skills}/dexscreener/model/search_token_response.py +0 -0
- {skills → intentkit/skills}/dexscreener/schema.json +0 -0
- {skills → intentkit/skills}/dexscreener/search_token.py +0 -0
- {skills → intentkit/skills}/dune_analytics/__init__.py +0 -0
- {skills → intentkit/skills}/dune_analytics/base.py +0 -0
- {skills → intentkit/skills}/dune_analytics/dune.png +0 -0
- {skills → intentkit/skills}/dune_analytics/fetch_kol_buys.py +0 -0
- {skills → intentkit/skills}/dune_analytics/fetch_nation_metrics.py +0 -0
- {skills → intentkit/skills}/dune_analytics/schema.json +0 -0
- {skills → intentkit/skills}/elfa/README.md +0 -0
- {skills → intentkit/skills}/elfa/__init__.py +0 -0
- {skills → intentkit/skills}/elfa/base.py +0 -0
- {skills → intentkit/skills}/elfa/elfa.jpg +0 -0
- {skills → intentkit/skills}/elfa/mention.py +0 -0
- {skills → intentkit/skills}/elfa/schema.json +0 -0
- {skills → intentkit/skills}/elfa/stats.py +0 -0
- {skills → intentkit/skills}/elfa/tokens.py +0 -0
- {skills → intentkit/skills}/enso/README.md +0 -0
- {skills → intentkit/skills}/enso/__init__.py +0 -0
- {skills → intentkit/skills}/enso/abi/__init__.py +0 -0
- {skills → intentkit/skills}/enso/abi/approval.py +0 -0
- {skills → intentkit/skills}/enso/abi/erc20.py +0 -0
- {skills → intentkit/skills}/enso/abi/route.py +0 -0
- {skills → intentkit/skills}/enso/best_yield.py +0 -0
- {skills → intentkit/skills}/enso/enso.jpg +0 -0
- {skills → intentkit/skills}/enso/prices.py +0 -0
- {skills → intentkit/skills}/enso/schema.json +0 -0
- {skills → intentkit/skills}/github/README.md +0 -0
- {skills → intentkit/skills}/github/__init__.py +0 -0
- {skills → intentkit/skills}/github/base.py +0 -0
- {skills → intentkit/skills}/github/github.jpg +0 -0
- {skills → intentkit/skills}/github/github_search.py +0 -0
- {skills → intentkit/skills}/github/schema.json +0 -0
- {skills → intentkit/skills}/heurist/__init__.py +0 -0
- {skills → intentkit/skills}/heurist/base.py +0 -0
- {skills → intentkit/skills}/heurist/heurist.png +0 -0
- {skills → intentkit/skills}/heurist/schema.json +0 -0
- {skills → intentkit/skills}/lifi/README.md +0 -0
- {skills → intentkit/skills}/lifi/__init__.py +0 -0
- {skills → intentkit/skills}/lifi/base.py +0 -0
- {skills → intentkit/skills}/lifi/lifi.png +0 -0
- {skills → intentkit/skills}/lifi/schema.json +0 -0
- {skills → intentkit/skills}/lifi/token_quote.py +0 -0
- {skills → intentkit/skills}/lifi/utils.py +0 -0
- {skills → intentkit/skills}/moralis/README.md +0 -0
- {skills → intentkit/skills}/moralis/__init__.py +0 -0
- {skills → intentkit/skills}/moralis/api.py +0 -0
- {skills → intentkit/skills}/moralis/base.py +0 -0
- {skills → intentkit/skills}/moralis/fetch_chain_portfolio.py +0 -0
- {skills → intentkit/skills}/moralis/fetch_nft_portfolio.py +0 -0
- {skills → intentkit/skills}/moralis/fetch_solana_portfolio.py +0 -0
- {skills → intentkit/skills}/moralis/fetch_wallet_portfolio.py +0 -0
- {skills → intentkit/skills}/moralis/moralis.png +0 -0
- {skills → intentkit/skills}/moralis/schema.json +0 -0
- {skills → intentkit/skills}/moralis/tests/__init__.py +0 -0
- {skills → intentkit/skills}/moralis/tests/test_wallet.py +0 -0
- {skills → intentkit/skills}/nation/__init__.py +0 -0
- {skills → intentkit/skills}/nation/base.py +0 -0
- {skills → intentkit/skills}/nation/nation.png +0 -0
- {skills → intentkit/skills}/nation/nft_check.py +0 -0
- {skills → intentkit/skills}/nation/schema.json +0 -0
- {skills → intentkit/skills}/openai/__init__.py +0 -0
- {skills → intentkit/skills}/openai/base.py +0 -0
- {skills → intentkit/skills}/openai/image_to_text.py +0 -0
- {skills → intentkit/skills}/openai/openai.png +0 -0
- {skills → intentkit/skills}/openai/schema.json +0 -0
- {skills → intentkit/skills}/portfolio/README.md +0 -0
- {skills → intentkit/skills}/portfolio/__init__.py +0 -0
- {skills → intentkit/skills}/portfolio/base.py +0 -0
- {skills → intentkit/skills}/portfolio/constants.py +0 -0
- {skills → intentkit/skills}/portfolio/moralis.png +0 -0
- {skills → intentkit/skills}/portfolio/schema.json +0 -0
- {skills → intentkit/skills}/portfolio/token_balances.py +0 -0
- {skills → intentkit/skills}/portfolio/wallet_approvals.py +0 -0
- {skills → intentkit/skills}/portfolio/wallet_defi_positions.py +0 -0
- {skills → intentkit/skills}/portfolio/wallet_history.py +0 -0
- {skills → intentkit/skills}/portfolio/wallet_net_worth.py +0 -0
- {skills → intentkit/skills}/portfolio/wallet_nfts.py +0 -0
- {skills → intentkit/skills}/portfolio/wallet_profitability.py +0 -0
- {skills → intentkit/skills}/portfolio/wallet_profitability_summary.py +0 -0
- {skills → intentkit/skills}/portfolio/wallet_stats.py +0 -0
- {skills → intentkit/skills}/portfolio/wallet_swaps.py +0 -0
- {skills → intentkit/skills}/skills.toml +0 -0
- {skills → intentkit/skills}/slack/__init__.py +0 -0
- {skills → intentkit/skills}/slack/base.py +0 -0
- {skills → intentkit/skills}/slack/get_channel.py +0 -0
- {skills → intentkit/skills}/slack/get_message.py +0 -0
- {skills → intentkit/skills}/slack/schedule_message.py +0 -0
- {skills → intentkit/skills}/slack/schema.json +0 -0
- {skills → intentkit/skills}/slack/send_message.py +0 -0
- {skills → intentkit/skills}/slack/slack.jpg +0 -0
- {skills → intentkit/skills}/system/__init__.py +0 -0
- {skills → intentkit/skills}/system/base.py +0 -0
- {skills → intentkit/skills}/system/schema.json +0 -0
- {skills → intentkit/skills}/system/system.svg +0 -0
- {skills → intentkit/skills}/tavily/README.md +0 -0
- {skills → intentkit/skills}/tavily/__init__.py +0 -0
- {skills → intentkit/skills}/tavily/base.py +0 -0
- {skills → intentkit/skills}/tavily/schema.json +0 -0
- {skills → intentkit/skills}/tavily/tavily.jpg +0 -0
- {skills → intentkit/skills}/tavily/tavily_extract.py +0 -0
- {skills → intentkit/skills}/tavily/tavily_search.py +0 -0
- {skills → intentkit/skills}/token/README.md +0 -0
- {skills → intentkit/skills}/token/__init__.py +0 -0
- {skills → intentkit/skills}/token/constants.py +0 -0
- {skills → intentkit/skills}/token/erc20_transfers.py +0 -0
- {skills → intentkit/skills}/token/moralis.png +0 -0
- {skills → intentkit/skills}/token/schema.json +0 -0
- {skills → intentkit/skills}/token/token_analytics.py +0 -0
- {skills → intentkit/skills}/token/token_price.py +0 -0
- {skills → intentkit/skills}/token/token_search.py +0 -0
- {skills → intentkit/skills}/twitter/__init__.py +0 -0
- {skills → intentkit/skills}/twitter/base.py +0 -0
- {skills → intentkit/skills}/twitter/schema.json +0 -0
- {skills → intentkit/skills}/twitter/twitter.png +0 -0
- {skills → intentkit/skills}/unrealspeech/__init__.py +0 -0
- {skills → intentkit/skills}/unrealspeech/base.py +0 -0
- {skills → intentkit/skills}/unrealspeech/schema.json +0 -0
- {skills → intentkit/skills}/unrealspeech/unrealspeech.jpg +0 -0
- {skills → intentkit/skills}/venice_audio/__init__.py +0 -0
- {skills → intentkit/skills}/venice_audio/base.py +0 -0
- {skills → intentkit/skills}/venice_audio/input.py +0 -0
- {skills → intentkit/skills}/venice_audio/schema.json +0 -0
- {skills → intentkit/skills}/venice_audio/venice_audio.py +0 -0
- {skills → intentkit/skills}/venice_audio/venice_logo.jpg +0 -0
- {skills → intentkit/skills}/venice_image/README.md +0 -0
- {skills → intentkit/skills}/venice_image/__init__.py +0 -0
- {skills → intentkit/skills}/venice_image/api.py +0 -0
- {skills → intentkit/skills}/venice_image/base.py +0 -0
- {skills → intentkit/skills}/venice_image/config.py +0 -0
- {skills → intentkit/skills}/venice_image/image_enhance/README.md +0 -0
- {skills → intentkit/skills}/venice_image/image_enhance/__init__.py +0 -0
- {skills → intentkit/skills}/venice_image/image_enhance/image_enhance.py +0 -0
- {skills → intentkit/skills}/venice_image/image_enhance/image_enhance_base.py +0 -0
- {skills → intentkit/skills}/venice_image/image_enhance/image_enhance_input.py +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/README.md +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/__init__.py +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/image_generation_base.py +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/image_generation_fluently_xl.py +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/image_generation_flux_dev.py +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/image_generation_flux_dev_uncensored.py +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/image_generation_input.py +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/image_generation_lustify_sdxl.py +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/image_generation_pony_realism.py +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/image_generation_stable_diffusion_3_5.py +0 -0
- {skills → intentkit/skills}/venice_image/image_generation/image_generation_venice_sd35.py +0 -0
- {skills → intentkit/skills}/venice_image/image_upscale/README.md +0 -0
- {skills → intentkit/skills}/venice_image/image_upscale/__init__.py +0 -0
- {skills → intentkit/skills}/venice_image/image_upscale/image_upscale.py +0 -0
- {skills → intentkit/skills}/venice_image/image_upscale/image_upscale_base.py +0 -0
- {skills → intentkit/skills}/venice_image/image_upscale/image_upscale_input.py +0 -0
- {skills → intentkit/skills}/venice_image/image_vision/README.md +0 -0
- {skills → intentkit/skills}/venice_image/image_vision/__init__.py +0 -0
- {skills → intentkit/skills}/venice_image/image_vision/image_vision.py +0 -0
- {skills → intentkit/skills}/venice_image/image_vision/image_vision_base.py +0 -0
- {skills → intentkit/skills}/venice_image/image_vision/image_vision_input.py +0 -0
- {skills → intentkit/skills}/venice_image/schema.json +0 -0
- {skills → intentkit/skills}/venice_image/utils.py +0 -0
- {skills → intentkit/skills}/venice_image/venice_image.jpg +0 -0
- {skills → intentkit/skills}/web_scraper/base.py +0 -0
- {skills → intentkit/skills}/web_scraper/langchain.png +0 -0
- {utils → intentkit/utils}/__init__.py +0 -0
- {utils → intentkit/utils}/chain.py +0 -0
- {utils → intentkit/utils}/error.py +0 -0
- {utils → intentkit/utils}/middleware.py +0 -0
- {utils → intentkit/utils}/random.py +0 -0
- {utils → intentkit/utils}/s3.py +0 -0
- {utils → intentkit/utils}/slack_alert.py +0 -0
- {utils → intentkit/utils}/tx.py +0 -0
- {intentkit-0.5.1.dist-info → intentkit-0.6.0.dist-info}/WHEEL +0 -0
- {intentkit-0.5.1.dist-info → intentkit-0.6.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,9 +6,7 @@ from langchain_core.runnables import RunnableConfig
|
|
|
6
6
|
from pydantic import BaseModel, Field
|
|
7
7
|
|
|
8
8
|
from intentkit.skills.base import SkillContext
|
|
9
|
-
from intentkit.utils.tx import EvmContractWrapper
|
|
10
9
|
|
|
11
|
-
from .abi.erc20 import ABI_ERC20
|
|
12
10
|
from .base import EnsoBaseTool, base_url, default_chain_id
|
|
13
11
|
|
|
14
12
|
|
|
@@ -81,14 +79,14 @@ class EnsoGetWalletBalances(EnsoBaseTool):
|
|
|
81
79
|
|
|
82
80
|
context: SkillContext = self.context_from_config(config)
|
|
83
81
|
api_token = self.get_api_token(context)
|
|
84
|
-
|
|
82
|
+
account = await self.get_account(context)
|
|
85
83
|
headers = {
|
|
86
84
|
"accept": "application/json",
|
|
87
85
|
"Authorization": f"Bearer {api_token}",
|
|
88
86
|
}
|
|
89
87
|
|
|
90
88
|
params = EnsoGetBalancesInput(chainId=chainId).model_dump(exclude_none=True)
|
|
91
|
-
params["eoaAddress"] =
|
|
89
|
+
params["eoaAddress"] = account.address
|
|
92
90
|
params["useEoa"] = True
|
|
93
91
|
|
|
94
92
|
async with httpx.AsyncClient() as client:
|
|
@@ -178,7 +176,7 @@ class EnsoGetWalletApprovals(EnsoBaseTool):
|
|
|
178
176
|
|
|
179
177
|
context: SkillContext = self.context_from_config(config)
|
|
180
178
|
api_token = self.get_api_token(context)
|
|
181
|
-
|
|
179
|
+
account = await self.get_account(context)
|
|
182
180
|
|
|
183
181
|
headers = {
|
|
184
182
|
"accept": "application/json",
|
|
@@ -187,7 +185,7 @@ class EnsoGetWalletApprovals(EnsoBaseTool):
|
|
|
187
185
|
|
|
188
186
|
params = EnsoGetApprovalsInput(
|
|
189
187
|
chainId=chainId,
|
|
190
|
-
fromAddress=
|
|
188
|
+
fromAddress=account.address,
|
|
191
189
|
)
|
|
192
190
|
|
|
193
191
|
if kwargs.get("routingStrategy"):
|
|
@@ -318,15 +316,14 @@ class EnsoWalletApprove(EnsoBaseTool):
|
|
|
318
316
|
url = f"{base_url}/api/v1/wallet/approve"
|
|
319
317
|
context: SkillContext = self.context_from_config(config)
|
|
320
318
|
api_token = self.get_api_token(context)
|
|
321
|
-
|
|
322
|
-
wallet = await self.get_wallet(context)
|
|
319
|
+
account = await self.get_account(context)
|
|
323
320
|
|
|
324
321
|
headers = {
|
|
325
322
|
"accept": "application/json",
|
|
326
323
|
"Authorization": f"Bearer {api_token}",
|
|
327
324
|
}
|
|
328
325
|
|
|
329
|
-
from_address =
|
|
326
|
+
from_address = account.address
|
|
330
327
|
|
|
331
328
|
params = EnsoWalletApproveInput(
|
|
332
329
|
tokenAddress=tokenAddress,
|
|
@@ -352,20 +349,27 @@ class EnsoWalletApprove(EnsoBaseTool):
|
|
|
352
349
|
content = EnsoWalletApproveOutput(**json_dict)
|
|
353
350
|
artifact = EnsoWalletApproveArtifact(**json_dict)
|
|
354
351
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
352
|
+
# Use the wallet provider to send the transaction
|
|
353
|
+
wallet_provider = await self.get_wallet_provider(context)
|
|
354
|
+
|
|
355
|
+
# Extract transaction data from the Enso API response
|
|
356
|
+
tx_data = json_dict.get("tx", {})
|
|
357
|
+
if tx_data:
|
|
358
|
+
# Send the transaction using the wallet provider
|
|
359
|
+
tx_hash = wallet_provider.send_transaction(
|
|
360
|
+
{
|
|
361
|
+
"to": tx_data.get("to"),
|
|
362
|
+
"data": tx_data.get("data", "0x"),
|
|
363
|
+
"value": tx_data.get("value", 0),
|
|
364
|
+
}
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
# Wait for transaction confirmation
|
|
368
|
+
wallet_provider.wait_for_transaction_receipt(tx_hash)
|
|
369
|
+
artifact.txHash = tx_hash
|
|
370
|
+
else:
|
|
371
|
+
# For now, return without executing the transaction if no tx data
|
|
372
|
+
artifact.txHash = "0x0000000000000000000000000000000000000000000000000000000000000000"
|
|
369
373
|
|
|
370
374
|
# Return the parsed response
|
|
371
375
|
return (content, artifact)
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Firecrawl Skills
|
|
2
|
+
|
|
3
|
+
The Firecrawl skills provide advanced web scraping and content indexing capabilities using the Firecrawl API. These skills can handle JavaScript-heavy websites, PDFs, and provide automatic content indexing for intelligent querying.
|
|
4
|
+
|
|
5
|
+
## Skills Overview
|
|
6
|
+
|
|
7
|
+
### 1. firecrawl_scrape
|
|
8
|
+
Scrapes a single webpage and optionally indexes the content for future querying.
|
|
9
|
+
|
|
10
|
+
**Parameters:**
|
|
11
|
+
- `url` (required): The URL to scrape
|
|
12
|
+
- `formats` (optional): Output formats - markdown, html, rawHtml, screenshot, links, extract (default: ["markdown"])
|
|
13
|
+
- `include_tags` (optional): HTML tags to include (e.g., ["h1", "h2", "p"])
|
|
14
|
+
- `exclude_tags` (optional): HTML tags to exclude
|
|
15
|
+
- `only_main_content` (optional): Extract only main content (default: true)
|
|
16
|
+
- `index_content` (optional): Whether to index content for querying (default: true)
|
|
17
|
+
- `chunk_size` (optional): Size of text chunks for indexing (default: 1000)
|
|
18
|
+
- `chunk_overlap` (optional): Overlap between chunks (default: 200)
|
|
19
|
+
|
|
20
|
+
### 2. firecrawl_crawl
|
|
21
|
+
Crawls multiple pages from a website and indexes all content.
|
|
22
|
+
|
|
23
|
+
**Parameters:**
|
|
24
|
+
- `url` (required): The base URL to start crawling
|
|
25
|
+
- `include_paths` (optional): URL patterns to include (e.g., ["/docs/*"])
|
|
26
|
+
- `exclude_paths` (optional): URL patterns to exclude
|
|
27
|
+
- `max_depth` (optional): Maximum crawl depth (default: 2)
|
|
28
|
+
- `limit` (optional): Maximum number of pages to crawl (default: 5)
|
|
29
|
+
- `index_content` (optional): Whether to index content for querying (default: true)
|
|
30
|
+
- `chunk_size` (optional): Size of text chunks for indexing (default: 1000)
|
|
31
|
+
- `chunk_overlap` (optional): Overlap between chunks (default: 200)
|
|
32
|
+
|
|
33
|
+
### 3. firecrawl_query_indexed_content
|
|
34
|
+
Queries previously indexed Firecrawl content using semantic search.
|
|
35
|
+
|
|
36
|
+
**Parameters:**
|
|
37
|
+
- `query` (required): The search query
|
|
38
|
+
- `limit` (optional): Maximum number of results to return (1-10, default: 4)
|
|
39
|
+
|
|
40
|
+
### 4. firecrawl_clear_indexed_content
|
|
41
|
+
Clears all previously indexed Firecrawl content from the vector store.
|
|
42
|
+
|
|
43
|
+
**Parameters:**
|
|
44
|
+
- `confirm` (required): Must be set to true to confirm the deletion (default: false)
|
|
45
|
+
|
|
46
|
+
**Note:** This action is permanent and cannot be undone. Use when you want to start fresh with new content.
|
|
47
|
+
|
|
48
|
+
## API Key Configuration
|
|
49
|
+
Set your Firecrawl API key as an environment variable:
|
|
50
|
+
```bash
|
|
51
|
+
export FIRECRAWL_API_KEY=fc-your-api-key-here
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Testing Instructions
|
|
55
|
+
|
|
56
|
+
### Step 1: Create an Agent with Firecrawl Skills
|
|
57
|
+
|
|
58
|
+
1. **Create a new agent** via the API or UI with the following skills:
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"skills": [
|
|
62
|
+
"firecrawl_scrape",
|
|
63
|
+
"firecrawl_crawl",
|
|
64
|
+
"firecrawl_query_indexed_content",
|
|
65
|
+
"firecrawl_clear_indexed_content"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
2. **Note the agent ID** for testing
|
|
71
|
+
|
|
72
|
+
### Step 2: Test Single Page Scraping
|
|
73
|
+
|
|
74
|
+
**Test scraping a documentation homepage:**
|
|
75
|
+
```
|
|
76
|
+
Prompt: "Use firecrawl_scrape to scrape https://docs.joincommonwealth.xyz/ and index the content for future querying"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Expected Result:**
|
|
80
|
+
- Content successfully scraped
|
|
81
|
+
- Content automatically indexed with metadata
|
|
82
|
+
- Confirmation of chunk creation and indexing
|
|
83
|
+
|
|
84
|
+
### Step 3: Test Content Crawling
|
|
85
|
+
|
|
86
|
+
**Test crawling multiple pages:**
|
|
87
|
+
```
|
|
88
|
+
Prompt: "Use firecrawl_crawl to crawl https://docs.joincommonwealth.xyz/ with max_depth=2 and limit=3 to index multiple documentation pages"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Expected Result:**
|
|
92
|
+
- Multiple pages crawled and scraped
|
|
93
|
+
- Each page indexed separately
|
|
94
|
+
- Batch processing confirmation
|
|
95
|
+
|
|
96
|
+
### Step 4: Test Content Querying
|
|
97
|
+
|
|
98
|
+
**Test querying indexed content:**
|
|
99
|
+
```
|
|
100
|
+
Prompt: "Use firecrawl_query_indexed_content to search for 'What is All Street and what is its purpose?' in the indexed content"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Expected Result:**
|
|
104
|
+
- Relevant content retrieved from indexed documents
|
|
105
|
+
- Results tagged with [Firecrawl Scrape] or [Firecrawl Crawl]
|
|
106
|
+
- Source URLs and metadata included
|
|
107
|
+
|
|
108
|
+
### Step 5: Test Advanced Scraping Options
|
|
109
|
+
|
|
110
|
+
**Test with specific formatting:**
|
|
111
|
+
```
|
|
112
|
+
Prompt: "Use firecrawl_scrape to scrape https://docs.joincommonwealth.xyz/all-street-manifesto with formats=['markdown', 'html'] and include_tags=['h1', 'h2', 'p'] and index_content=true"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Expected Result:**
|
|
116
|
+
- Content in both markdown and HTML formats
|
|
117
|
+
- Only specified HTML tags included
|
|
118
|
+
- Content indexed for querying
|
|
119
|
+
|
|
120
|
+
### Step 6: Test Multiple Queries
|
|
121
|
+
|
|
122
|
+
**Test different query types:**
|
|
123
|
+
```
|
|
124
|
+
Prompt: "Use firecrawl_query_indexed_content to search for 'democratize finance' in the indexed content"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Expected Result:**
|
|
128
|
+
- Relevant content retrieved from Firecrawl's independent vector store
|
|
129
|
+
- Results tagged with [Firecrawl Scrape] or [Firecrawl Crawl]
|
|
130
|
+
- Source URLs and metadata included
|
|
131
|
+
|
|
132
|
+
### Step 7: Test Clear Indexed Content
|
|
133
|
+
|
|
134
|
+
**Test clearing all indexed content:**
|
|
135
|
+
```
|
|
136
|
+
Prompt: "Use firecrawl_clear_indexed_content with confirm=true to clear all indexed content"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Expected Result:**
|
|
140
|
+
- All indexed content removed from vector store
|
|
141
|
+
- Confirmation message displayed
|
|
142
|
+
- Subsequent queries return no results
|
|
143
|
+
|
|
144
|
+
### Step 8: Test Re-indexing After Clear
|
|
145
|
+
|
|
146
|
+
**Test that content can be re-indexed after clearing:**
|
|
147
|
+
```
|
|
148
|
+
Prompt: "Use firecrawl_scrape to scrape https://example.com and index the content"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Expected Result:**
|
|
152
|
+
- Content successfully scraped and indexed
|
|
153
|
+
- Fresh vector store created
|
|
154
|
+
- Content available for querying again
|
|
155
|
+
|
|
156
|
+
## Common Use Cases
|
|
157
|
+
|
|
158
|
+
### Documentation Indexing
|
|
159
|
+
```
|
|
160
|
+
1. Scrape main documentation page
|
|
161
|
+
2. Crawl related documentation sections
|
|
162
|
+
3. Query for specific technical information
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Competitive Analysis
|
|
166
|
+
```
|
|
167
|
+
1. Scrape competitor websites
|
|
168
|
+
2. Index product information and features
|
|
169
|
+
3. Query for specific comparisons
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Research and Knowledge Base
|
|
173
|
+
```
|
|
174
|
+
1. Crawl research papers or articles
|
|
175
|
+
2. Index academic or technical content
|
|
176
|
+
3. Query for specific concepts or methodologies
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Troubleshooting
|
|
180
|
+
|
|
181
|
+
### Common Issues
|
|
182
|
+
|
|
183
|
+
1. **API Key Not Found**
|
|
184
|
+
- Ensure `FIRECRAWL_API_KEY` environment variable is set
|
|
185
|
+
- Restart the IntentKit server after setting the key
|
|
186
|
+
|
|
187
|
+
2. **Scraping Failures**
|
|
188
|
+
- Check if the URL is accessible
|
|
189
|
+
- Verify Firecrawl API quota and limits
|
|
190
|
+
- Some websites may block scraping
|
|
191
|
+
|
|
192
|
+
3. **Indexing Errors**
|
|
193
|
+
- Ensure OpenAI API key is configured for embeddings
|
|
194
|
+
- Check if content is too large for processing
|
|
195
|
+
- Verify vector store permissions
|
|
196
|
+
|
|
197
|
+
4. **Query Returns No Results**
|
|
198
|
+
- Ensure content was successfully indexed
|
|
199
|
+
- Try broader or different search terms
|
|
200
|
+
- Check if vector store contains data
|
|
201
|
+
|
|
202
|
+
## Features and Benefits
|
|
203
|
+
|
|
204
|
+
- **JavaScript Rendering**: Handles SPAs and dynamic content
|
|
205
|
+
- **PDF Support**: Can scrape and index PDF documents
|
|
206
|
+
- **Intelligent Chunking**: Optimized text splitting for better search
|
|
207
|
+
- **Independent Storage**: Uses its own dedicated vector store for Firecrawl content
|
|
208
|
+
- **Metadata Rich**: Includes source URLs, timestamps, and content types
|
|
209
|
+
- **Semantic Search**: Uses OpenAI embeddings for intelligent querying
|
|
210
|
+
- **Batch Processing**: Efficient handling of multiple pages
|
|
211
|
+
- **Content Filtering**: Flexible include/exclude options for targeted scraping
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"""Firecrawl skills for web scraping and crawling."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from typing import TypedDict
|
|
5
|
+
|
|
6
|
+
from intentkit.abstracts.skill import SkillStoreABC
|
|
7
|
+
from intentkit.skills.base import SkillConfig, SkillState
|
|
8
|
+
from intentkit.skills.firecrawl.base import FirecrawlBaseTool
|
|
9
|
+
from intentkit.skills.firecrawl.clear import FirecrawlClearIndexedContent
|
|
10
|
+
from intentkit.skills.firecrawl.crawl import FirecrawlCrawl
|
|
11
|
+
from intentkit.skills.firecrawl.query import FirecrawlQueryIndexedContent
|
|
12
|
+
from intentkit.skills.firecrawl.scrape import FirecrawlScrape
|
|
13
|
+
|
|
14
|
+
# Cache skills at the system level, because they are stateless
|
|
15
|
+
_cache: dict[str, FirecrawlBaseTool] = {}
|
|
16
|
+
|
|
17
|
+
logger = logging.getLogger(__name__)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class SkillStates(TypedDict):
|
|
21
|
+
firecrawl_scrape: SkillState
|
|
22
|
+
firecrawl_crawl: SkillState
|
|
23
|
+
firecrawl_query_indexed_content: SkillState
|
|
24
|
+
firecrawl_clear_indexed_content: SkillState
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Config(SkillConfig):
|
|
28
|
+
"""Configuration for Firecrawl skills."""
|
|
29
|
+
|
|
30
|
+
states: SkillStates
|
|
31
|
+
api_key: str = ""
|
|
32
|
+
api_key_provider: str = "agent_owner"
|
|
33
|
+
rate_limit_number: int = 100
|
|
34
|
+
rate_limit_minutes: int = 60
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
async def get_skills(
|
|
38
|
+
config: "Config",
|
|
39
|
+
is_private: bool,
|
|
40
|
+
store: SkillStoreABC,
|
|
41
|
+
**_,
|
|
42
|
+
) -> list[FirecrawlBaseTool]:
|
|
43
|
+
"""Get all Firecrawl skills.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
config: The configuration for Firecrawl skills.
|
|
47
|
+
is_private: Whether to include private skills.
|
|
48
|
+
store: The skill store for persisting data.
|
|
49
|
+
|
|
50
|
+
Returns:
|
|
51
|
+
A list of Firecrawl skills.
|
|
52
|
+
"""
|
|
53
|
+
available_skills = []
|
|
54
|
+
|
|
55
|
+
# Include skills based on their state
|
|
56
|
+
for skill_name, state in config["states"].items():
|
|
57
|
+
if state == "disabled":
|
|
58
|
+
continue
|
|
59
|
+
elif state == "public" or (state == "private" and is_private):
|
|
60
|
+
available_skills.append(skill_name)
|
|
61
|
+
|
|
62
|
+
# Get each skill using the cached getter
|
|
63
|
+
return [get_firecrawl_skill(name, store) for name in available_skills]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def get_firecrawl_skill(
|
|
67
|
+
name: str,
|
|
68
|
+
store: SkillStoreABC,
|
|
69
|
+
) -> FirecrawlBaseTool:
|
|
70
|
+
"""Get a Firecrawl skill by name.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
name: The name of the skill to get
|
|
74
|
+
store: The skill store for persisting data
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
The requested Firecrawl skill
|
|
78
|
+
|
|
79
|
+
Raises:
|
|
80
|
+
ValueError: If the skill name is unknown
|
|
81
|
+
"""
|
|
82
|
+
if name == "firecrawl_scrape":
|
|
83
|
+
if name not in _cache:
|
|
84
|
+
_cache[name] = FirecrawlScrape(
|
|
85
|
+
skill_store=store,
|
|
86
|
+
)
|
|
87
|
+
return _cache[name]
|
|
88
|
+
elif name == "firecrawl_crawl":
|
|
89
|
+
if name not in _cache:
|
|
90
|
+
_cache[name] = FirecrawlCrawl(
|
|
91
|
+
skill_store=store,
|
|
92
|
+
)
|
|
93
|
+
return _cache[name]
|
|
94
|
+
elif name == "firecrawl_query_indexed_content":
|
|
95
|
+
if name not in _cache:
|
|
96
|
+
_cache[name] = FirecrawlQueryIndexedContent(
|
|
97
|
+
skill_store=store,
|
|
98
|
+
)
|
|
99
|
+
return _cache[name]
|
|
100
|
+
elif name == "firecrawl_clear_indexed_content":
|
|
101
|
+
if name not in _cache:
|
|
102
|
+
_cache[name] = FirecrawlClearIndexedContent(
|
|
103
|
+
skill_store=store,
|
|
104
|
+
)
|
|
105
|
+
return _cache[name]
|
|
106
|
+
else:
|
|
107
|
+
raise ValueError(f"Unknown Firecrawl skill: {name}")
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from typing import Type
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
from intentkit.abstracts.skill import SkillStoreABC
|
|
6
|
+
from intentkit.skills.base import IntentKitSkill, SkillContext
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class FirecrawlBaseTool(IntentKitSkill):
|
|
10
|
+
"""Base class for Firecrawl tools."""
|
|
11
|
+
|
|
12
|
+
name: str = Field(description="The name of the tool")
|
|
13
|
+
description: str = Field(description="A description of what the tool does")
|
|
14
|
+
args_schema: Type[BaseModel]
|
|
15
|
+
skill_store: SkillStoreABC = Field(
|
|
16
|
+
description="The skill store for persisting data"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
def get_api_key(self, context: SkillContext) -> str:
|
|
20
|
+
"""Get the Firecrawl API key from configuration."""
|
|
21
|
+
skill_config = context.config
|
|
22
|
+
if skill_config.get("api_key_provider") == "agent_owner":
|
|
23
|
+
return skill_config.get("api_key")
|
|
24
|
+
return self.skill_store.get_system_config("firecrawl_api_key")
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def category(self) -> str:
|
|
28
|
+
return "firecrawl"
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Type
|
|
3
|
+
|
|
4
|
+
from langchain_core.runnables import RunnableConfig
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
6
|
+
|
|
7
|
+
from intentkit.skills.firecrawl.base import FirecrawlBaseTool
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FirecrawlClearInput(BaseModel):
|
|
13
|
+
"""Input for Firecrawl clear tool."""
|
|
14
|
+
|
|
15
|
+
confirm: bool = Field(
|
|
16
|
+
description="Confirmation to clear all indexed content (must be true)",
|
|
17
|
+
default=False,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class FirecrawlClearIndexedContent(FirecrawlBaseTool):
|
|
22
|
+
"""Tool for clearing all indexed Firecrawl content.
|
|
23
|
+
|
|
24
|
+
This tool removes all previously indexed content from the Firecrawl vector store,
|
|
25
|
+
allowing for a fresh start with new content.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
name: str = "firecrawl_clear_indexed_content"
|
|
29
|
+
description: str = (
|
|
30
|
+
"Clear all previously indexed Firecrawl content from the vector store.\n"
|
|
31
|
+
"This will permanently delete all indexed content and cannot be undone.\n"
|
|
32
|
+
"Use this tool when you want to start fresh with new content."
|
|
33
|
+
)
|
|
34
|
+
args_schema: Type[BaseModel] = FirecrawlClearInput
|
|
35
|
+
|
|
36
|
+
async def _arun(
|
|
37
|
+
self,
|
|
38
|
+
confirm: bool = False,
|
|
39
|
+
config: RunnableConfig = None,
|
|
40
|
+
**kwargs,
|
|
41
|
+
) -> str:
|
|
42
|
+
"""Clear all indexed Firecrawl content for the agent.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
confirm: Must be True to confirm the deletion
|
|
46
|
+
config: The configuration for the tool call
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
str: Confirmation message
|
|
50
|
+
"""
|
|
51
|
+
context = self.context_from_config(config)
|
|
52
|
+
agent_id = context.agent_id
|
|
53
|
+
|
|
54
|
+
if not agent_id:
|
|
55
|
+
return "Error: Agent ID not available for clearing content."
|
|
56
|
+
|
|
57
|
+
if not confirm:
|
|
58
|
+
return "Error: You must set confirm=true to clear all indexed content."
|
|
59
|
+
|
|
60
|
+
logger.info(
|
|
61
|
+
f"firecrawl_clear: Starting clear indexed content operation for agent {agent_id}"
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
try:
|
|
65
|
+
# Delete vector store data (using web_scraper storage format for compatibility)
|
|
66
|
+
vector_store_key = f"vector_store_{agent_id}"
|
|
67
|
+
await self.skill_store.delete_agent_skill_data(
|
|
68
|
+
agent_id, "web_scraper", vector_store_key
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Delete metadata
|
|
72
|
+
metadata_key = f"indexed_urls_{agent_id}"
|
|
73
|
+
await self.skill_store.delete_agent_skill_data(
|
|
74
|
+
agent_id, "web_scraper", metadata_key
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
logger.info(
|
|
78
|
+
f"firecrawl_clear: Successfully cleared all indexed content for agent {agent_id}"
|
|
79
|
+
)
|
|
80
|
+
return "Successfully cleared all Firecrawl indexed content. The vector store is now empty and ready for new content."
|
|
81
|
+
|
|
82
|
+
except Exception as e:
|
|
83
|
+
logger.error(
|
|
84
|
+
f"firecrawl_clear: Error clearing indexed content for agent {agent_id}: {e}",
|
|
85
|
+
exc_info=True,
|
|
86
|
+
)
|
|
87
|
+
return f"Error clearing indexed content: {str(e)}"
|