intentkit 0.8.11__py3-none-any.whl → 0.8.12__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/graph.py +4 -0
- intentkit/abstracts/skill.py +2 -140
- intentkit/clients/twitter.py +35 -28
- intentkit/core/agent.py +2 -374
- intentkit/core/asset.py +63 -16
- intentkit/core/engine.py +16 -7
- intentkit/core/scheduler.py +8 -8
- intentkit/models/agent.py +109 -94
- intentkit/models/agent_schema.json +6 -9
- intentkit/models/llm.csv +15 -12
- intentkit/models/skill.py +38 -40
- intentkit/skills/acolyt/__init__.py +2 -9
- intentkit/skills/acolyt/base.py +2 -5
- intentkit/skills/aixbt/__init__.py +2 -13
- intentkit/skills/aixbt/base.py +0 -4
- intentkit/skills/aixbt/projects.py +1 -2
- intentkit/skills/allora/__init__.py +2 -9
- intentkit/skills/allora/base.py +2 -5
- intentkit/skills/base.py +168 -27
- intentkit/skills/basename/__init__.py +1 -3
- intentkit/skills/carv/__init__.py +116 -121
- intentkit/skills/carv/base.py +184 -185
- intentkit/skills/casino/__init__.py +4 -15
- intentkit/skills/casino/base.py +0 -4
- intentkit/skills/casino/deck_draw.py +4 -6
- intentkit/skills/casino/deck_shuffle.py +5 -4
- intentkit/skills/casino/dice_roll.py +1 -2
- intentkit/skills/cdp/__init__.py +0 -5
- intentkit/skills/cdp/base.py +0 -4
- intentkit/skills/cdp/schema.json +1 -17
- intentkit/skills/chainlist/__init__.py +2 -7
- intentkit/skills/chainlist/base.py +0 -4
- intentkit/skills/common/__init__.py +2 -9
- intentkit/skills/common/base.py +0 -4
- intentkit/skills/cookiefun/__init__.py +6 -9
- intentkit/skills/cookiefun/base.py +0 -4
- intentkit/skills/cryptocompare/__init__.py +7 -24
- intentkit/skills/cryptocompare/base.py +4 -18
- intentkit/skills/cryptocompare/fetch_news.py +1 -1
- intentkit/skills/cryptocompare/fetch_price.py +1 -1
- intentkit/skills/cryptocompare/fetch_top_exchanges.py +1 -1
- intentkit/skills/cryptocompare/fetch_top_market_cap.py +1 -1
- intentkit/skills/cryptocompare/fetch_top_volume.py +1 -1
- intentkit/skills/cryptocompare/fetch_trading_signals.py +1 -1
- intentkit/skills/cryptopanic/__init__.py +3 -6
- intentkit/skills/cryptopanic/base.py +53 -55
- intentkit/skills/cryptopanic/fetch_crypto_news.py +0 -2
- intentkit/skills/cryptopanic/fetch_crypto_sentiment.py +1 -3
- intentkit/skills/dapplooker/__init__.py +2 -9
- intentkit/skills/dapplooker/base.py +2 -5
- intentkit/skills/defillama/__init__.py +24 -74
- intentkit/skills/defillama/base.py +3 -13
- intentkit/skills/defillama/coins/fetch_batch_historical_prices.py +2 -2
- intentkit/skills/defillama/coins/fetch_block.py +2 -2
- intentkit/skills/defillama/coins/fetch_current_prices.py +2 -2
- intentkit/skills/defillama/coins/fetch_first_price.py +2 -2
- intentkit/skills/defillama/coins/fetch_historical_prices.py +2 -2
- intentkit/skills/defillama/coins/fetch_price_chart.py +2 -2
- intentkit/skills/defillama/coins/fetch_price_percentage.py +2 -2
- intentkit/skills/defillama/fees/fetch_fees_overview.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_chains.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_charts.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_prices.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoins.py +2 -2
- intentkit/skills/defillama/tvl/fetch_chain_historical_tvl.py +2 -2
- intentkit/skills/defillama/tvl/fetch_chains.py +2 -2
- intentkit/skills/defillama/tvl/fetch_historical_tvl.py +2 -2
- intentkit/skills/defillama/tvl/fetch_protocol.py +2 -2
- intentkit/skills/defillama/tvl/fetch_protocol_current_tvl.py +2 -2
- intentkit/skills/defillama/tvl/fetch_protocols.py +2 -2
- intentkit/skills/defillama/volumes/fetch_dex_overview.py +2 -2
- intentkit/skills/defillama/volumes/fetch_dex_summary.py +2 -2
- intentkit/skills/defillama/volumes/fetch_options_overview.py +2 -2
- intentkit/skills/defillama/yields/fetch_pool_chart.py +2 -2
- intentkit/skills/defillama/yields/fetch_pools.py +2 -2
- intentkit/skills/dexscreener/__init__.py +97 -102
- intentkit/skills/dexscreener/base.py +125 -130
- intentkit/skills/dexscreener/get_pair_info.py +2 -3
- intentkit/skills/dexscreener/get_token_pairs.py +2 -3
- intentkit/skills/dexscreener/get_tokens_info.py +2 -3
- intentkit/skills/dexscreener/search_token.py +2 -4
- intentkit/skills/dune_analytics/__init__.py +4 -6
- intentkit/skills/dune_analytics/base.py +50 -52
- intentkit/skills/dune_analytics/fetch_kol_buys.py +0 -2
- intentkit/skills/dune_analytics/fetch_nation_metrics.py +0 -2
- intentkit/skills/elfa/__init__.py +5 -18
- intentkit/skills/elfa/base.py +8 -10
- intentkit/skills/enso/__init__.py +9 -29
- intentkit/skills/enso/base.py +3 -6
- intentkit/skills/enso/networks.py +1 -6
- intentkit/skills/enso/route.py +4 -8
- intentkit/skills/enso/tokens.py +2 -12
- intentkit/skills/erc20/__init__.py +1 -5
- intentkit/skills/erc721/__init__.py +1 -3
- intentkit/skills/firecrawl/__init__.py +5 -18
- intentkit/skills/firecrawl/base.py +2 -5
- intentkit/skills/firecrawl/clear.py +3 -6
- intentkit/skills/firecrawl/crawl.py +10 -9
- intentkit/skills/firecrawl/query.py +3 -1
- intentkit/skills/firecrawl/scrape.py +10 -14
- intentkit/skills/firecrawl/utils.py +39 -31
- intentkit/skills/github/__init__.py +2 -7
- intentkit/skills/github/base.py +0 -4
- intentkit/skills/heurist/__init__.py +8 -27
- intentkit/skills/heurist/base.py +2 -5
- intentkit/skills/heurist/image_generation_animagine_xl.py +5 -5
- intentkit/skills/heurist/image_generation_arthemy_comics.py +5 -5
- intentkit/skills/heurist/image_generation_arthemy_real.py +5 -5
- intentkit/skills/heurist/image_generation_braindance.py +5 -5
- intentkit/skills/heurist/image_generation_cyber_realistic_xl.py +5 -5
- intentkit/skills/heurist/image_generation_flux_1_dev.py +5 -5
- intentkit/skills/heurist/image_generation_sdxl.py +5 -5
- intentkit/skills/http/__init__.py +4 -15
- intentkit/skills/http/base.py +0 -4
- intentkit/skills/lifi/__init__.py +1 -6
- intentkit/skills/lifi/base.py +0 -4
- intentkit/skills/lifi/token_execute.py +1 -4
- intentkit/skills/lifi/token_quote.py +1 -3
- intentkit/skills/moralis/__init__.py +3 -7
- intentkit/skills/moralis/base.py +2 -5
- intentkit/skills/morpho/__init__.py +1 -3
- intentkit/skills/nation/__init__.py +2 -7
- intentkit/skills/nation/base.py +4 -7
- intentkit/skills/openai/__init__.py +5 -18
- intentkit/skills/openai/base.py +8 -10
- intentkit/skills/openai/dalle_image_generation.py +2 -5
- intentkit/skills/openai/gpt_image_generation.py +2 -5
- intentkit/skills/openai/gpt_image_to_image.py +2 -5
- intentkit/skills/openai/image_to_text.py +2 -5
- intentkit/skills/portfolio/__init__.py +11 -35
- intentkit/skills/portfolio/base.py +2 -5
- intentkit/skills/pyth/__init__.py +1 -5
- intentkit/skills/slack/__init__.py +5 -17
- intentkit/skills/slack/base.py +0 -4
- intentkit/skills/supabase/__init__.py +7 -23
- intentkit/skills/supabase/base.py +0 -4
- intentkit/skills/superfluid/__init__.py +1 -3
- intentkit/skills/system/__init__.py +7 -24
- intentkit/skills/system/add_autonomous_task.py +2 -2
- intentkit/skills/system/delete_autonomous_task.py +2 -2
- intentkit/skills/system/edit_autonomous_task.py +2 -4
- intentkit/skills/system/list_autonomous_tasks.py +2 -2
- intentkit/skills/system/read_agent_api_key.py +6 -4
- intentkit/skills/system/regenerate_agent_api_key.py +6 -4
- intentkit/skills/tavily/__init__.py +3 -12
- intentkit/skills/tavily/base.py +2 -5
- intentkit/skills/tavily/tavily_extract.py +1 -2
- intentkit/skills/tavily/tavily_search.py +3 -3
- intentkit/skills/token/__init__.py +5 -10
- intentkit/skills/token/base.py +2 -6
- intentkit/skills/twitter/__init__.py +11 -35
- intentkit/skills/twitter/base.py +18 -29
- intentkit/skills/twitter/follow_user.py +1 -4
- intentkit/skills/twitter/get_mentions.py +2 -8
- intentkit/skills/twitter/get_timeline.py +3 -10
- intentkit/skills/twitter/get_user_by_username.py +1 -4
- intentkit/skills/twitter/get_user_tweets.py +3 -10
- intentkit/skills/twitter/like_tweet.py +1 -4
- intentkit/skills/twitter/post_tweet.py +3 -5
- intentkit/skills/twitter/reply_tweet.py +3 -5
- intentkit/skills/twitter/retweet.py +1 -4
- intentkit/skills/twitter/search_tweets.py +3 -10
- intentkit/skills/unrealspeech/__init__.py +2 -7
- intentkit/skills/unrealspeech/base.py +0 -4
- intentkit/skills/venice_audio/__init__.py +99 -106
- intentkit/skills/venice_audio/base.py +118 -121
- intentkit/skills/venice_audio/venice_audio.py +1 -5
- intentkit/skills/venice_image/__init__.py +147 -154
- intentkit/skills/venice_image/base.py +185 -192
- intentkit/skills/web_scraper/__init__.py +5 -18
- intentkit/skills/web_scraper/base.py +20 -4
- intentkit/skills/web_scraper/document_indexer.py +6 -4
- intentkit/skills/web_scraper/scrape_and_index.py +11 -10
- intentkit/skills/web_scraper/utils.py +38 -38
- intentkit/skills/web_scraper/website_indexer.py +7 -8
- intentkit/skills/weth/__init__.py +1 -5
- intentkit/skills/wow/__init__.py +1 -5
- intentkit/skills/xmtp/__init__.py +4 -15
- {intentkit-0.8.11.dist-info → intentkit-0.8.12.dist-info}/METADATA +1 -1
- {intentkit-0.8.11.dist-info → intentkit-0.8.12.dist-info}/RECORD +183 -183
- {intentkit-0.8.11.dist-info → intentkit-0.8.12.dist-info}/WHEEL +0 -0
- {intentkit-0.8.11.dist-info → intentkit-0.8.12.dist-info}/licenses/LICENSE +0 -0
|
@@ -17,7 +17,8 @@ from langchain_core.documents import Document
|
|
|
17
17
|
from langchain_openai import OpenAIEmbeddings
|
|
18
18
|
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
|
19
19
|
|
|
20
|
-
from intentkit.
|
|
20
|
+
from intentkit.config.config import config
|
|
21
|
+
from intentkit.models.skill import AgentSkillData, AgentSkillDataCreate
|
|
21
22
|
|
|
22
23
|
logger = logging.getLogger(__name__)
|
|
23
24
|
|
|
@@ -62,12 +63,20 @@ METADATA_KEY_PREFIX = "indexed_urls"
|
|
|
62
63
|
class VectorStoreManager:
|
|
63
64
|
"""Manages vector store operations including creation, saving, loading, and merging."""
|
|
64
65
|
|
|
65
|
-
def __init__(self,
|
|
66
|
-
self.
|
|
66
|
+
def __init__(self, embedding_api_key: Optional[str] = None):
|
|
67
|
+
self._embedding_api_key = embedding_api_key
|
|
68
|
+
|
|
69
|
+
def _resolve_api_key(self) -> str:
|
|
70
|
+
"""Resolve the OpenAI API key to use for embeddings."""
|
|
71
|
+
if self._embedding_api_key:
|
|
72
|
+
return self._embedding_api_key
|
|
73
|
+
if config.openai_api_key:
|
|
74
|
+
return config.openai_api_key
|
|
75
|
+
raise ValueError("OpenAI API key is not configured")
|
|
67
76
|
|
|
68
77
|
def create_embeddings(self) -> OpenAIEmbeddings:
|
|
69
|
-
"""Create OpenAI embeddings using
|
|
70
|
-
api_key = self.
|
|
78
|
+
"""Create OpenAI embeddings using the resolved API key."""
|
|
79
|
+
api_key = self._resolve_api_key()
|
|
71
80
|
return OpenAIEmbeddings(api_key=api_key)
|
|
72
81
|
|
|
73
82
|
def get_storage_keys(self, agent_id: str) -> Tuple[str, str]:
|
|
@@ -113,9 +122,7 @@ class VectorStoreManager:
|
|
|
113
122
|
async def get_existing_vector_store(self, agent_id: str) -> Optional[Dict]:
|
|
114
123
|
"""Get existing vector store data if it exists."""
|
|
115
124
|
vector_store_key, _ = self.get_storage_keys(agent_id)
|
|
116
|
-
return await
|
|
117
|
-
agent_id, "web_scraper", vector_store_key
|
|
118
|
-
)
|
|
125
|
+
return await AgentSkillData.get(agent_id, "web_scraper", vector_store_key)
|
|
119
126
|
|
|
120
127
|
async def merge_with_existing(
|
|
121
128
|
self,
|
|
@@ -184,12 +191,13 @@ class VectorStoreManager:
|
|
|
184
191
|
|
|
185
192
|
try:
|
|
186
193
|
# Save to storage
|
|
187
|
-
|
|
194
|
+
skill_data = AgentSkillDataCreate(
|
|
188
195
|
agent_id=agent_id,
|
|
189
196
|
skill="web_scraper",
|
|
190
197
|
key=vector_store_key,
|
|
191
198
|
data=storage_data,
|
|
192
199
|
)
|
|
200
|
+
await skill_data.save()
|
|
193
201
|
|
|
194
202
|
logger.info(f"[{agent_id}] Successfully saved vector store")
|
|
195
203
|
|
|
@@ -226,7 +234,8 @@ class VectorStoreManager:
|
|
|
226
234
|
|
|
227
235
|
return total_size
|
|
228
236
|
|
|
229
|
-
|
|
237
|
+
@staticmethod
|
|
238
|
+
def format_size(size_bytes: int) -> str:
|
|
230
239
|
"""Format size in bytes to human readable format."""
|
|
231
240
|
if size_bytes < 1024:
|
|
232
241
|
return f"{size_bytes} B"
|
|
@@ -312,19 +321,13 @@ class DocumentProcessor:
|
|
|
312
321
|
class MetadataManager:
|
|
313
322
|
"""Manages metadata for indexed content."""
|
|
314
323
|
|
|
315
|
-
def __init__(self,
|
|
316
|
-
self.
|
|
324
|
+
def __init__(self, vector_manager: VectorStoreManager):
|
|
325
|
+
self._vector_manager = vector_manager
|
|
317
326
|
|
|
318
327
|
async def get_existing_metadata(self, agent_id: str) -> Dict:
|
|
319
328
|
"""Get existing metadata for an agent."""
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
return (
|
|
323
|
-
await self.skill_store.get_agent_skill_data(
|
|
324
|
-
agent_id, "web_scraper", metadata_key
|
|
325
|
-
)
|
|
326
|
-
or {}
|
|
327
|
-
)
|
|
329
|
+
_, metadata_key = self._vector_manager.get_storage_keys(agent_id)
|
|
330
|
+
return await AgentSkillData.get(agent_id, "web_scraper", metadata_key) or {}
|
|
328
331
|
|
|
329
332
|
def create_url_metadata(
|
|
330
333
|
self,
|
|
@@ -381,8 +384,7 @@ class MetadataManager:
|
|
|
381
384
|
|
|
382
385
|
async def update_metadata(self, agent_id: str, new_metadata: Dict) -> None:
|
|
383
386
|
"""Update metadata for an agent."""
|
|
384
|
-
|
|
385
|
-
_, metadata_key = vs_manager.get_storage_keys(agent_id)
|
|
387
|
+
_, metadata_key = self._vector_manager.get_storage_keys(agent_id)
|
|
386
388
|
|
|
387
389
|
# Get existing metadata
|
|
388
390
|
existing_metadata = await self.get_existing_metadata(agent_id)
|
|
@@ -391,12 +393,13 @@ class MetadataManager:
|
|
|
391
393
|
existing_metadata.update(new_metadata)
|
|
392
394
|
|
|
393
395
|
# Save updated metadata
|
|
394
|
-
|
|
396
|
+
skill_data = AgentSkillDataCreate(
|
|
395
397
|
agent_id=agent_id,
|
|
396
398
|
skill="web_scraper",
|
|
397
399
|
key=metadata_key,
|
|
398
400
|
data=existing_metadata,
|
|
399
401
|
)
|
|
402
|
+
await skill_data.save()
|
|
400
403
|
|
|
401
404
|
|
|
402
405
|
class ResponseFormatter:
|
|
@@ -457,9 +460,8 @@ class ResponseFormatter:
|
|
|
457
460
|
|
|
458
461
|
# Add size information
|
|
459
462
|
if current_size_bytes > 0:
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
max_size = vs_manager.format_size(MAX_CONTENT_SIZE_BYTES)
|
|
463
|
+
formatted_size = VectorStoreManager.format_size(current_size_bytes)
|
|
464
|
+
max_size = VectorStoreManager.format_size(MAX_CONTENT_SIZE_BYTES)
|
|
463
465
|
response_parts.append(
|
|
464
466
|
f"Current storage size: {formatted_size} / {max_size}"
|
|
465
467
|
)
|
|
@@ -481,7 +483,7 @@ class ResponseFormatter:
|
|
|
481
483
|
async def scrape_and_index_urls(
|
|
482
484
|
urls: List[str],
|
|
483
485
|
agent_id: str,
|
|
484
|
-
|
|
486
|
+
vector_manager: VectorStoreManager,
|
|
485
487
|
chunk_size: int = DEFAULT_CHUNK_SIZE,
|
|
486
488
|
chunk_overlap: int = DEFAULT_CHUNK_OVERLAP,
|
|
487
489
|
requests_per_second: int = DEFAULT_REQUESTS_PER_SECOND,
|
|
@@ -492,7 +494,7 @@ async def scrape_and_index_urls(
|
|
|
492
494
|
Args:
|
|
493
495
|
urls: List of URLs to scrape
|
|
494
496
|
agent_id: Agent identifier for storage
|
|
495
|
-
|
|
497
|
+
vector_manager: Manager for vector store operations
|
|
496
498
|
chunk_size: Size of text chunks
|
|
497
499
|
chunk_overlap: Overlap between chunks
|
|
498
500
|
requests_per_second: Rate limiting for requests
|
|
@@ -520,16 +522,15 @@ async def scrape_and_index_urls(
|
|
|
520
522
|
return 0, False, []
|
|
521
523
|
|
|
522
524
|
# Check existing content size
|
|
523
|
-
|
|
524
|
-
current_size = await vs_manager.get_content_size(agent_id)
|
|
525
|
+
current_size = await vector_manager.get_content_size(agent_id)
|
|
525
526
|
|
|
526
527
|
logger.info(
|
|
527
|
-
f"[{agent_id}] Current storage size: {
|
|
528
|
+
f"[{agent_id}] Current storage size: {VectorStoreManager.format_size(current_size)}"
|
|
528
529
|
)
|
|
529
530
|
|
|
530
531
|
if current_size >= MAX_CONTENT_SIZE_BYTES:
|
|
531
532
|
logger.warning(
|
|
532
|
-
f"[{agent_id}] Storage limit already reached: {
|
|
533
|
+
f"[{agent_id}] Storage limit already reached: {VectorStoreManager.format_size(current_size)}"
|
|
533
534
|
)
|
|
534
535
|
return 0, False, []
|
|
535
536
|
|
|
@@ -599,7 +600,7 @@ async def scrape_and_index_urls(
|
|
|
599
600
|
|
|
600
601
|
# Process and index this URL's content
|
|
601
602
|
chunks, merged = await index_documents(
|
|
602
|
-
documents, agent_id,
|
|
603
|
+
documents, agent_id, vector_manager, chunk_size, chunk_overlap
|
|
603
604
|
)
|
|
604
605
|
|
|
605
606
|
if chunks > 0:
|
|
@@ -609,7 +610,7 @@ async def scrape_and_index_urls(
|
|
|
609
610
|
current_size += content_size
|
|
610
611
|
|
|
611
612
|
logger.info(
|
|
612
|
-
f"[{agent_id}] Processed {url}: {chunks} chunks, current size: {
|
|
613
|
+
f"[{agent_id}] Processed {url}: {chunks} chunks, current size: {VectorStoreManager.format_size(current_size)}"
|
|
613
614
|
)
|
|
614
615
|
|
|
615
616
|
# Add delay for rate limiting
|
|
@@ -637,7 +638,7 @@ async def scrape_and_index_urls(
|
|
|
637
638
|
async def index_documents(
|
|
638
639
|
documents: List[Document],
|
|
639
640
|
agent_id: str,
|
|
640
|
-
|
|
641
|
+
vector_manager: VectorStoreManager,
|
|
641
642
|
chunk_size: int = DEFAULT_CHUNK_SIZE,
|
|
642
643
|
chunk_overlap: int = DEFAULT_CHUNK_OVERLAP,
|
|
643
644
|
) -> Tuple[int, bool]:
|
|
@@ -654,13 +655,12 @@ async def index_documents(
|
|
|
654
655
|
raise ValueError("No content could be processed into chunks")
|
|
655
656
|
|
|
656
657
|
# Handle vector store
|
|
657
|
-
|
|
658
|
-
vector_store, was_merged = await vs_manager.merge_with_existing(
|
|
658
|
+
vector_store, was_merged = await vector_manager.merge_with_existing(
|
|
659
659
|
split_docs, agent_id, chunk_size, chunk_overlap
|
|
660
660
|
)
|
|
661
661
|
|
|
662
662
|
# Save vector store
|
|
663
|
-
await
|
|
663
|
+
await vector_manager.save_vector_store(
|
|
664
664
|
vector_store, agent_id, chunk_size, chunk_overlap
|
|
665
665
|
)
|
|
666
666
|
|
|
@@ -250,10 +250,7 @@ Extract the URLs now:"""
|
|
|
250
250
|
"""Call OpenAI GPT-4o-mini to extract URLs from sitemap content."""
|
|
251
251
|
try:
|
|
252
252
|
# Get OpenAI API key using the standard pattern
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
temp_tool = OpenAIBaseTool(skill_store=self.skill_store)
|
|
256
|
-
api_key = temp_tool.get_api_key()
|
|
253
|
+
api_key = self.get_openai_api_key()
|
|
257
254
|
|
|
258
255
|
# Initialize OpenAI client
|
|
259
256
|
client = openai.AsyncOpenAI(api_key=api_key)
|
|
@@ -385,9 +382,12 @@ Extract the URLs now:"""
|
|
|
385
382
|
f"[{agent_id}] Extracted {len(unique_urls)} URLs from sitemaps. Scraping and indexing..."
|
|
386
383
|
)
|
|
387
384
|
|
|
385
|
+
embedding_api_key = self.get_openai_api_key()
|
|
386
|
+
vector_manager = VectorStoreManager(embedding_api_key)
|
|
387
|
+
|
|
388
388
|
# Use the utility function to scrape and index URLs directly
|
|
389
389
|
total_chunks, was_merged, valid_urls = await scrape_and_index_urls(
|
|
390
|
-
unique_urls, agent_id,
|
|
390
|
+
unique_urls, agent_id, vector_manager, chunk_size, chunk_overlap
|
|
391
391
|
)
|
|
392
392
|
|
|
393
393
|
if total_chunks == 0:
|
|
@@ -397,12 +397,11 @@ Extract the URLs now:"""
|
|
|
397
397
|
return f"Error: No content could be extracted from the discovered URLs. Found sitemaps: {', '.join(found_sitemaps)}"
|
|
398
398
|
|
|
399
399
|
# Get current storage size for response
|
|
400
|
-
|
|
401
|
-
current_size = await vs_manager.get_content_size(agent_id)
|
|
400
|
+
current_size = await vector_manager.get_content_size(agent_id)
|
|
402
401
|
size_limit_reached = len(valid_urls) < len(unique_urls)
|
|
403
402
|
|
|
404
403
|
# Update metadata
|
|
405
|
-
metadata_manager = MetadataManager(
|
|
404
|
+
metadata_manager = MetadataManager(vector_manager)
|
|
406
405
|
new_metadata = metadata_manager.create_url_metadata(
|
|
407
406
|
valid_urls, [], "website_indexer"
|
|
408
407
|
)
|
|
@@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Optional, TypedDict
|
|
|
4
4
|
|
|
5
5
|
from coinbase_agentkit import weth_action_provider
|
|
6
6
|
|
|
7
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
8
7
|
from intentkit.skills.base import (
|
|
9
8
|
SkillConfig,
|
|
10
9
|
SkillState,
|
|
@@ -30,7 +29,6 @@ class Config(SkillConfig):
|
|
|
30
29
|
async def get_skills(
|
|
31
30
|
config: "Config",
|
|
32
31
|
is_private: bool,
|
|
33
|
-
store: SkillStoreABC,
|
|
34
32
|
agent_id: str,
|
|
35
33
|
agent: Optional["Agent"] = None,
|
|
36
34
|
**_,
|
|
@@ -44,9 +42,7 @@ async def get_skills(
|
|
|
44
42
|
if state == "public" or (state == "private" and is_private):
|
|
45
43
|
available_skills.append(skill_name)
|
|
46
44
|
|
|
47
|
-
actions = await get_agentkit_actions(
|
|
48
|
-
agent_id, store, [weth_action_provider], agent=agent
|
|
49
|
-
)
|
|
45
|
+
actions = await get_agentkit_actions(agent_id, [weth_action_provider], agent=agent)
|
|
50
46
|
tools: list[WethBaseTool] = []
|
|
51
47
|
for skill in available_skills:
|
|
52
48
|
for action in actions:
|
intentkit/skills/wow/__init__.py
CHANGED
|
@@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Optional, TypedDict
|
|
|
4
4
|
|
|
5
5
|
from coinbase_agentkit import wow_action_provider
|
|
6
6
|
|
|
7
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
8
7
|
from intentkit.skills.base import (
|
|
9
8
|
SkillConfig,
|
|
10
9
|
SkillState,
|
|
@@ -32,7 +31,6 @@ class Config(SkillConfig):
|
|
|
32
31
|
async def get_skills(
|
|
33
32
|
config: "Config",
|
|
34
33
|
is_private: bool,
|
|
35
|
-
store: SkillStoreABC,
|
|
36
34
|
agent_id: str,
|
|
37
35
|
agent: Optional["Agent"] = None,
|
|
38
36
|
**_,
|
|
@@ -46,9 +44,7 @@ async def get_skills(
|
|
|
46
44
|
if state == "public" or (state == "private" and is_private):
|
|
47
45
|
available_skills.append(skill_name)
|
|
48
46
|
|
|
49
|
-
actions = await get_agentkit_actions(
|
|
50
|
-
agent_id, store, [wow_action_provider], agent=agent
|
|
51
|
-
)
|
|
47
|
+
actions = await get_agentkit_actions(agent_id, [wow_action_provider], agent=agent)
|
|
52
48
|
tools: list[WowBaseTool] = []
|
|
53
49
|
for skill in available_skills:
|
|
54
50
|
for action in actions:
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import TypedDict
|
|
5
5
|
|
|
6
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
7
6
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
8
7
|
from intentkit.skills.xmtp.base import XmtpBaseTool
|
|
9
8
|
from intentkit.skills.xmtp.price import XmtpGetSwapPrice
|
|
@@ -31,7 +30,6 @@ class Config(SkillConfig):
|
|
|
31
30
|
async def get_skills(
|
|
32
31
|
config: "Config",
|
|
33
32
|
is_private: bool,
|
|
34
|
-
store: SkillStoreABC,
|
|
35
33
|
**_,
|
|
36
34
|
) -> list[XmtpBaseTool]:
|
|
37
35
|
"""Get all XMTP skills.
|
|
@@ -39,7 +37,6 @@ async def get_skills(
|
|
|
39
37
|
Args:
|
|
40
38
|
config: The configuration for XMTP skills.
|
|
41
39
|
is_private: Whether to include private skills.
|
|
42
|
-
store: The skill store for persisting data.
|
|
43
40
|
|
|
44
41
|
Returns:
|
|
45
42
|
A list of XMTP skills.
|
|
@@ -56,7 +53,7 @@ async def get_skills(
|
|
|
56
53
|
# Get each skill using the cached getter
|
|
57
54
|
result = []
|
|
58
55
|
for name in available_skills:
|
|
59
|
-
skill = get_xmtp_skill(name
|
|
56
|
+
skill = get_xmtp_skill(name)
|
|
60
57
|
if skill:
|
|
61
58
|
result.append(skill)
|
|
62
59
|
return result
|
|
@@ -64,34 +61,26 @@ async def get_skills(
|
|
|
64
61
|
|
|
65
62
|
def get_xmtp_skill(
|
|
66
63
|
name: str,
|
|
67
|
-
store: SkillStoreABC,
|
|
68
64
|
) -> XmtpBaseTool:
|
|
69
65
|
"""Get an XMTP skill by name.
|
|
70
66
|
|
|
71
67
|
Args:
|
|
72
68
|
name: The name of the skill to get
|
|
73
|
-
store: The skill store for persisting data
|
|
74
69
|
|
|
75
70
|
Returns:
|
|
76
71
|
The requested XMTP skill
|
|
77
72
|
"""
|
|
78
73
|
if name == "xmtp_transfer":
|
|
79
74
|
if name not in _cache:
|
|
80
|
-
_cache[name] = XmtpTransfer(
|
|
81
|
-
skill_store=store,
|
|
82
|
-
)
|
|
75
|
+
_cache[name] = XmtpTransfer()
|
|
83
76
|
return _cache[name]
|
|
84
77
|
elif name == "xmtp_swap":
|
|
85
78
|
if name not in _cache:
|
|
86
|
-
_cache[name] = XmtpSwap(
|
|
87
|
-
skill_store=store,
|
|
88
|
-
)
|
|
79
|
+
_cache[name] = XmtpSwap()
|
|
89
80
|
return _cache[name]
|
|
90
81
|
elif name == "xmtp_get_swap_price":
|
|
91
82
|
if name not in _cache:
|
|
92
|
-
_cache[name] = XmtpGetSwapPrice(
|
|
93
|
-
skill_store=store,
|
|
94
|
-
)
|
|
83
|
+
_cache[name] = XmtpGetSwapPrice()
|
|
95
84
|
return _cache[name]
|
|
96
85
|
else:
|
|
97
86
|
logger.warning(f"Unknown XMTP skill: {name}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: intentkit
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.12
|
|
4
4
|
Summary: Intent-based AI Agent Platform - Core Package
|
|
5
5
|
Project-URL: Homepage, https://github.com/crestalnetwork/intentkit
|
|
6
6
|
Project-URL: Repository, https://github.com/crestalnetwork/intentkit
|