intentkit 0.8.17.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/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 +2 -2
- intentkit/skills/x402/ask_agent.py +7 -7
- intentkit/skills/x402/base.py +2 -1
- intentkit/skills/x402/http_request.py +10 -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.17.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.17.dev1.dist-info/RECORD +0 -465
- {intentkit-0.8.17.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/WHEEL +0 -0
- {intentkit-0.8.17.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Type
|
|
3
2
|
|
|
4
3
|
from pydantic import BaseModel
|
|
5
4
|
|
|
@@ -34,7 +33,7 @@ class TwitterGetTimeline(TwitterBaseTool):
|
|
|
34
33
|
|
|
35
34
|
name: str = NAME
|
|
36
35
|
description: str = PROMPT
|
|
37
|
-
args_schema:
|
|
36
|
+
args_schema: type[BaseModel] = TwitterGetTimelineInput
|
|
38
37
|
|
|
39
38
|
async def _arun(self, **kwargs):
|
|
40
39
|
context = self.get_context()
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Type
|
|
3
2
|
|
|
4
3
|
from pydantic import BaseModel, Field
|
|
5
4
|
|
|
@@ -35,7 +34,7 @@ class TwitterGetUserByUsername(TwitterBaseTool):
|
|
|
35
34
|
|
|
36
35
|
name: str = NAME
|
|
37
36
|
description: str = PROMPT
|
|
38
|
-
args_schema:
|
|
37
|
+
args_schema: type[BaseModel] = TwitterGetUserByUsernameInput
|
|
39
38
|
|
|
40
39
|
async def _arun(self, username: str, **kwargs):
|
|
41
40
|
context = self.get_context()
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import List, Optional, Type
|
|
3
2
|
|
|
4
3
|
from pydantic import BaseModel, Field
|
|
5
4
|
|
|
@@ -21,7 +20,7 @@ class TwitterGetUserTweetsInput(BaseModel):
|
|
|
21
20
|
"""Input for TwitterGetUserTweets tool."""
|
|
22
21
|
|
|
23
22
|
user_id: str = Field(description="The Twitter user ID to fetch tweets from")
|
|
24
|
-
exclude:
|
|
23
|
+
exclude: list[str] | None = Field(
|
|
25
24
|
default=["replies", "retweets"],
|
|
26
25
|
description="Types of tweets to exclude (e.g., 'replies', 'retweets')",
|
|
27
26
|
)
|
|
@@ -41,7 +40,7 @@ class TwitterGetUserTweets(TwitterBaseTool):
|
|
|
41
40
|
|
|
42
41
|
name: str = NAME
|
|
43
42
|
description: str = PROMPT
|
|
44
|
-
args_schema:
|
|
43
|
+
args_schema: type[BaseModel] = TwitterGetUserTweetsInput
|
|
45
44
|
|
|
46
45
|
async def _arun(self, **kwargs):
|
|
47
46
|
context = self.get_context()
|
|
@@ -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
|
|
@@ -32,7 +31,7 @@ class TwitterLikeTweet(TwitterBaseTool):
|
|
|
32
31
|
|
|
33
32
|
name: str = NAME
|
|
34
33
|
description: str = PROMPT
|
|
35
|
-
args_schema:
|
|
34
|
+
args_schema: type[BaseModel] = TwitterLikeTweetInput
|
|
36
35
|
|
|
37
36
|
async def _arun(self, tweet_id: str, **kwargs):
|
|
38
37
|
context = self.get_context()
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Optional, Type
|
|
3
2
|
|
|
4
3
|
from langchain_core.tools import ToolException
|
|
5
4
|
from pydantic import BaseModel, Field
|
|
@@ -24,7 +23,7 @@ class TwitterPostTweetInput(BaseModel):
|
|
|
24
23
|
description="Tweet text (280 chars for regular users, 25,000 bytes for verified)",
|
|
25
24
|
max_length=25000,
|
|
26
25
|
)
|
|
27
|
-
image:
|
|
26
|
+
image: str | None = Field(
|
|
28
27
|
default=None, description="Optional URL of an image to attach to the tweet"
|
|
29
28
|
)
|
|
30
29
|
|
|
@@ -42,12 +41,12 @@ class TwitterPostTweet(TwitterBaseTool):
|
|
|
42
41
|
|
|
43
42
|
name: str = NAME
|
|
44
43
|
description: str = PROMPT
|
|
45
|
-
args_schema:
|
|
44
|
+
args_schema: type[BaseModel] = TwitterPostTweetInput
|
|
46
45
|
|
|
47
46
|
async def _arun(
|
|
48
47
|
self,
|
|
49
48
|
text: str,
|
|
50
|
-
image:
|
|
49
|
+
image: str | None = None,
|
|
51
50
|
**kwargs,
|
|
52
51
|
):
|
|
53
52
|
context = self.get_context()
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Optional, Type
|
|
3
2
|
|
|
4
3
|
from langchain_core.tools import ToolException
|
|
5
4
|
from pydantic import BaseModel, Field
|
|
@@ -25,7 +24,7 @@ class TwitterReplyTweetInput(BaseModel):
|
|
|
25
24
|
description="Tweet text (280 chars for regular users, 25,000 bytes for verified)",
|
|
26
25
|
max_length=25000,
|
|
27
26
|
)
|
|
28
|
-
image:
|
|
27
|
+
image: str | None = Field(
|
|
29
28
|
default=None, description="Optional URL of an image to attach to the reply"
|
|
30
29
|
)
|
|
31
30
|
|
|
@@ -43,13 +42,13 @@ class TwitterReplyTweet(TwitterBaseTool):
|
|
|
43
42
|
|
|
44
43
|
name: str = NAME
|
|
45
44
|
description: str = PROMPT
|
|
46
|
-
args_schema:
|
|
45
|
+
args_schema: type[BaseModel] = TwitterReplyTweetInput
|
|
47
46
|
|
|
48
47
|
async def _arun(
|
|
49
48
|
self,
|
|
50
49
|
tweet_id: str,
|
|
51
50
|
text: str,
|
|
52
|
-
image:
|
|
51
|
+
image: str | None = None,
|
|
53
52
|
**kwargs,
|
|
54
53
|
):
|
|
55
54
|
context = self.get_context()
|
|
@@ -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
|
|
@@ -32,7 +31,7 @@ class TwitterRetweet(TwitterBaseTool):
|
|
|
32
31
|
|
|
33
32
|
name: str = NAME
|
|
34
33
|
description: str = PROMPT
|
|
35
|
-
args_schema:
|
|
34
|
+
args_schema: type[BaseModel] = TwitterRetweetInput
|
|
36
35
|
|
|
37
36
|
async def _arun(self, tweet_id: str, **kwargs):
|
|
38
37
|
context = self.get_context()
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import datetime
|
|
2
2
|
import logging
|
|
3
|
-
from typing import Type
|
|
4
3
|
|
|
5
4
|
from pydantic import BaseModel, Field
|
|
6
5
|
|
|
@@ -33,7 +32,7 @@ class TwitterSearchTweets(TwitterBaseTool):
|
|
|
33
32
|
|
|
34
33
|
name: str = NAME
|
|
35
34
|
description: str = PROMPT
|
|
36
|
-
args_schema:
|
|
35
|
+
args_schema: type[BaseModel] = TwitterSearchTweetsInput
|
|
37
36
|
|
|
38
37
|
async def _arun(self, query: str, **kwargs):
|
|
39
38
|
context = self.get_context()
|
|
@@ -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
|
|
|
@@ -11,7 +9,7 @@ class UnrealSpeechBaseTool(IntentKitSkill):
|
|
|
11
9
|
|
|
12
10
|
name: str = Field(description="The name of the tool")
|
|
13
11
|
description: str = Field(description="A description of what the tool does")
|
|
14
|
-
args_schema:
|
|
12
|
+
args_schema: type[BaseModel]
|
|
15
13
|
|
|
16
14
|
def get_api_key(self) -> str:
|
|
17
15
|
context = self.get_context()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import os
|
|
3
|
-
from typing import Any,
|
|
3
|
+
from typing import Any, Literal
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
6
|
from langchain_core.callbacks.manager import CallbackManagerForToolRun
|
|
@@ -31,7 +31,7 @@ class TextToSpeechInput(BaseModel):
|
|
|
31
31
|
default=0.0,
|
|
32
32
|
)
|
|
33
33
|
|
|
34
|
-
timestamp_type:
|
|
34
|
+
timestamp_type: Literal["word", "sentence"] | None = Field(
|
|
35
35
|
description="The type of timestamps to include in the response. 'word' for word-level timestamps, 'sentence' for sentence-level, or None for no timestamps.",
|
|
36
36
|
default="word",
|
|
37
37
|
)
|
|
@@ -52,9 +52,9 @@ class TextToSpeech(UnrealSpeechBaseTool):
|
|
|
52
52
|
"Returns URLs to the generated audio file and word-level timestamps.\n"
|
|
53
53
|
"Provides various voice options and speech customization parameters."
|
|
54
54
|
)
|
|
55
|
-
args_schema:
|
|
55
|
+
args_schema: type[BaseModel] = TextToSpeechInput
|
|
56
56
|
|
|
57
|
-
def get_env_var(self, env_var_name: str) ->
|
|
57
|
+
def get_env_var(self, env_var_name: str) -> str | None:
|
|
58
58
|
"""Helper method to get environment variables."""
|
|
59
59
|
return os.environ.get(env_var_name)
|
|
60
60
|
|
|
@@ -64,11 +64,11 @@ class TextToSpeech(UnrealSpeechBaseTool):
|
|
|
64
64
|
voice_id: str = "af_sarah",
|
|
65
65
|
bitrate: str = "192k",
|
|
66
66
|
speed: float = 0.0,
|
|
67
|
-
timestamp_type:
|
|
68
|
-
config:
|
|
69
|
-
run_manager:
|
|
67
|
+
timestamp_type: Literal["word", "sentence"] | None = "word",
|
|
68
|
+
config: Any | None = None,
|
|
69
|
+
run_manager: CallbackManagerForToolRun | None = None,
|
|
70
70
|
**kwargs,
|
|
71
|
-
) ->
|
|
71
|
+
) -> dict[str, Any]:
|
|
72
72
|
"""Run the tool to convert text to speech."""
|
|
73
73
|
|
|
74
74
|
# Get the API key from context config if available
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import Literal, TypedDict
|
|
3
3
|
|
|
4
4
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
5
5
|
from intentkit.skills.venice_audio.base import VeniceAudioBaseTool
|
|
@@ -7,7 +7,6 @@ from intentkit.skills.venice_audio.venice_audio import VeniceAudioTool
|
|
|
7
7
|
|
|
8
8
|
logger = logging.getLogger(__name__)
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
_cache: dict[str, VeniceAudioBaseTool] = {}
|
|
12
11
|
|
|
13
12
|
_SKILL_NAME_TO_CLASS_MAP = {
|
|
@@ -24,15 +23,15 @@ class Config(SkillConfig):
|
|
|
24
23
|
enabled: bool
|
|
25
24
|
voice_model: Literal["af_heart", "bm_lewis", "custom"]
|
|
26
25
|
states: SkillStates # type: ignore
|
|
27
|
-
api_key_provider:
|
|
26
|
+
api_key_provider: Literal["agent_owner"] | None
|
|
28
27
|
|
|
29
28
|
# conditionally required
|
|
30
|
-
api_key:
|
|
31
|
-
voice_model_custom:
|
|
29
|
+
api_key: str | None
|
|
30
|
+
voice_model_custom: list[str] | None
|
|
32
31
|
|
|
33
32
|
# optional
|
|
34
|
-
rate_limit_number:
|
|
35
|
-
rate_limit_minutes:
|
|
33
|
+
rate_limit_number: int | None
|
|
34
|
+
rate_limit_minutes: int | None
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
async def get_skills(
|
|
@@ -54,7 +53,7 @@ async def get_skills(
|
|
|
54
53
|
if not config.get("enabled", False):
|
|
55
54
|
return []
|
|
56
55
|
|
|
57
|
-
available_skills:
|
|
56
|
+
available_skills: list[VeniceAudioBaseTool] = []
|
|
58
57
|
skill_states = config.get("states", {})
|
|
59
58
|
|
|
60
59
|
# Iterate through all known skills defined in the map
|
|
@@ -79,7 +78,7 @@ async def get_skills(
|
|
|
79
78
|
|
|
80
79
|
def get_venice_audio_skill(
|
|
81
80
|
name: str,
|
|
82
|
-
) ->
|
|
81
|
+
) -> VeniceAudioBaseTool | None:
|
|
83
82
|
"""
|
|
84
83
|
Factory function to get a cached Venice Audio skill instance by name.
|
|
85
84
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Dict, List, Optional, Tuple, Type
|
|
3
2
|
|
|
4
3
|
from langchain_core.tools.base import ToolException
|
|
5
4
|
from pydantic import BaseModel, Field
|
|
@@ -15,7 +14,7 @@ class VeniceAudioBaseTool(IntentKitSkill):
|
|
|
15
14
|
|
|
16
15
|
name: str = Field(default="venice_base_tool", description="The name of the tool")
|
|
17
16
|
description: str = Field(description="A description of what the tool does")
|
|
18
|
-
args_schema:
|
|
17
|
+
args_schema: type[BaseModel] # type: ignore
|
|
19
18
|
|
|
20
19
|
@property
|
|
21
20
|
def category(self) -> str:
|
|
@@ -23,13 +22,13 @@ class VeniceAudioBaseTool(IntentKitSkill):
|
|
|
23
22
|
|
|
24
23
|
def validate_voice_model(
|
|
25
24
|
self, context, voice_model: str
|
|
26
|
-
) ->
|
|
25
|
+
) -> tuple[bool, dict[str, object] | None]:
|
|
27
26
|
config = context.config
|
|
28
27
|
|
|
29
28
|
selected_model = config.get("voice_model")
|
|
30
29
|
custom_models = config.get("voice_model_custom", [])
|
|
31
30
|
|
|
32
|
-
allowed_voice_models:
|
|
31
|
+
allowed_voice_models: list[str] = []
|
|
33
32
|
|
|
34
33
|
if selected_model == "custom":
|
|
35
34
|
allowed_voice_models = custom_models or []
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
from typing import Literal
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel, Field
|
|
4
|
-
|
|
5
|
-
# Define the allowed format literals based on the API documentation
|
|
6
|
-
AllowedAudioFormat = Literal["mp3", "opus", "aac", "flac", "wav", "pcm"]
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class VeniceAudioInput(BaseModel):
|
|
10
|
-
"""
|
|
11
|
-
Input schema for Venice AI Text-to-Speech (/audio/speech endpoint).
|
|
12
|
-
Defines parameters controllable by the user when invoking the tool.
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
voice_input: str = Field(
|
|
16
|
-
..., # Ellipsis (...) indicates this field is required
|
|
17
|
-
description="The text to generate audio for. Maximum length is 4096 characters.",
|
|
18
|
-
min_length=1, # As per API docs: Required string length: 1
|
|
19
|
-
max_length=4096, # As per API docs: The maximum length is 4096 characters.
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
voice_model: str = Field(
|
|
23
|
-
description="voice model to used to generate voice from text_to_speech tool."
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
speed:
|
|
27
|
-
default=1.0, # As per API docs: default: 1 (using float for consistency)
|
|
28
|
-
description="The speed of the generated audio. 1.0 is normal speed. Allowed range: 0.25 to 4.0.",
|
|
29
|
-
ge=0.25, # As per API docs: Required range: 0.25 <= x
|
|
30
|
-
le=4.0, # As per API docs: Required range: x <= 4
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
response_format:
|
|
34
|
-
default="mp3", # As per API docs: default: mp3
|
|
35
|
-
description="The desired audio format for the output file.",
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
# --- Note on other API parameters ---
|
|
39
|
-
# 'model': Currently hardcoded to 'tts-kokoro' in VeniceAudioBaseTool._arun. Could be added here if needed.
|
|
40
|
-
# 'voice': Handled by the 'voice_model' attribute of the specific VeniceAudioBaseTool instance. Not typically set via input schema.
|
|
41
|
-
# 'streaming': Currently hardcoded to False in VeniceAudioBaseTool._arun. Could be added here if streaming support is implemented.
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
# Define the allowed format literals based on the API documentation
|
|
6
|
+
AllowedAudioFormat = Literal["mp3", "opus", "aac", "flac", "wav", "pcm"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class VeniceAudioInput(BaseModel):
|
|
10
|
+
"""
|
|
11
|
+
Input schema for Venice AI Text-to-Speech (/audio/speech endpoint).
|
|
12
|
+
Defines parameters controllable by the user when invoking the tool.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
voice_input: str = Field(
|
|
16
|
+
..., # Ellipsis (...) indicates this field is required
|
|
17
|
+
description="The text to generate audio for. Maximum length is 4096 characters.",
|
|
18
|
+
min_length=1, # As per API docs: Required string length: 1
|
|
19
|
+
max_length=4096, # As per API docs: The maximum length is 4096 characters.
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
voice_model: str = Field(
|
|
23
|
+
description="voice model to used to generate voice from text_to_speech tool."
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
speed: float | None = Field(
|
|
27
|
+
default=1.0, # As per API docs: default: 1 (using float for consistency)
|
|
28
|
+
description="The speed of the generated audio. 1.0 is normal speed. Allowed range: 0.25 to 4.0.",
|
|
29
|
+
ge=0.25, # As per API docs: Required range: 0.25 <= x
|
|
30
|
+
le=4.0, # As per API docs: Required range: x <= 4
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
response_format: AllowedAudioFormat | None = Field(
|
|
34
|
+
default="mp3", # As per API docs: default: mp3
|
|
35
|
+
description="The desired audio format for the output file.",
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
# --- Note on other API parameters ---
|
|
39
|
+
# 'model': Currently hardcoded to 'tts-kokoro' in VeniceAudioBaseTool._arun. Could be added here if needed.
|
|
40
|
+
# 'voice': Handled by the 'voice_model' attribute of the specific VeniceAudioBaseTool instance. Not typically set via input schema.
|
|
41
|
+
# 'streaming': Currently hardcoded to False in VeniceAudioBaseTool._arun. Could be added here if streaming support is implemented.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import hashlib
|
|
2
2
|
import json
|
|
3
3
|
import logging
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
import httpx
|
|
7
7
|
from pydantic import BaseModel
|
|
@@ -32,16 +32,16 @@ class VeniceAudioTool(VeniceAudioBaseTool):
|
|
|
32
32
|
"Requires input text. Optional parameters include speed (0.25-4.0, default 1.0) "
|
|
33
33
|
"and audio format (mp3, opus, aac, flac, wav, pcm, default mp3)."
|
|
34
34
|
)
|
|
35
|
-
args_schema:
|
|
35
|
+
args_schema: type[BaseModel] = VeniceAudioInput
|
|
36
36
|
|
|
37
37
|
async def _arun(
|
|
38
38
|
self,
|
|
39
39
|
voice_input: str,
|
|
40
40
|
voice_model: str,
|
|
41
|
-
speed:
|
|
42
|
-
response_format:
|
|
41
|
+
speed: float | None = 1.0,
|
|
42
|
+
response_format: AllowedAudioFormat | None = "mp3",
|
|
43
43
|
**kwargs, # type: ignore
|
|
44
|
-
) ->
|
|
44
|
+
) -> dict[str, Any]:
|
|
45
45
|
"""
|
|
46
46
|
Generates audio using the configured voice model via Venice AI TTS /audio/speech endpoint.
|
|
47
47
|
Stores the resulting audio using the generic S3 helper.
|
|
@@ -92,7 +92,7 @@ class VeniceAudioTool(VeniceAudioBaseTool):
|
|
|
92
92
|
await self.apply_rate_limit(context)
|
|
93
93
|
|
|
94
94
|
# --- Prepare API Call ---
|
|
95
|
-
payload:
|
|
95
|
+
payload: dict[str, Any] = {
|
|
96
96
|
"model": tts_model_id,
|
|
97
97
|
"input": voice_input,
|
|
98
98
|
"voice": voice_model,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import NotRequired,
|
|
2
|
+
from typing import NotRequired, TypedDict
|
|
3
3
|
|
|
4
4
|
from intentkit.skills.base import (
|
|
5
5
|
SkillConfig,
|
|
@@ -61,12 +61,12 @@ class Config(SkillConfig):
|
|
|
61
61
|
enabled: bool # Keep standard enabled flag
|
|
62
62
|
states: SkillStates
|
|
63
63
|
api_key_provider: str = "agent_owner"
|
|
64
|
-
api_key: NotRequired[
|
|
64
|
+
api_key: NotRequired[str | None] # Explicitly Optional
|
|
65
65
|
safe_mode: NotRequired[bool] # Defaults handled in base or usage
|
|
66
66
|
hide_watermark: NotRequired[bool] # Defaults handled in base or usage
|
|
67
67
|
negative_prompt: NotRequired[str] # Defaults handled in base or usage
|
|
68
|
-
rate_limit_number: NotRequired[
|
|
69
|
-
rate_limit_minutes: NotRequired[
|
|
68
|
+
rate_limit_number: NotRequired[int | None] # Explicitly Optional
|
|
69
|
+
rate_limit_minutes: NotRequired[int | None] # Explicitly Optional
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
_SKILL_NAME_TO_CLASS_MAP: dict[str, type[VeniceImageBaseTool]] = {
|
|
@@ -122,7 +122,7 @@ async def get_skills(
|
|
|
122
122
|
def get_venice_image_skill(
|
|
123
123
|
name: str,
|
|
124
124
|
config: "Config",
|
|
125
|
-
) ->
|
|
125
|
+
) -> VeniceImageBaseTool | None:
|
|
126
126
|
"""
|
|
127
127
|
Factory function to get a cached Venice Image skill instance by name.
|
|
128
128
|
|