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
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"""Supabase skills."""
|
|
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.supabase.base import SupabaseBaseTool
|
|
9
|
+
from intentkit.skills.supabase.delete_data import SupabaseDeleteData
|
|
10
|
+
from intentkit.skills.supabase.fetch_data import SupabaseFetchData
|
|
11
|
+
from intentkit.skills.supabase.insert_data import SupabaseInsertData
|
|
12
|
+
from intentkit.skills.supabase.invoke_function import SupabaseInvokeFunction
|
|
13
|
+
from intentkit.skills.supabase.update_data import SupabaseUpdateData
|
|
14
|
+
from intentkit.skills.supabase.upsert_data import SupabaseUpsertData
|
|
15
|
+
|
|
16
|
+
# Cache skills at the system level, because they are stateless
|
|
17
|
+
_cache: dict[str, SupabaseBaseTool] = {}
|
|
18
|
+
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class SkillStates(TypedDict):
|
|
23
|
+
fetch_data: SkillState
|
|
24
|
+
insert_data: SkillState
|
|
25
|
+
update_data: SkillState
|
|
26
|
+
upsert_data: SkillState
|
|
27
|
+
delete_data: SkillState
|
|
28
|
+
invoke_function: SkillState
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class Config(SkillConfig):
|
|
32
|
+
"""Configuration for Supabase skills."""
|
|
33
|
+
|
|
34
|
+
states: SkillStates
|
|
35
|
+
supabase_url: str
|
|
36
|
+
supabase_key: str
|
|
37
|
+
public_write_tables: str = ""
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
async def get_skills(
|
|
41
|
+
config: "Config",
|
|
42
|
+
is_private: bool,
|
|
43
|
+
store: SkillStoreABC,
|
|
44
|
+
**_,
|
|
45
|
+
) -> list[SupabaseBaseTool]:
|
|
46
|
+
"""Get all Supabase skills."""
|
|
47
|
+
available_skills = []
|
|
48
|
+
|
|
49
|
+
# Include skills based on their state
|
|
50
|
+
for skill_name, state in config["states"].items():
|
|
51
|
+
if state == "disabled":
|
|
52
|
+
continue
|
|
53
|
+
elif state == "public" or (state == "private" and is_private):
|
|
54
|
+
available_skills.append(skill_name)
|
|
55
|
+
|
|
56
|
+
# Get each skill using the cached getter
|
|
57
|
+
result = []
|
|
58
|
+
for name in available_skills:
|
|
59
|
+
skill = get_supabase_skill(name, store)
|
|
60
|
+
if skill:
|
|
61
|
+
result.append(skill)
|
|
62
|
+
return result
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def get_supabase_skill(
|
|
66
|
+
name: str,
|
|
67
|
+
store: SkillStoreABC,
|
|
68
|
+
) -> SupabaseBaseTool:
|
|
69
|
+
"""Get a Supabase skill by name.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
name: The name of the skill to get
|
|
73
|
+
store: The skill store for persisting data
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
The requested Supabase skill
|
|
77
|
+
"""
|
|
78
|
+
if name == "fetch_data":
|
|
79
|
+
if name not in _cache:
|
|
80
|
+
_cache[name] = SupabaseFetchData(
|
|
81
|
+
skill_store=store,
|
|
82
|
+
)
|
|
83
|
+
return _cache[name]
|
|
84
|
+
elif name == "insert_data":
|
|
85
|
+
if name not in _cache:
|
|
86
|
+
_cache[name] = SupabaseInsertData(
|
|
87
|
+
skill_store=store,
|
|
88
|
+
)
|
|
89
|
+
return _cache[name]
|
|
90
|
+
elif name == "update_data":
|
|
91
|
+
if name not in _cache:
|
|
92
|
+
_cache[name] = SupabaseUpdateData(
|
|
93
|
+
skill_store=store,
|
|
94
|
+
)
|
|
95
|
+
return _cache[name]
|
|
96
|
+
elif name == "upsert_data":
|
|
97
|
+
if name not in _cache:
|
|
98
|
+
_cache[name] = SupabaseUpsertData(
|
|
99
|
+
skill_store=store,
|
|
100
|
+
)
|
|
101
|
+
return _cache[name]
|
|
102
|
+
elif name == "delete_data":
|
|
103
|
+
if name not in _cache:
|
|
104
|
+
_cache[name] = SupabaseDeleteData(
|
|
105
|
+
skill_store=store,
|
|
106
|
+
)
|
|
107
|
+
return _cache[name]
|
|
108
|
+
elif name == "invoke_function":
|
|
109
|
+
if name not in _cache:
|
|
110
|
+
_cache[name] = SupabaseInvokeFunction(
|
|
111
|
+
skill_store=store,
|
|
112
|
+
)
|
|
113
|
+
return _cache[name]
|
|
114
|
+
else:
|
|
115
|
+
logger.warning(f"Unknown Supabase skill: {name}")
|
|
116
|
+
return None
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from typing import Type
|
|
2
|
+
|
|
3
|
+
from langchain_core.tools import ToolException
|
|
4
|
+
from pydantic import BaseModel, Field
|
|
5
|
+
|
|
6
|
+
from intentkit.abstracts.skill import SkillStoreABC
|
|
7
|
+
from intentkit.skills.base import IntentKitSkill, SkillContext
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SupabaseBaseTool(IntentKitSkill):
|
|
11
|
+
"""Base class for Supabase tools."""
|
|
12
|
+
|
|
13
|
+
name: str = Field(description="The name of the tool")
|
|
14
|
+
description: str = Field(description="A description of what the tool does")
|
|
15
|
+
args_schema: Type[BaseModel]
|
|
16
|
+
skill_store: SkillStoreABC = Field(
|
|
17
|
+
description="The skill store for persisting data"
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def category(self) -> str:
|
|
22
|
+
return "supabase"
|
|
23
|
+
|
|
24
|
+
def get_supabase_config(self, config: dict) -> tuple[str, str]:
|
|
25
|
+
"""Get Supabase URL and key from config.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
config: The agent configuration
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
Tuple of (supabase_url, supabase_key)
|
|
32
|
+
|
|
33
|
+
Raises:
|
|
34
|
+
ValueError: If required config is missing
|
|
35
|
+
"""
|
|
36
|
+
supabase_url = config.get("supabase_url")
|
|
37
|
+
supabase_key = config.get("supabase_key")
|
|
38
|
+
|
|
39
|
+
if not supabase_url:
|
|
40
|
+
raise ValueError("supabase_url is required in config")
|
|
41
|
+
if not supabase_key:
|
|
42
|
+
raise ValueError("supabase_key is required in config")
|
|
43
|
+
|
|
44
|
+
return supabase_url, supabase_key
|
|
45
|
+
|
|
46
|
+
def validate_table_access(self, table: str, context: SkillContext) -> None:
|
|
47
|
+
"""Validate if the table can be accessed for write operations in public mode.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
table: The table name to validate
|
|
51
|
+
context: The skill context containing configuration and mode info
|
|
52
|
+
|
|
53
|
+
Raises:
|
|
54
|
+
ToolException: If table access is not allowed in public mode
|
|
55
|
+
"""
|
|
56
|
+
# If in private mode (owner mode), no restrictions apply
|
|
57
|
+
if context.is_private:
|
|
58
|
+
return
|
|
59
|
+
|
|
60
|
+
# In public mode, check if table is in allowed list
|
|
61
|
+
public_write_tables = context.config.get("public_write_tables", "")
|
|
62
|
+
if not public_write_tables:
|
|
63
|
+
return
|
|
64
|
+
|
|
65
|
+
allowed_tables = [
|
|
66
|
+
t.strip() for t in public_write_tables.split(",") if t.strip()
|
|
67
|
+
]
|
|
68
|
+
if table not in allowed_tables:
|
|
69
|
+
raise ToolException(
|
|
70
|
+
f"Table '{table}' is not allowed for public write operations. "
|
|
71
|
+
f"Allowed tables: {', '.join(allowed_tables)}"
|
|
72
|
+
)
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Any, Dict, Type
|
|
3
|
+
|
|
4
|
+
from langchain_core.runnables import RunnableConfig
|
|
5
|
+
from langchain_core.tools import ToolException
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
from supabase import Client, create_client
|
|
8
|
+
|
|
9
|
+
from intentkit.skills.supabase.base import SupabaseBaseTool
|
|
10
|
+
|
|
11
|
+
NAME = "supabase_delete_data"
|
|
12
|
+
PROMPT = "Delete data from a Supabase table based on filtering conditions."
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SupabaseDeleteDataInput(BaseModel):
|
|
18
|
+
"""Input for SupabaseDeleteData tool."""
|
|
19
|
+
|
|
20
|
+
table: str = Field(description="The name of the table to delete data from")
|
|
21
|
+
filters: Dict[str, Any] = Field(
|
|
22
|
+
description="Dictionary of filters to identify which records to delete (e.g., {'id': 123})"
|
|
23
|
+
)
|
|
24
|
+
returning: str = Field(
|
|
25
|
+
default="*",
|
|
26
|
+
description="Columns to return from deleted records (default: '*' for all)",
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class SupabaseDeleteData(SupabaseBaseTool):
|
|
31
|
+
"""Tool for deleting data from Supabase tables.
|
|
32
|
+
|
|
33
|
+
This tool allows deleting records from Supabase tables based on filter conditions.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
name: str = NAME
|
|
37
|
+
description: str = PROMPT
|
|
38
|
+
args_schema: Type[BaseModel] = SupabaseDeleteDataInput
|
|
39
|
+
|
|
40
|
+
async def _arun(
|
|
41
|
+
self,
|
|
42
|
+
table: str,
|
|
43
|
+
filters: Dict[str, Any],
|
|
44
|
+
returning: str = "*",
|
|
45
|
+
config: RunnableConfig = None,
|
|
46
|
+
**kwargs,
|
|
47
|
+
):
|
|
48
|
+
try:
|
|
49
|
+
context = self.context_from_config(config)
|
|
50
|
+
|
|
51
|
+
# Validate table access for public mode
|
|
52
|
+
self.validate_table_access(table, context)
|
|
53
|
+
|
|
54
|
+
supabase_url, supabase_key = self.get_supabase_config(context.config)
|
|
55
|
+
|
|
56
|
+
# Create Supabase client
|
|
57
|
+
supabase: Client = create_client(supabase_url, supabase_key)
|
|
58
|
+
|
|
59
|
+
# Start building the delete query
|
|
60
|
+
query = supabase.table(table).delete()
|
|
61
|
+
|
|
62
|
+
# Apply filters to identify which records to delete
|
|
63
|
+
for column, value in filters.items():
|
|
64
|
+
if isinstance(value, dict):
|
|
65
|
+
# Handle complex filters like {'gte': 18}
|
|
66
|
+
for operator, filter_value in value.items():
|
|
67
|
+
if operator == "eq":
|
|
68
|
+
query = query.eq(column, filter_value)
|
|
69
|
+
elif operator == "neq":
|
|
70
|
+
query = query.neq(column, filter_value)
|
|
71
|
+
elif operator == "gt":
|
|
72
|
+
query = query.gt(column, filter_value)
|
|
73
|
+
elif operator == "gte":
|
|
74
|
+
query = query.gte(column, filter_value)
|
|
75
|
+
elif operator == "lt":
|
|
76
|
+
query = query.lt(column, filter_value)
|
|
77
|
+
elif operator == "lte":
|
|
78
|
+
query = query.lte(column, filter_value)
|
|
79
|
+
elif operator == "like":
|
|
80
|
+
query = query.like(column, filter_value)
|
|
81
|
+
elif operator == "ilike":
|
|
82
|
+
query = query.ilike(column, filter_value)
|
|
83
|
+
elif operator == "in":
|
|
84
|
+
query = query.in_(column, filter_value)
|
|
85
|
+
else:
|
|
86
|
+
logger.warning(f"Unknown filter operator: {operator}")
|
|
87
|
+
else:
|
|
88
|
+
# Simple equality filter
|
|
89
|
+
query = query.eq(column, value)
|
|
90
|
+
|
|
91
|
+
# Execute the delete
|
|
92
|
+
response = query.execute()
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
"success": True,
|
|
96
|
+
"data": response.data,
|
|
97
|
+
"count": len(response.data) if response.data else 0,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
except Exception as e:
|
|
101
|
+
logger.error(f"Error deleting data from Supabase: {str(e)}")
|
|
102
|
+
raise ToolException(f"Failed to delete data from table '{table}': {str(e)}")
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Any, Dict, Optional, Type
|
|
3
|
+
|
|
4
|
+
from langchain_core.runnables import RunnableConfig
|
|
5
|
+
from langchain_core.tools import ToolException
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
from supabase import Client, create_client
|
|
8
|
+
|
|
9
|
+
from intentkit.skills.supabase.base import SupabaseBaseTool
|
|
10
|
+
|
|
11
|
+
NAME = "supabase_fetch_data"
|
|
12
|
+
PROMPT = "Fetch data from a Supabase table with optional filtering, ordering, and pagination."
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SupabaseFetchDataInput(BaseModel):
|
|
18
|
+
"""Input for SupabaseFetchData tool."""
|
|
19
|
+
|
|
20
|
+
table: str = Field(description="The name of the table to fetch data from")
|
|
21
|
+
columns: Optional[str] = Field(
|
|
22
|
+
default="*",
|
|
23
|
+
description="Comma-separated list of columns to select (default: '*' for all)",
|
|
24
|
+
)
|
|
25
|
+
filters: Optional[Dict[str, Any]] = Field(
|
|
26
|
+
default=None,
|
|
27
|
+
description="Dictionary of filters to apply (e.g., {'column': 'value', 'age': {'gte': 18}})",
|
|
28
|
+
)
|
|
29
|
+
order_by: Optional[str] = Field(default=None, description="Column to order by")
|
|
30
|
+
ascending: bool = Field(
|
|
31
|
+
default=True, description="Whether to order in ascending order (default: True)"
|
|
32
|
+
)
|
|
33
|
+
limit: Optional[int] = Field(
|
|
34
|
+
default=None, description="Maximum number of records to return"
|
|
35
|
+
)
|
|
36
|
+
offset: Optional[int] = Field(
|
|
37
|
+
default=None, description="Number of records to skip for pagination"
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class SupabaseFetchData(SupabaseBaseTool):
|
|
42
|
+
"""Tool for fetching data from Supabase tables.
|
|
43
|
+
|
|
44
|
+
This tool allows querying Supabase tables with filtering, ordering, and pagination.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
name: str = NAME
|
|
48
|
+
description: str = PROMPT
|
|
49
|
+
args_schema: Type[BaseModel] = SupabaseFetchDataInput
|
|
50
|
+
|
|
51
|
+
async def _arun(
|
|
52
|
+
self,
|
|
53
|
+
table: str,
|
|
54
|
+
columns: Optional[str] = "*",
|
|
55
|
+
filters: Optional[Dict[str, Any]] = None,
|
|
56
|
+
order_by: Optional[str] = None,
|
|
57
|
+
ascending: bool = True,
|
|
58
|
+
limit: Optional[int] = None,
|
|
59
|
+
offset: Optional[int] = None,
|
|
60
|
+
config: RunnableConfig = None,
|
|
61
|
+
**kwargs,
|
|
62
|
+
):
|
|
63
|
+
try:
|
|
64
|
+
context = self.context_from_config(config)
|
|
65
|
+
supabase_url, supabase_key = self.get_supabase_config(context.config)
|
|
66
|
+
|
|
67
|
+
# Create Supabase client
|
|
68
|
+
supabase: Client = create_client(supabase_url, supabase_key)
|
|
69
|
+
|
|
70
|
+
# Start building the query
|
|
71
|
+
query = supabase.table(table).select(columns)
|
|
72
|
+
|
|
73
|
+
# Apply filters if provided
|
|
74
|
+
if filters:
|
|
75
|
+
for column, value in filters.items():
|
|
76
|
+
if isinstance(value, dict):
|
|
77
|
+
# Handle complex filters like {'gte': 18}
|
|
78
|
+
for operator, filter_value in value.items():
|
|
79
|
+
if operator == "eq":
|
|
80
|
+
query = query.eq(column, filter_value)
|
|
81
|
+
elif operator == "neq":
|
|
82
|
+
query = query.neq(column, filter_value)
|
|
83
|
+
elif operator == "gt":
|
|
84
|
+
query = query.gt(column, filter_value)
|
|
85
|
+
elif operator == "gte":
|
|
86
|
+
query = query.gte(column, filter_value)
|
|
87
|
+
elif operator == "lt":
|
|
88
|
+
query = query.lt(column, filter_value)
|
|
89
|
+
elif operator == "lte":
|
|
90
|
+
query = query.lte(column, filter_value)
|
|
91
|
+
elif operator == "like":
|
|
92
|
+
query = query.like(column, filter_value)
|
|
93
|
+
elif operator == "ilike":
|
|
94
|
+
query = query.ilike(column, filter_value)
|
|
95
|
+
elif operator == "in":
|
|
96
|
+
query = query.in_(column, filter_value)
|
|
97
|
+
else:
|
|
98
|
+
logger.warning(f"Unknown filter operator: {operator}")
|
|
99
|
+
else:
|
|
100
|
+
# Simple equality filter
|
|
101
|
+
query = query.eq(column, value)
|
|
102
|
+
|
|
103
|
+
# Apply ordering if provided
|
|
104
|
+
if order_by:
|
|
105
|
+
query = query.order(order_by, desc=not ascending)
|
|
106
|
+
|
|
107
|
+
# Apply pagination
|
|
108
|
+
if limit:
|
|
109
|
+
query = query.limit(limit)
|
|
110
|
+
if offset:
|
|
111
|
+
query = query.offset(offset)
|
|
112
|
+
|
|
113
|
+
# Execute the query
|
|
114
|
+
response = query.execute()
|
|
115
|
+
|
|
116
|
+
return {"success": True, "data": response.data, "count": len(response.data)}
|
|
117
|
+
|
|
118
|
+
except Exception as e:
|
|
119
|
+
logger.error(f"Error fetching data from Supabase: {str(e)}")
|
|
120
|
+
raise ToolException(f"Failed to fetch data from table '{table}': {str(e)}")
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Any, Dict, List, Type, Union
|
|
3
|
+
|
|
4
|
+
from langchain_core.runnables import RunnableConfig
|
|
5
|
+
from langchain_core.tools import ToolException
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
from supabase import Client, create_client
|
|
8
|
+
|
|
9
|
+
from intentkit.skills.supabase.base import SupabaseBaseTool
|
|
10
|
+
|
|
11
|
+
NAME = "supabase_insert_data"
|
|
12
|
+
PROMPT = "Insert new data into a Supabase table."
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SupabaseInsertDataInput(BaseModel):
|
|
18
|
+
"""Input for SupabaseInsertData tool."""
|
|
19
|
+
|
|
20
|
+
table: str = Field(description="The name of the table to insert data into")
|
|
21
|
+
data: Union[Dict[str, Any], List[Dict[str, Any]]] = Field(
|
|
22
|
+
description="The data to insert. Can be a single object or a list of objects"
|
|
23
|
+
)
|
|
24
|
+
returning: str = Field(
|
|
25
|
+
default="*",
|
|
26
|
+
description="Columns to return after insertion (default: '*' for all)",
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class SupabaseInsertData(SupabaseBaseTool):
|
|
31
|
+
"""Tool for inserting data into Supabase tables.
|
|
32
|
+
|
|
33
|
+
This tool allows inserting single or multiple records into Supabase tables.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
name: str = NAME
|
|
37
|
+
description: str = PROMPT
|
|
38
|
+
args_schema: Type[BaseModel] = SupabaseInsertDataInput
|
|
39
|
+
|
|
40
|
+
async def _arun(
|
|
41
|
+
self,
|
|
42
|
+
table: str,
|
|
43
|
+
data: Union[Dict[str, Any], List[Dict[str, Any]]],
|
|
44
|
+
returning: str = "*",
|
|
45
|
+
config: RunnableConfig = None,
|
|
46
|
+
**kwargs,
|
|
47
|
+
):
|
|
48
|
+
try:
|
|
49
|
+
context = self.context_from_config(config)
|
|
50
|
+
|
|
51
|
+
# Validate table access for public mode
|
|
52
|
+
self.validate_table_access(table, context)
|
|
53
|
+
|
|
54
|
+
supabase_url, supabase_key = self.get_supabase_config(context.config)
|
|
55
|
+
|
|
56
|
+
# Create Supabase client
|
|
57
|
+
supabase: Client = create_client(supabase_url, supabase_key)
|
|
58
|
+
|
|
59
|
+
# Insert data
|
|
60
|
+
response = supabase.table(table).insert(data).execute()
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
"success": True,
|
|
64
|
+
"data": response.data,
|
|
65
|
+
"count": len(response.data) if response.data else 0,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
except Exception as e:
|
|
69
|
+
logger.error(f"Error inserting data into Supabase: {str(e)}")
|
|
70
|
+
raise ToolException(f"Failed to insert data into table '{table}': {str(e)}")
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Any, Dict, Optional, Type
|
|
3
|
+
|
|
4
|
+
from langchain_core.runnables import RunnableConfig
|
|
5
|
+
from langchain_core.tools import ToolException
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
from supabase import Client, create_client
|
|
8
|
+
|
|
9
|
+
from intentkit.skills.supabase.base import SupabaseBaseTool
|
|
10
|
+
|
|
11
|
+
NAME = "supabase_invoke_function"
|
|
12
|
+
PROMPT = "Invoke a Supabase Edge Function with optional parameters."
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SupabaseInvokeFunctionInput(BaseModel):
|
|
18
|
+
"""Input for SupabaseInvokeFunction tool."""
|
|
19
|
+
|
|
20
|
+
function_name: str = Field(description="The name of the Edge Function to invoke")
|
|
21
|
+
parameters: Optional[Dict[str, Any]] = Field(
|
|
22
|
+
default=None, description="Optional parameters to pass to the function"
|
|
23
|
+
)
|
|
24
|
+
headers: Optional[Dict[str, str]] = Field(
|
|
25
|
+
default=None, description="Optional headers to include in the request"
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class SupabaseInvokeFunction(SupabaseBaseTool):
|
|
30
|
+
"""Tool for invoking Supabase Edge Functions.
|
|
31
|
+
|
|
32
|
+
This tool allows calling Supabase Edge Functions with optional parameters and headers.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
name: str = NAME
|
|
36
|
+
description: str = PROMPT
|
|
37
|
+
args_schema: Type[BaseModel] = SupabaseInvokeFunctionInput
|
|
38
|
+
|
|
39
|
+
async def _arun(
|
|
40
|
+
self,
|
|
41
|
+
function_name: str,
|
|
42
|
+
parameters: Optional[Dict[str, Any]] = None,
|
|
43
|
+
headers: Optional[Dict[str, str]] = None,
|
|
44
|
+
config: RunnableConfig = None,
|
|
45
|
+
**kwargs,
|
|
46
|
+
):
|
|
47
|
+
try:
|
|
48
|
+
context = self.context_from_config(config)
|
|
49
|
+
supabase_url, supabase_key = self.get_supabase_config(context.config)
|
|
50
|
+
|
|
51
|
+
# Create Supabase client
|
|
52
|
+
supabase: Client = create_client(supabase_url, supabase_key)
|
|
53
|
+
|
|
54
|
+
# Prepare function invocation parameters
|
|
55
|
+
invoke_options = {}
|
|
56
|
+
if parameters:
|
|
57
|
+
invoke_options["json"] = parameters
|
|
58
|
+
if headers:
|
|
59
|
+
invoke_options["headers"] = headers
|
|
60
|
+
|
|
61
|
+
# Invoke the Edge Function
|
|
62
|
+
response = supabase.functions.invoke(function_name, invoke_options)
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
"success": True,
|
|
66
|
+
"data": response.json() if hasattr(response, "json") else response,
|
|
67
|
+
"status_code": getattr(response, "status_code", None),
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
except Exception as e:
|
|
71
|
+
logger.error(f"Error invoking Supabase Edge Function: {str(e)}")
|
|
72
|
+
raise ToolException(
|
|
73
|
+
f"Failed to invoke Edge Function '{function_name}': {str(e)}"
|
|
74
|
+
)
|