intentkit 0.8.16.dev1__py3-none-any.whl → 0.8.17.dev2__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 +1 -1
- intentkit/abstracts/agent.py +4 -5
- intentkit/abstracts/engine.py +5 -5
- intentkit/abstracts/graph.py +6 -5
- intentkit/abstracts/skill.py +5 -5
- intentkit/abstracts/twitter.py +4 -5
- intentkit/clients/cdp.py +19 -77
- intentkit/clients/twitter.py +26 -34
- intentkit/clients/web3.py +1 -3
- intentkit/config/config.py +4 -0
- intentkit/core/agent.py +15 -15
- intentkit/core/asset.py +1 -2
- intentkit/core/client.py +1 -1
- intentkit/core/credit.py +19 -20
- intentkit/core/engine.py +2 -4
- intentkit/core/node.py +2 -1
- intentkit/core/prompt.py +3 -4
- intentkit/core/scheduler.py +1 -1
- intentkit/core/statistics.py +6 -7
- intentkit/models/agent.py +125 -92
- intentkit/models/agent_data.py +62 -36
- intentkit/models/app_setting.py +6 -6
- intentkit/models/chat.py +27 -24
- intentkit/models/conversation.py +8 -8
- intentkit/models/credit.py +62 -64
- intentkit/models/db.py +8 -7
- intentkit/models/db_mig.py +2 -2
- intentkit/models/llm.py +12 -14
- intentkit/models/redis.py +2 -3
- intentkit/models/skill.py +25 -27
- intentkit/models/skills.csv +29 -28
- intentkit/models/user.py +21 -22
- intentkit/skills/acolyt/ask.py +3 -4
- intentkit/skills/acolyt/base.py +1 -3
- intentkit/skills/aixbt/base.py +1 -3
- intentkit/skills/aixbt/projects.py +13 -13
- intentkit/skills/allora/base.py +1 -3
- intentkit/skills/allora/price.py +2 -3
- intentkit/skills/base.py +15 -22
- intentkit/skills/basename/__init__.py +3 -5
- intentkit/skills/carv/__init__.py +7 -8
- intentkit/skills/carv/base.py +6 -6
- intentkit/skills/carv/fetch_news.py +3 -3
- intentkit/skills/carv/onchain_query.py +4 -4
- intentkit/skills/carv/token_info_and_price.py +5 -5
- intentkit/skills/casino/base.py +1 -3
- intentkit/skills/casino/deck_draw.py +1 -2
- intentkit/skills/casino/deck_shuffle.py +1 -2
- intentkit/skills/casino/dice_roll.py +1 -2
- intentkit/skills/cdp/__init__.py +3 -5
- intentkit/skills/cdp/base.py +1 -3
- intentkit/skills/chainlist/base.py +1 -3
- intentkit/skills/chainlist/chain_lookup.py +18 -18
- intentkit/skills/common/base.py +1 -3
- intentkit/skills/common/current_time.py +1 -2
- intentkit/skills/cookiefun/base.py +1 -2
- intentkit/skills/cookiefun/get_account_details.py +7 -7
- intentkit/skills/cookiefun/get_account_feed.py +19 -19
- intentkit/skills/cookiefun/get_account_smart_followers.py +7 -7
- intentkit/skills/cookiefun/get_sectors.py +3 -3
- intentkit/skills/cookiefun/search_accounts.py +9 -9
- intentkit/skills/cryptocompare/api.py +2 -3
- intentkit/skills/cryptocompare/base.py +6 -6
- intentkit/skills/cryptocompare/fetch_news.py +3 -4
- intentkit/skills/cryptocompare/fetch_price.py +5 -6
- intentkit/skills/cryptocompare/fetch_top_exchanges.py +3 -4
- intentkit/skills/cryptocompare/fetch_top_market_cap.py +3 -4
- intentkit/skills/cryptocompare/fetch_top_volume.py +3 -4
- intentkit/skills/cryptocompare/fetch_trading_signals.py +4 -5
- intentkit/skills/cryptopanic/__init__.py +4 -4
- intentkit/skills/cryptopanic/base.py +1 -3
- intentkit/skills/cryptopanic/fetch_crypto_news.py +3 -5
- intentkit/skills/cryptopanic/fetch_crypto_sentiment.py +3 -3
- intentkit/skills/dapplooker/base.py +1 -3
- intentkit/skills/dapplooker/dapplooker_token_data.py +7 -7
- intentkit/skills/defillama/api.py +6 -9
- intentkit/skills/defillama/base.py +5 -6
- intentkit/skills/defillama/coins/fetch_batch_historical_prices.py +6 -8
- intentkit/skills/defillama/coins/fetch_block.py +4 -6
- intentkit/skills/defillama/coins/fetch_current_prices.py +6 -8
- intentkit/skills/defillama/coins/fetch_first_price.py +5 -7
- intentkit/skills/defillama/coins/fetch_historical_prices.py +7 -9
- intentkit/skills/defillama/coins/fetch_price_chart.py +7 -9
- intentkit/skills/defillama/coins/fetch_price_percentage.py +5 -7
- intentkit/skills/defillama/config/chains.py +1 -3
- intentkit/skills/defillama/fees/fetch_fees_overview.py +22 -24
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_chains.py +14 -16
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_charts.py +6 -8
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_prices.py +3 -5
- intentkit/skills/defillama/stablecoins/fetch_stablecoins.py +5 -7
- intentkit/skills/defillama/tests/api_integration.test.py +1 -1
- intentkit/skills/defillama/tvl/fetch_chain_historical_tvl.py +2 -4
- intentkit/skills/defillama/tvl/fetch_chains.py +7 -9
- intentkit/skills/defillama/tvl/fetch_historical_tvl.py +2 -4
- intentkit/skills/defillama/tvl/fetch_protocol.py +30 -36
- intentkit/skills/defillama/tvl/fetch_protocol_current_tvl.py +1 -3
- intentkit/skills/defillama/tvl/fetch_protocols.py +35 -43
- intentkit/skills/defillama/volumes/fetch_dex_overview.py +40 -46
- intentkit/skills/defillama/volumes/fetch_dex_summary.py +33 -35
- intentkit/skills/defillama/volumes/fetch_options_overview.py +22 -26
- intentkit/skills/defillama/yields/fetch_pool_chart.py +8 -10
- intentkit/skills/defillama/yields/fetch_pools.py +24 -28
- intentkit/skills/dexscreener/__init__.py +2 -2
- intentkit/skills/dexscreener/base.py +3 -3
- intentkit/skills/dexscreener/get_pair_info.py +2 -2
- intentkit/skills/dexscreener/get_token_pairs.py +2 -2
- intentkit/skills/dexscreener/get_tokens_info.py +5 -5
- intentkit/skills/dexscreener/model/search_token_response.py +80 -82
- intentkit/skills/dexscreener/search_token.py +182 -182
- intentkit/skills/dexscreener/utils.py +15 -14
- intentkit/skills/dune_analytics/__init__.py +4 -4
- intentkit/skills/dune_analytics/base.py +1 -3
- intentkit/skills/dune_analytics/fetch_kol_buys.py +4 -4
- intentkit/skills/dune_analytics/fetch_nation_metrics.py +5 -5
- intentkit/skills/elfa/base.py +1 -3
- intentkit/skills/elfa/mention.py +19 -21
- intentkit/skills/elfa/stats.py +4 -4
- intentkit/skills/elfa/tokens.py +12 -12
- intentkit/skills/elfa/utils.py +25 -27
- intentkit/skills/enso/__init__.py +2 -2
- intentkit/skills/enso/base.py +5 -8
- intentkit/skills/enso/best_yield.py +4 -6
- intentkit/skills/enso/networks.py +1 -2
- intentkit/skills/enso/prices.py +1 -3
- intentkit/skills/enso/route.py +1 -3
- intentkit/skills/enso/tokens.py +1 -3
- intentkit/skills/enso/wallet.py +5 -5
- intentkit/skills/erc20/__init__.py +4 -6
- intentkit/skills/erc721/__init__.py +4 -6
- intentkit/skills/firecrawl/base.py +1 -3
- intentkit/skills/firecrawl/clear.py +1 -2
- intentkit/skills/firecrawl/crawl.py +9 -10
- intentkit/skills/firecrawl/query.py +1 -2
- intentkit/skills/firecrawl/scrape.py +7 -8
- intentkit/skills/firecrawl/utils.py +13 -13
- intentkit/skills/github/base.py +1 -3
- intentkit/skills/github/github_search.py +1 -2
- intentkit/skills/heurist/base.py +1 -3
- intentkit/skills/heurist/image_generation_animagine_xl.py +7 -8
- intentkit/skills/heurist/image_generation_arthemy_comics.py +7 -8
- intentkit/skills/heurist/image_generation_arthemy_real.py +7 -8
- intentkit/skills/heurist/image_generation_braindance.py +7 -8
- intentkit/skills/heurist/image_generation_cyber_realistic_xl.py +7 -8
- intentkit/skills/heurist/image_generation_flux_1_dev.py +7 -8
- intentkit/skills/heurist/image_generation_sdxl.py +7 -8
- intentkit/skills/http/base.py +1 -3
- intentkit/skills/http/get.py +7 -7
- intentkit/skills/http/post.py +9 -9
- intentkit/skills/http/put.py +9 -9
- intentkit/skills/lifi/__init__.py +4 -4
- intentkit/skills/lifi/base.py +1 -3
- intentkit/skills/lifi/token_execute.py +13 -13
- intentkit/skills/lifi/token_quote.py +6 -6
- intentkit/skills/lifi/utils.py +16 -16
- intentkit/skills/moralis/__init__.py +3 -3
- intentkit/skills/moralis/api.py +6 -7
- intentkit/skills/moralis/base.py +2 -4
- intentkit/skills/moralis/fetch_chain_portfolio.py +10 -11
- intentkit/skills/moralis/fetch_nft_portfolio.py +22 -22
- intentkit/skills/moralis/fetch_solana_portfolio.py +11 -12
- intentkit/skills/moralis/fetch_wallet_portfolio.py +8 -9
- intentkit/skills/morpho/__init__.py +4 -6
- intentkit/skills/nation/__init__.py +2 -2
- intentkit/skills/nation/base.py +1 -3
- intentkit/skills/nation/nft_check.py +3 -4
- intentkit/skills/onchain.py +2 -6
- intentkit/skills/openai/base.py +1 -3
- intentkit/skills/openai/dalle_image_generation.py +1 -3
- intentkit/skills/openai/gpt_image_generation.py +2 -3
- intentkit/skills/openai/gpt_image_to_image.py +2 -3
- intentkit/skills/openai/image_to_text.py +1 -2
- intentkit/skills/portfolio/base.py +6 -6
- intentkit/skills/portfolio/token_balances.py +21 -21
- intentkit/skills/portfolio/wallet_approvals.py +7 -7
- intentkit/skills/portfolio/wallet_defi_positions.py +3 -3
- intentkit/skills/portfolio/wallet_history.py +21 -21
- intentkit/skills/portfolio/wallet_net_worth.py +13 -13
- intentkit/skills/portfolio/wallet_nfts.py +19 -19
- intentkit/skills/portfolio/wallet_profitability.py +7 -7
- intentkit/skills/portfolio/wallet_profitability_summary.py +5 -5
- intentkit/skills/portfolio/wallet_stats.py +3 -3
- intentkit/skills/portfolio/wallet_swaps.py +19 -19
- intentkit/skills/pyth/__init__.py +3 -5
- intentkit/skills/slack/base.py +2 -4
- intentkit/skills/slack/get_channel.py +8 -8
- intentkit/skills/slack/get_message.py +9 -9
- intentkit/skills/slack/schedule_message.py +5 -5
- intentkit/skills/slack/send_message.py +3 -5
- intentkit/skills/supabase/base.py +1 -3
- intentkit/skills/supabase/delete_data.py +4 -4
- intentkit/skills/supabase/fetch_data.py +12 -12
- intentkit/skills/supabase/insert_data.py +4 -4
- intentkit/skills/supabase/invoke_function.py +6 -6
- intentkit/skills/supabase/update_data.py +6 -6
- intentkit/skills/supabase/upsert_data.py +4 -4
- intentkit/skills/superfluid/__init__.py +4 -6
- intentkit/skills/system/add_autonomous_task.py +8 -10
- intentkit/skills/system/edit_autonomous_task.py +12 -14
- intentkit/skills/system/list_autonomous_tasks.py +1 -3
- intentkit/skills/tavily/base.py +1 -3
- intentkit/skills/tavily/tavily_extract.py +1 -2
- intentkit/skills/tavily/tavily_search.py +1 -3
- intentkit/skills/token/base.py +5 -5
- intentkit/skills/token/erc20_transfers.py +19 -19
- intentkit/skills/token/token_analytics.py +3 -3
- intentkit/skills/token/token_price.py +13 -13
- intentkit/skills/token/token_search.py +9 -9
- intentkit/skills/twitter/base.py +3 -4
- intentkit/skills/twitter/follow_user.py +1 -2
- intentkit/skills/twitter/get_mentions.py +3 -4
- intentkit/skills/twitter/get_timeline.py +1 -2
- intentkit/skills/twitter/get_user_by_username.py +1 -2
- intentkit/skills/twitter/get_user_tweets.py +2 -3
- intentkit/skills/twitter/like_tweet.py +1 -2
- intentkit/skills/twitter/post_tweet.py +3 -4
- intentkit/skills/twitter/reply_tweet.py +3 -4
- intentkit/skills/twitter/retweet.py +1 -2
- intentkit/skills/twitter/search_tweets.py +1 -2
- intentkit/skills/unrealspeech/base.py +1 -3
- intentkit/skills/unrealspeech/text_to_speech.py +8 -8
- intentkit/skills/venice_audio/__init__.py +8 -9
- intentkit/skills/venice_audio/base.py +3 -4
- intentkit/skills/venice_audio/input.py +41 -41
- intentkit/skills/venice_audio/venice_audio.py +6 -6
- intentkit/skills/venice_image/__init__.py +5 -5
- intentkit/skills/venice_image/api.py +138 -138
- intentkit/skills/venice_image/base.py +3 -3
- intentkit/skills/venice_image/config.py +33 -35
- intentkit/skills/venice_image/image_enhance/image_enhance.py +2 -3
- intentkit/skills/venice_image/image_enhance/image_enhance_base.py +21 -23
- intentkit/skills/venice_image/image_enhance/image_enhance_input.py +38 -40
- intentkit/skills/venice_image/image_generation/image_generation_base.py +9 -9
- intentkit/skills/venice_image/image_generation/image_generation_fluently_xl.py +26 -26
- intentkit/skills/venice_image/image_generation/image_generation_flux_dev.py +27 -27
- intentkit/skills/venice_image/image_generation/image_generation_flux_dev_uncensored.py +26 -26
- intentkit/skills/venice_image/image_generation/image_generation_input.py +158 -158
- intentkit/skills/venice_image/image_generation/image_generation_lustify_sdxl.py +26 -26
- intentkit/skills/venice_image/image_generation/image_generation_pony_realism.py +26 -26
- intentkit/skills/venice_image/image_generation/image_generation_stable_diffusion_3_5.py +28 -28
- intentkit/skills/venice_image/image_generation/image_generation_venice_sd35.py +28 -28
- intentkit/skills/venice_image/image_upscale/image_upscale.py +3 -3
- intentkit/skills/venice_image/image_upscale/image_upscale_base.py +21 -23
- intentkit/skills/venice_image/image_upscale/image_upscale_input.py +22 -22
- intentkit/skills/venice_image/image_vision/image_vision.py +2 -2
- intentkit/skills/venice_image/image_vision/image_vision_base.py +17 -17
- intentkit/skills/venice_image/image_vision/image_vision_input.py +9 -9
- intentkit/skills/venice_image/utils.py +77 -78
- intentkit/skills/web_scraper/base.py +1 -3
- intentkit/skills/web_scraper/document_indexer.py +1 -2
- intentkit/skills/web_scraper/scrape_and_index.py +4 -5
- intentkit/skills/web_scraper/utils.py +25 -26
- intentkit/skills/web_scraper/website_indexer.py +10 -11
- intentkit/skills/weth/__init__.py +4 -6
- intentkit/skills/wow/__init__.py +4 -6
- intentkit/skills/x402/__init__.py +11 -3
- intentkit/skills/x402/ask_agent.py +12 -78
- intentkit/skills/x402/base.py +90 -0
- intentkit/skills/x402/http_request.py +117 -0
- intentkit/skills/x402/schema.json +15 -10
- intentkit/skills/xmtp/base.py +3 -3
- intentkit/skills/xmtp/price.py +2 -2
- intentkit/skills/xmtp/swap.py +2 -4
- intentkit/skills/xmtp/transfer.py +4 -6
- intentkit/utils/error.py +2 -2
- intentkit/utils/logging.py +2 -4
- intentkit/utils/s3.py +8 -9
- intentkit/utils/schema.py +5 -5
- intentkit/utils/slack_alert.py +7 -8
- {intentkit-0.8.16.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/METADATA +3 -4
- intentkit-0.8.17.dev2.dist-info/RECORD +464 -0
- intentkit/models/generator.py +0 -347
- intentkit-0.8.16.dev1.dist-info/RECORD +0 -464
- {intentkit-0.8.16.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/WHEEL +0 -0
- {intentkit-0.8.16.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any
|
|
3
3
|
|
|
4
4
|
from langchain_core.tools import ToolException
|
|
5
5
|
from pydantic import BaseModel, Field
|
|
@@ -17,7 +17,7 @@ class SupabaseInsertDataInput(BaseModel):
|
|
|
17
17
|
"""Input for SupabaseInsertData tool."""
|
|
18
18
|
|
|
19
19
|
table: str = Field(description="The name of the table to insert data into")
|
|
20
|
-
data:
|
|
20
|
+
data: dict[str, Any] | list[dict[str, Any]] = Field(
|
|
21
21
|
description="The data to insert. Can be a single object or a list of objects"
|
|
22
22
|
)
|
|
23
23
|
returning: str = Field(
|
|
@@ -34,12 +34,12 @@ class SupabaseInsertData(SupabaseBaseTool):
|
|
|
34
34
|
|
|
35
35
|
name: str = NAME
|
|
36
36
|
description: str = PROMPT
|
|
37
|
-
args_schema:
|
|
37
|
+
args_schema: type[BaseModel] = SupabaseInsertDataInput
|
|
38
38
|
|
|
39
39
|
async def _arun(
|
|
40
40
|
self,
|
|
41
41
|
table: str,
|
|
42
|
-
data:
|
|
42
|
+
data: dict[str, Any] | list[dict[str, Any]],
|
|
43
43
|
returning: str = "*",
|
|
44
44
|
**kwargs,
|
|
45
45
|
):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any
|
|
3
3
|
|
|
4
4
|
from langchain_core.tools import ToolException
|
|
5
5
|
from pydantic import BaseModel, Field
|
|
@@ -17,10 +17,10 @@ class SupabaseInvokeFunctionInput(BaseModel):
|
|
|
17
17
|
"""Input for SupabaseInvokeFunction tool."""
|
|
18
18
|
|
|
19
19
|
function_name: str = Field(description="The name of the Edge Function to invoke")
|
|
20
|
-
parameters:
|
|
20
|
+
parameters: dict[str, Any] | None = Field(
|
|
21
21
|
default=None, description="Optional parameters to pass to the function"
|
|
22
22
|
)
|
|
23
|
-
headers:
|
|
23
|
+
headers: dict[str, str] | None = Field(
|
|
24
24
|
default=None, description="Optional headers to include in the request"
|
|
25
25
|
)
|
|
26
26
|
|
|
@@ -33,13 +33,13 @@ class SupabaseInvokeFunction(SupabaseBaseTool):
|
|
|
33
33
|
|
|
34
34
|
name: str = NAME
|
|
35
35
|
description: str = PROMPT
|
|
36
|
-
args_schema:
|
|
36
|
+
args_schema: type[BaseModel] = SupabaseInvokeFunctionInput
|
|
37
37
|
|
|
38
38
|
async def _arun(
|
|
39
39
|
self,
|
|
40
40
|
function_name: str,
|
|
41
|
-
parameters:
|
|
42
|
-
headers:
|
|
41
|
+
parameters: dict[str, Any] | None = None,
|
|
42
|
+
headers: dict[str, str] | None = None,
|
|
43
43
|
**kwargs,
|
|
44
44
|
):
|
|
45
45
|
try:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any
|
|
3
3
|
|
|
4
4
|
from langchain_core.tools import ToolException
|
|
5
5
|
from pydantic import BaseModel, Field
|
|
@@ -17,10 +17,10 @@ class SupabaseUpdateDataInput(BaseModel):
|
|
|
17
17
|
"""Input for SupabaseUpdateData tool."""
|
|
18
18
|
|
|
19
19
|
table: str = Field(description="The name of the table to update data in")
|
|
20
|
-
data:
|
|
20
|
+
data: dict[str, Any] = Field(
|
|
21
21
|
description="The data to update (key-value pairs of columns and new values)"
|
|
22
22
|
)
|
|
23
|
-
filters:
|
|
23
|
+
filters: dict[str, Any] = Field(
|
|
24
24
|
description="Dictionary of filters to identify which records to update (e.g., {'id': 123})"
|
|
25
25
|
)
|
|
26
26
|
returning: str = Field(
|
|
@@ -36,13 +36,13 @@ class SupabaseUpdateData(SupabaseBaseTool):
|
|
|
36
36
|
|
|
37
37
|
name: str = NAME
|
|
38
38
|
description: str = PROMPT
|
|
39
|
-
args_schema:
|
|
39
|
+
args_schema: type[BaseModel] = SupabaseUpdateDataInput
|
|
40
40
|
|
|
41
41
|
async def _arun(
|
|
42
42
|
self,
|
|
43
43
|
table: str,
|
|
44
|
-
data:
|
|
45
|
-
filters:
|
|
44
|
+
data: dict[str, Any],
|
|
45
|
+
filters: dict[str, Any],
|
|
46
46
|
returning: str = "*",
|
|
47
47
|
**kwargs,
|
|
48
48
|
):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any
|
|
3
3
|
|
|
4
4
|
from langchain_core.tools import ToolException
|
|
5
5
|
from pydantic import BaseModel, Field
|
|
@@ -19,7 +19,7 @@ class SupabaseUpsertDataInput(BaseModel):
|
|
|
19
19
|
"""Input for SupabaseUpsertData tool."""
|
|
20
20
|
|
|
21
21
|
table: str = Field(description="The name of the table to upsert data into")
|
|
22
|
-
data:
|
|
22
|
+
data: dict[str, Any] | list[dict[str, Any]] = Field(
|
|
23
23
|
description="The data to upsert. Can be a single object or a list of objects"
|
|
24
24
|
)
|
|
25
25
|
on_conflict: str = Field(
|
|
@@ -38,12 +38,12 @@ class SupabaseUpsertData(SupabaseBaseTool):
|
|
|
38
38
|
|
|
39
39
|
name: str = NAME
|
|
40
40
|
description: str = PROMPT
|
|
41
|
-
args_schema:
|
|
41
|
+
args_schema: type[BaseModel] = SupabaseUpsertDataInput
|
|
42
42
|
|
|
43
43
|
async def _arun(
|
|
44
44
|
self,
|
|
45
45
|
table: str,
|
|
46
|
-
data:
|
|
46
|
+
data: dict[str, Any] | list[dict[str, Any]],
|
|
47
47
|
on_conflict: str,
|
|
48
48
|
returning: str = "*",
|
|
49
49
|
**kwargs,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"""Superfluid AgentKit skills."""
|
|
2
2
|
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import TypedDict
|
|
4
4
|
|
|
5
5
|
from coinbase_agentkit import superfluid_action_provider
|
|
6
6
|
|
|
7
|
+
from intentkit.models.agent import Agent
|
|
7
8
|
from intentkit.skills.base import (
|
|
8
9
|
SkillConfig,
|
|
9
10
|
SkillState,
|
|
@@ -12,9 +13,6 @@ from intentkit.skills.base import (
|
|
|
12
13
|
)
|
|
13
14
|
from intentkit.skills.superfluid.base import SuperfluidBaseTool
|
|
14
15
|
|
|
15
|
-
if TYPE_CHECKING:
|
|
16
|
-
from intentkit.models.agent import Agent
|
|
17
|
-
|
|
18
16
|
|
|
19
17
|
class SkillStates(TypedDict):
|
|
20
18
|
SuperfluidActionProvider_create_flow: SkillState
|
|
@@ -29,10 +27,10 @@ class Config(SkillConfig):
|
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
async def get_skills(
|
|
32
|
-
config:
|
|
30
|
+
config: Config,
|
|
33
31
|
is_private: bool,
|
|
34
32
|
agent_id: str,
|
|
35
|
-
agent:
|
|
33
|
+
agent: Agent | None = None,
|
|
36
34
|
**_,
|
|
37
35
|
) -> list[SuperfluidBaseTool]:
|
|
38
36
|
"""Get all Superfluid skills."""
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
|
|
3
1
|
from pydantic import BaseModel, Field
|
|
4
2
|
|
|
5
3
|
from intentkit.models.agent import AgentAutonomous
|
|
@@ -9,21 +7,21 @@ from intentkit.skills.system.base import SystemBaseTool
|
|
|
9
7
|
class AddAutonomousTaskInput(BaseModel):
|
|
10
8
|
"""Input model for add_autonomous_task skill."""
|
|
11
9
|
|
|
12
|
-
name:
|
|
10
|
+
name: str | None = Field(
|
|
13
11
|
default=None,
|
|
14
12
|
description="Display name of the autonomous task configuration",
|
|
15
13
|
max_length=50,
|
|
16
14
|
)
|
|
17
|
-
description:
|
|
15
|
+
description: str | None = Field(
|
|
18
16
|
default=None,
|
|
19
17
|
description="Description of the autonomous task configuration",
|
|
20
18
|
max_length=200,
|
|
21
19
|
)
|
|
22
|
-
minutes:
|
|
20
|
+
minutes: int | None = Field(
|
|
23
21
|
default=None,
|
|
24
22
|
description="Interval in minutes between operations, mutually exclusive with cron",
|
|
25
23
|
)
|
|
26
|
-
cron:
|
|
24
|
+
cron: str | None = Field(
|
|
27
25
|
default=None,
|
|
28
26
|
description="Cron expression for scheduling operations, mutually exclusive with minutes",
|
|
29
27
|
)
|
|
@@ -54,10 +52,10 @@ class AddAutonomousTask(SystemBaseTool):
|
|
|
54
52
|
|
|
55
53
|
async def _arun(
|
|
56
54
|
self,
|
|
57
|
-
name:
|
|
58
|
-
description:
|
|
59
|
-
minutes:
|
|
60
|
-
cron:
|
|
55
|
+
name: str | None = None,
|
|
56
|
+
description: str | None = None,
|
|
57
|
+
minutes: int | None = None,
|
|
58
|
+
cron: str | None = None,
|
|
61
59
|
prompt: str = "",
|
|
62
60
|
**kwargs,
|
|
63
61
|
) -> AddAutonomousTaskOutput:
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
|
|
3
1
|
from pydantic import BaseModel, Field
|
|
4
2
|
|
|
5
3
|
from intentkit.models.agent import AgentAutonomous
|
|
@@ -12,28 +10,28 @@ class EditAutonomousTaskInput(BaseModel):
|
|
|
12
10
|
task_id: str = Field(
|
|
13
11
|
description="The unique identifier of the autonomous task to edit"
|
|
14
12
|
)
|
|
15
|
-
name:
|
|
13
|
+
name: str | None = Field(
|
|
16
14
|
default=None,
|
|
17
15
|
description="Display name of the autonomous task configuration",
|
|
18
16
|
max_length=50,
|
|
19
17
|
)
|
|
20
|
-
description:
|
|
18
|
+
description: str | None = Field(
|
|
21
19
|
default=None,
|
|
22
20
|
description="Description of the autonomous task configuration",
|
|
23
21
|
max_length=200,
|
|
24
22
|
)
|
|
25
|
-
minutes:
|
|
23
|
+
minutes: int | None = Field(
|
|
26
24
|
default=None,
|
|
27
25
|
description="Interval in minutes between operations, mutually exclusive with cron",
|
|
28
26
|
)
|
|
29
|
-
cron:
|
|
27
|
+
cron: str | None = Field(
|
|
30
28
|
default=None,
|
|
31
29
|
description="Cron expression for scheduling operations, mutually exclusive with minutes",
|
|
32
30
|
)
|
|
33
|
-
prompt:
|
|
31
|
+
prompt: str | None = Field(
|
|
34
32
|
default=None, description="Special prompt used during autonomous operation"
|
|
35
33
|
)
|
|
36
|
-
enabled:
|
|
34
|
+
enabled: bool | None = Field(
|
|
37
35
|
default=None, description="Whether the autonomous task is enabled"
|
|
38
36
|
)
|
|
39
37
|
|
|
@@ -61,12 +59,12 @@ class EditAutonomousTask(SystemBaseTool):
|
|
|
61
59
|
async def _arun(
|
|
62
60
|
self,
|
|
63
61
|
task_id: str,
|
|
64
|
-
name:
|
|
65
|
-
description:
|
|
66
|
-
minutes:
|
|
67
|
-
cron:
|
|
68
|
-
prompt:
|
|
69
|
-
enabled:
|
|
62
|
+
name: str | None = None,
|
|
63
|
+
description: str | None = None,
|
|
64
|
+
minutes: int | None = None,
|
|
65
|
+
cron: str | None = None,
|
|
66
|
+
prompt: str | None = None,
|
|
67
|
+
enabled: bool | None = None,
|
|
70
68
|
**kwargs,
|
|
71
69
|
) -> EditAutonomousTaskOutput:
|
|
72
70
|
"""Edit an autonomous task for the agent.
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import List
|
|
2
|
-
|
|
3
1
|
from pydantic import BaseModel, Field
|
|
4
2
|
|
|
5
3
|
from intentkit.models.agent import AgentAutonomous
|
|
@@ -15,7 +13,7 @@ class ListAutonomousTasksInput(BaseModel):
|
|
|
15
13
|
class ListAutonomousTasksOutput(BaseModel):
|
|
16
14
|
"""Output model for list_autonomous_tasks skill."""
|
|
17
15
|
|
|
18
|
-
tasks:
|
|
16
|
+
tasks: list[AgentAutonomous] = Field(
|
|
19
17
|
description="List of autonomous task configurations for the agent"
|
|
20
18
|
)
|
|
21
19
|
|
intentkit/skills/tavily/base.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Type
|
|
2
|
-
|
|
3
1
|
from langchain_core.tools.base import ToolException
|
|
4
2
|
from pydantic import BaseModel, Field
|
|
5
3
|
|
|
@@ -12,7 +10,7 @@ class TavilyBaseTool(IntentKitSkill):
|
|
|
12
10
|
|
|
13
11
|
name: str = Field(description="The name of the tool")
|
|
14
12
|
description: str = Field(description="A description of what the tool does")
|
|
15
|
-
args_schema:
|
|
13
|
+
args_schema: type[BaseModel]
|
|
16
14
|
|
|
17
15
|
def get_api_key(self) -> str:
|
|
18
16
|
context = self.get_context()
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Type
|
|
3
2
|
|
|
4
3
|
import httpx
|
|
5
4
|
from pydantic import BaseModel, Field
|
|
@@ -42,7 +41,7 @@ class TavilyExtract(TavilyBaseTool):
|
|
|
42
41
|
"This tool is useful when you need to get the full text content from a webpage. "
|
|
43
42
|
"You must call this tool whenever the user asks to extract or scrape content from a specific URL."
|
|
44
43
|
)
|
|
45
|
-
args_schema:
|
|
44
|
+
args_schema: type[BaseModel] = TavilyExtractInput
|
|
46
45
|
|
|
47
46
|
async def _arun(
|
|
48
47
|
self,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Type
|
|
3
2
|
|
|
4
3
|
import httpx
|
|
5
4
|
from pydantic import BaseModel, Field
|
|
@@ -50,7 +49,7 @@ class TavilySearch(TavilyBaseTool):
|
|
|
50
49
|
"You must call this tool whenever the user asks for information that may not be in your training data,"
|
|
51
50
|
" requires current data, or when you're unsure about facts."
|
|
52
51
|
)
|
|
53
|
-
args_schema:
|
|
52
|
+
args_schema: type[BaseModel] = TavilySearchInput
|
|
54
53
|
|
|
55
54
|
async def _arun(
|
|
56
55
|
self,
|
|
@@ -68,7 +67,6 @@ class TavilySearch(TavilyBaseTool):
|
|
|
68
67
|
include_images: Whether to include image URLs in the results.
|
|
69
68
|
include_raw_content: Whether to include raw HTML content in the results.
|
|
70
69
|
|
|
71
|
-
|
|
72
70
|
Returns:
|
|
73
71
|
str: Formatted search results with titles, snippets, and URLs.
|
|
74
72
|
"""
|
intentkit/skills/token/base.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Base class for token-related skills."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
import aiohttp
|
|
7
7
|
|
|
@@ -35,7 +35,7 @@ class TokenBaseTool(IntentKitSkill):
|
|
|
35
35
|
return skill_config.get("api_key")
|
|
36
36
|
return config.moralis_api_key
|
|
37
37
|
|
|
38
|
-
def _prepare_params(self, params:
|
|
38
|
+
def _prepare_params(self, params: dict[str, Any]) -> dict[str, Any]:
|
|
39
39
|
"""Convert boolean values to lowercase strings for API compatibility.
|
|
40
40
|
|
|
41
41
|
Args:
|
|
@@ -60,9 +60,9 @@ class TokenBaseTool(IntentKitSkill):
|
|
|
60
60
|
method: str,
|
|
61
61
|
endpoint: str,
|
|
62
62
|
api_key: str,
|
|
63
|
-
params:
|
|
64
|
-
data:
|
|
65
|
-
) ->
|
|
63
|
+
params: dict[str, Any] = None,
|
|
64
|
+
data: dict[str, Any] = None,
|
|
65
|
+
) -> dict[str, Any]:
|
|
66
66
|
"""Make a request to the Moralis API.
|
|
67
67
|
|
|
68
68
|
Args:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
@@ -19,35 +19,35 @@ class ERC20TransfersInput(BaseModel):
|
|
|
19
19
|
description="The chain to query (e.g., 'eth', 'bsc', 'polygon').",
|
|
20
20
|
default=DEFAULT_CHAIN,
|
|
21
21
|
)
|
|
22
|
-
contract_addresses:
|
|
22
|
+
contract_addresses: list[str] | None = Field(
|
|
23
23
|
description="List of contract addresses of transfers to filter by.",
|
|
24
24
|
default=None,
|
|
25
25
|
)
|
|
26
|
-
from_block:
|
|
26
|
+
from_block: int | None = Field(
|
|
27
27
|
description="The minimum block number from which to get the transactions.",
|
|
28
28
|
default=None,
|
|
29
29
|
)
|
|
30
|
-
to_block:
|
|
30
|
+
to_block: int | None = Field(
|
|
31
31
|
description="The maximum block number from which to get the transactions.",
|
|
32
32
|
default=None,
|
|
33
33
|
)
|
|
34
|
-
from_date:
|
|
34
|
+
from_date: str | None = Field(
|
|
35
35
|
description="The start date from which to get the transactions (any format accepted by momentjs).",
|
|
36
36
|
default=None,
|
|
37
37
|
)
|
|
38
|
-
to_date:
|
|
38
|
+
to_date: str | None = Field(
|
|
39
39
|
description="Get the transactions up to this date (any format accepted by momentjs).",
|
|
40
40
|
default=None,
|
|
41
41
|
)
|
|
42
|
-
limit:
|
|
42
|
+
limit: int | None = Field(
|
|
43
43
|
description="The desired page size of the result.",
|
|
44
44
|
default=DEFAULT_LIMIT,
|
|
45
45
|
)
|
|
46
|
-
order:
|
|
46
|
+
order: str | None = Field(
|
|
47
47
|
description="The order of the result, in ascending (ASC) or descending (DESC).",
|
|
48
48
|
default=DEFAULT_ORDER,
|
|
49
49
|
)
|
|
50
|
-
cursor:
|
|
50
|
+
cursor: str | None = Field(
|
|
51
51
|
description="The cursor returned in the previous response (for pagination).",
|
|
52
52
|
default=None,
|
|
53
53
|
)
|
|
@@ -65,22 +65,22 @@ class ERC20Transfers(TokenBaseTool):
|
|
|
65
65
|
"Get ERC20 token transactions for a wallet address, ordered by block number. "
|
|
66
66
|
"Returns transaction details, token information, and wallet interactions."
|
|
67
67
|
)
|
|
68
|
-
args_schema:
|
|
68
|
+
args_schema: type[BaseModel] = ERC20TransfersInput
|
|
69
69
|
|
|
70
70
|
async def _arun(
|
|
71
71
|
self,
|
|
72
72
|
address: str,
|
|
73
73
|
chain: str = DEFAULT_CHAIN,
|
|
74
|
-
contract_addresses:
|
|
75
|
-
from_block:
|
|
76
|
-
to_block:
|
|
77
|
-
from_date:
|
|
78
|
-
to_date:
|
|
79
|
-
limit:
|
|
80
|
-
order:
|
|
81
|
-
cursor:
|
|
74
|
+
contract_addresses: list[str] | None = None,
|
|
75
|
+
from_block: int | None = None,
|
|
76
|
+
to_block: int | None = None,
|
|
77
|
+
from_date: str | None = None,
|
|
78
|
+
to_date: str | None = None,
|
|
79
|
+
limit: int | None = DEFAULT_LIMIT,
|
|
80
|
+
order: str | None = DEFAULT_ORDER,
|
|
81
|
+
cursor: str | None = None,
|
|
82
82
|
**kwargs,
|
|
83
|
-
) ->
|
|
83
|
+
) -> dict[str, Any]:
|
|
84
84
|
"""Fetch ERC20 token transfers for a wallet from Moralis.
|
|
85
85
|
|
|
86
86
|
Args:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
@@ -31,14 +31,14 @@ class TokenAnalytics(TokenBaseTool):
|
|
|
31
31
|
"Get analytics for a token by token address. "
|
|
32
32
|
"Returns trading volumes, number of buyers/sellers, and liquidity information over various time periods."
|
|
33
33
|
)
|
|
34
|
-
args_schema:
|
|
34
|
+
args_schema: type[BaseModel] = TokenAnalyticsInput
|
|
35
35
|
|
|
36
36
|
async def _arun(
|
|
37
37
|
self,
|
|
38
38
|
address: str,
|
|
39
39
|
chain: str = DEFAULT_CHAIN,
|
|
40
40
|
**kwargs,
|
|
41
|
-
) ->
|
|
41
|
+
) -> dict[str, Any]:
|
|
42
42
|
"""Fetch token analytics from Moralis.
|
|
43
43
|
|
|
44
44
|
Args:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
@@ -19,23 +19,23 @@ class TokenPriceInput(BaseModel):
|
|
|
19
19
|
description="The chain to query (e.g., 'eth', 'bsc', 'polygon').",
|
|
20
20
|
default=DEFAULT_CHAIN,
|
|
21
21
|
)
|
|
22
|
-
include:
|
|
22
|
+
include: str | None = Field(
|
|
23
23
|
description="If the result should contain the 24hr percent change (use 'percent_change').",
|
|
24
24
|
default=None,
|
|
25
25
|
)
|
|
26
|
-
exchange:
|
|
26
|
+
exchange: str | None = Field(
|
|
27
27
|
description="The factory name or address of the token exchange.",
|
|
28
28
|
default=None,
|
|
29
29
|
)
|
|
30
|
-
to_block:
|
|
30
|
+
to_block: int | None = Field(
|
|
31
31
|
description="The block number from which the token price should be checked.",
|
|
32
32
|
default=None,
|
|
33
33
|
)
|
|
34
|
-
max_token_inactivity:
|
|
34
|
+
max_token_inactivity: int | None = Field(
|
|
35
35
|
description="Exclude tokens inactive for more than the given amount of days.",
|
|
36
36
|
default=None,
|
|
37
37
|
)
|
|
38
|
-
min_pair_side_liquidity_usd:
|
|
38
|
+
min_pair_side_liquidity_usd: int | None = Field(
|
|
39
39
|
description="Exclude tokens with liquidity less than the specified amount in USD.",
|
|
40
40
|
default=None,
|
|
41
41
|
)
|
|
@@ -53,19 +53,19 @@ class TokenPrice(TokenBaseTool):
|
|
|
53
53
|
"Get the token price denominated in the blockchain's native token and USD for a given token contract address. "
|
|
54
54
|
"Returns price, token information and exchange data."
|
|
55
55
|
)
|
|
56
|
-
args_schema:
|
|
56
|
+
args_schema: type[BaseModel] = TokenPriceInput
|
|
57
57
|
|
|
58
58
|
async def _arun(
|
|
59
59
|
self,
|
|
60
60
|
address: str,
|
|
61
61
|
chain: str = DEFAULT_CHAIN,
|
|
62
|
-
include:
|
|
63
|
-
exchange:
|
|
64
|
-
to_block:
|
|
65
|
-
max_token_inactivity:
|
|
66
|
-
min_pair_side_liquidity_usd:
|
|
62
|
+
include: str | None = None,
|
|
63
|
+
exchange: str | None = None,
|
|
64
|
+
to_block: int | None = None,
|
|
65
|
+
max_token_inactivity: int | None = None,
|
|
66
|
+
min_pair_side_liquidity_usd: int | None = None,
|
|
67
67
|
**kwargs,
|
|
68
|
-
) ->
|
|
68
|
+
) -> dict[str, Any]:
|
|
69
69
|
"""Fetch token price from Moralis.
|
|
70
70
|
|
|
71
71
|
Args:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
@@ -14,15 +14,15 @@ class TokenSearchInput(BaseModel):
|
|
|
14
14
|
query: str = Field(
|
|
15
15
|
description="Search query - can be token address, token name or token symbol."
|
|
16
16
|
)
|
|
17
|
-
chains:
|
|
17
|
+
chains: list[str] | None = Field(
|
|
18
18
|
description="The chain(s) to query (e.g., 'eth', 'bsc', 'polygon').",
|
|
19
19
|
default=None,
|
|
20
20
|
)
|
|
21
|
-
limit:
|
|
21
|
+
limit: int | None = Field(
|
|
22
22
|
description="The desired page size of the result.",
|
|
23
23
|
default=None,
|
|
24
24
|
)
|
|
25
|
-
is_verified_contract:
|
|
25
|
+
is_verified_contract: bool | None = Field(
|
|
26
26
|
description="Whether the contract is verified.",
|
|
27
27
|
default=None,
|
|
28
28
|
)
|
|
@@ -44,16 +44,16 @@ class TokenSearch(TokenBaseTool):
|
|
|
44
44
|
"Returns token information including price, market cap, and security information. "
|
|
45
45
|
"NOTE: This is a premium endpoint that requires a Moralis Business plan."
|
|
46
46
|
)
|
|
47
|
-
args_schema:
|
|
47
|
+
args_schema: type[BaseModel] = TokenSearchInput
|
|
48
48
|
|
|
49
49
|
async def _arun(
|
|
50
50
|
self,
|
|
51
51
|
query: str,
|
|
52
|
-
chains:
|
|
53
|
-
limit:
|
|
54
|
-
is_verified_contract:
|
|
52
|
+
chains: list[str] | None = None,
|
|
53
|
+
limit: int | None = None,
|
|
54
|
+
is_verified_contract: bool | None = None,
|
|
55
55
|
**kwargs,
|
|
56
|
-
) ->
|
|
56
|
+
) -> dict[str, Any]:
|
|
57
57
|
"""Search for tokens using Moralis.
|
|
58
58
|
|
|
59
59
|
Args:
|
intentkit/skills/twitter/base.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
from datetime import datetime, timedelta
|
|
2
|
-
from typing import Type
|
|
1
|
+
from datetime import UTC, datetime, timedelta
|
|
3
2
|
|
|
4
3
|
from langchain_core.tools.base import ToolException
|
|
5
4
|
from pydantic import BaseModel, Field
|
|
@@ -14,7 +13,7 @@ class TwitterBaseTool(IntentKitSkill):
|
|
|
14
13
|
|
|
15
14
|
name: str = Field(description="The name of the tool")
|
|
16
15
|
description: str = Field(description="A description of what the tool does")
|
|
17
|
-
args_schema:
|
|
16
|
+
args_schema: type[BaseModel]
|
|
18
17
|
|
|
19
18
|
def get_api_key(self) -> dict:
|
|
20
19
|
context = self.get_context()
|
|
@@ -73,7 +72,7 @@ class TwitterBaseTool(IntentKitSkill):
|
|
|
73
72
|
"""
|
|
74
73
|
rate_limit = await self.get_agent_skill_data("rate_limit")
|
|
75
74
|
|
|
76
|
-
current_time = datetime.now(tz=
|
|
75
|
+
current_time = datetime.now(tz=UTC)
|
|
77
76
|
|
|
78
77
|
if (
|
|
79
78
|
rate_limit
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Type
|
|
3
2
|
|
|
4
3
|
from langchain_core.tools import ToolException
|
|
5
4
|
from pydantic import BaseModel, Field
|
|
@@ -34,7 +33,7 @@ class TwitterFollowUser(TwitterBaseTool):
|
|
|
34
33
|
|
|
35
34
|
name: str = NAME
|
|
36
35
|
description: str = PROMPT
|
|
37
|
-
args_schema:
|
|
36
|
+
args_schema: type[BaseModel] = TwitterFollowUserInput
|
|
38
37
|
|
|
39
38
|
async def _arun(self, user_id: str, **kwargs) -> bool:
|
|
40
39
|
context = self.get_context()
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from datetime import datetime, timedelta
|
|
3
|
-
from typing import Type
|
|
2
|
+
from datetime import UTC, datetime, timedelta
|
|
4
3
|
|
|
5
4
|
from langchain_core.tools import ToolException
|
|
6
5
|
from pydantic import BaseModel
|
|
@@ -38,7 +37,7 @@ class TwitterGetMentions(TwitterBaseTool):
|
|
|
38
37
|
|
|
39
38
|
name: str = NAME
|
|
40
39
|
description: str = PROMPT
|
|
41
|
-
args_schema:
|
|
40
|
+
args_schema: type[BaseModel] = TwitterGetMentionsInput
|
|
42
41
|
|
|
43
42
|
async def _arun(self, **kwargs) -> list[Tweet]:
|
|
44
43
|
context = self.get_context()
|
|
@@ -68,7 +67,7 @@ class TwitterGetMentions(TwitterBaseTool):
|
|
|
68
67
|
max_results = 30
|
|
69
68
|
|
|
70
69
|
# Always get mentions for the last day
|
|
71
|
-
start_time = datetime.now(tz=
|
|
70
|
+
start_time = datetime.now(tz=UTC) - timedelta(days=1)
|
|
72
71
|
|
|
73
72
|
user_id = twitter.self_id
|
|
74
73
|
if not user_id:
|