intentkit 0.8.12.dev2__py3-none-any.whl → 0.8.12.dev3__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/skill.py +2 -59
- intentkit/clients/twitter.py +35 -28
- intentkit/core/agent.py +2 -279
- intentkit/core/engine.py +2 -3
- intentkit/models/agent.py +109 -89
- intentkit/models/agent_schema.json +4 -2
- 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 +101 -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 +1 -2
- intentkit/skills/casino/deck_shuffle.py +1 -2
- intentkit/skills/casino/dice_roll.py +1 -2
- intentkit/skills/cdp/__init__.py +0 -4
- intentkit/skills/cdp/base.py +0 -4
- 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 +0 -5
- 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 +0 -4
- 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/route.py +1 -3
- 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/crawl.py +10 -9
- intentkit/skills/firecrawl/query.py +3 -1
- intentkit/skills/firecrawl/scrape.py +8 -10
- intentkit/skills/firecrawl/utils.py +25 -26
- 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 +14 -16
- intentkit/skills/twitter/follow_user.py +0 -1
- intentkit/skills/twitter/get_mentions.py +0 -1
- intentkit/skills/twitter/get_timeline.py +0 -1
- intentkit/skills/twitter/get_user_by_username.py +0 -1
- intentkit/skills/twitter/get_user_tweets.py +0 -1
- intentkit/skills/twitter/like_tweet.py +0 -1
- intentkit/skills/twitter/post_tweet.py +2 -2
- intentkit/skills/twitter/reply_tweet.py +2 -2
- intentkit/skills/twitter/retweet.py +0 -1
- intentkit/skills/twitter/search_tweets.py +0 -1
- 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 -8
- intentkit/skills/web_scraper/utils.py +31 -27
- 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.12.dev2.dist-info → intentkit-0.8.12.dev3.dist-info}/METADATA +1 -1
- {intentkit-0.8.12.dev2.dist-info → intentkit-0.8.12.dev3.dist-info}/RECORD +168 -168
- {intentkit-0.8.12.dev2.dist-info → intentkit-0.8.12.dev3.dist-info}/WHEEL +0 -0
- {intentkit-0.8.12.dev2.dist-info → intentkit-0.8.12.dev3.dist-info}/licenses/LICENSE +0 -0
intentkit/models/agent.py
CHANGED
|
@@ -436,21 +436,13 @@ class AgentCore(BaseModel):
|
|
|
436
436
|
title="Name",
|
|
437
437
|
description="Display name of the agent",
|
|
438
438
|
max_length=50,
|
|
439
|
-
json_schema_extra={
|
|
440
|
-
"x-group": "basic",
|
|
441
|
-
"x-placeholder": "Name your agent",
|
|
442
|
-
},
|
|
443
439
|
),
|
|
444
440
|
]
|
|
445
441
|
picture: Annotated[
|
|
446
442
|
Optional[str],
|
|
447
443
|
PydanticField(
|
|
448
444
|
default=None,
|
|
449
|
-
description="
|
|
450
|
-
json_schema_extra={
|
|
451
|
-
"x-group": "experimental",
|
|
452
|
-
"x-placeholder": "Upload a picture of your agent",
|
|
453
|
-
},
|
|
445
|
+
description="Avatar of the agent",
|
|
454
446
|
),
|
|
455
447
|
]
|
|
456
448
|
purpose: Annotated[
|
|
@@ -459,14 +451,6 @@ class AgentCore(BaseModel):
|
|
|
459
451
|
default=None,
|
|
460
452
|
description="Purpose or role of the agent",
|
|
461
453
|
max_length=20000,
|
|
462
|
-
json_schema_extra={
|
|
463
|
-
"x-group": "basic",
|
|
464
|
-
"x-placeholder": "Enter agent purpose, it will be a part of the system prompt",
|
|
465
|
-
"pattern": "^(([^#].*)|#[^# ].*|#{3,}[ ].*|$)(\n(([^#].*)|#[^# ].*|#{3,}[ ].*|$))*$",
|
|
466
|
-
"errorMessage": {
|
|
467
|
-
"pattern": "Level 1 and 2 headings (# and ##) are not allowed. Please use level 3+ headings (###, ####, etc.) instead."
|
|
468
|
-
},
|
|
469
|
-
},
|
|
470
454
|
),
|
|
471
455
|
]
|
|
472
456
|
personality: Annotated[
|
|
@@ -475,14 +459,6 @@ class AgentCore(BaseModel):
|
|
|
475
459
|
default=None,
|
|
476
460
|
description="Personality traits of the agent",
|
|
477
461
|
max_length=20000,
|
|
478
|
-
json_schema_extra={
|
|
479
|
-
"x-group": "basic",
|
|
480
|
-
"x-placeholder": "Enter agent personality, it will be a part of the system prompt",
|
|
481
|
-
"pattern": "^(([^#].*)|#[^# ].*|#{3,}[ ].*|$)(\n(([^#].*)|#[^# ].*|#{3,}[ ].*|$))*$",
|
|
482
|
-
"errorMessage": {
|
|
483
|
-
"pattern": "Level 1 and 2 headings (# and ##) are not allowed. Please use level 3+ headings (###, ####, etc.) instead."
|
|
484
|
-
},
|
|
485
|
-
},
|
|
486
462
|
),
|
|
487
463
|
]
|
|
488
464
|
principles: Annotated[
|
|
@@ -491,14 +467,6 @@ class AgentCore(BaseModel):
|
|
|
491
467
|
default=None,
|
|
492
468
|
description="Principles or values of the agent",
|
|
493
469
|
max_length=20000,
|
|
494
|
-
json_schema_extra={
|
|
495
|
-
"x-group": "basic",
|
|
496
|
-
"x-placeholder": "Enter agent principles, it will be a part of the system prompt",
|
|
497
|
-
"pattern": "^(([^#].*)|#[^# ].*|#{3,}[ ].*|$)(\n(([^#].*)|#[^# ].*|#{3,}[ ].*|$))*$",
|
|
498
|
-
"errorMessage": {
|
|
499
|
-
"pattern": "Level 1 and 2 headings (# and ##) are not allowed. Please use level 3+ headings (###, ####, etc.) instead."
|
|
500
|
-
},
|
|
501
|
-
},
|
|
502
470
|
),
|
|
503
471
|
]
|
|
504
472
|
# AI part
|
|
@@ -506,10 +474,7 @@ class AgentCore(BaseModel):
|
|
|
506
474
|
str,
|
|
507
475
|
PydanticField(
|
|
508
476
|
default="gpt-5-mini",
|
|
509
|
-
description="
|
|
510
|
-
json_schema_extra={
|
|
511
|
-
"x-group": "ai",
|
|
512
|
-
},
|
|
477
|
+
description="LLM of the agent",
|
|
513
478
|
),
|
|
514
479
|
]
|
|
515
480
|
prompt: Annotated[
|
|
@@ -518,13 +483,6 @@ class AgentCore(BaseModel):
|
|
|
518
483
|
default=None,
|
|
519
484
|
description="Base system prompt that defines the agent's behavior and capabilities",
|
|
520
485
|
max_length=20000,
|
|
521
|
-
json_schema_extra={
|
|
522
|
-
"x-group": "ai",
|
|
523
|
-
"pattern": "^(([^#].*)|#[^# ].*|#{3,}[ ].*|$)(\n(([^#].*)|#[^# ].*|#{3,}[ ].*|$))*$",
|
|
524
|
-
"errorMessage": {
|
|
525
|
-
"pattern": "Level 1 and 2 headings (# and ##) are not allowed. Please use level 3+ headings (###, ####, etc.) instead."
|
|
526
|
-
},
|
|
527
|
-
},
|
|
528
486
|
),
|
|
529
487
|
]
|
|
530
488
|
prompt_append: Annotated[
|
|
@@ -533,13 +491,6 @@ class AgentCore(BaseModel):
|
|
|
533
491
|
default=None,
|
|
534
492
|
description="Additional system prompt that has higher priority than the base prompt",
|
|
535
493
|
max_length=20000,
|
|
536
|
-
json_schema_extra={
|
|
537
|
-
"x-group": "ai",
|
|
538
|
-
"pattern": "^(([^#].*)|#[^# ].*|#{3,}[ ].*|$)(\n(([^#].*)|#[^# ].*|#{3,}[ ].*|$))*$",
|
|
539
|
-
"errorMessage": {
|
|
540
|
-
"pattern": "Level 1 and 2 headings (# and ##) are not allowed. Please use level 3+ headings (###, ####, etc.) instead."
|
|
541
|
-
},
|
|
542
|
-
},
|
|
543
494
|
),
|
|
544
495
|
]
|
|
545
496
|
temperature: Annotated[
|
|
@@ -549,9 +500,6 @@ class AgentCore(BaseModel):
|
|
|
549
500
|
description="The randomness of the generated results is such that the higher the number, the more creative the results will be. However, this also makes them wilder and increases the likelihood of errors. For creative tasks, you can adjust it to above 1, but for rigorous tasks, such as quantitative trading, it's advisable to set it lower, around 0.2. (0.0~2.0)",
|
|
550
501
|
ge=0.0,
|
|
551
502
|
le=2.0,
|
|
552
|
-
json_schema_extra={
|
|
553
|
-
"x-group": "ai",
|
|
554
|
-
},
|
|
555
503
|
),
|
|
556
504
|
]
|
|
557
505
|
frequency_penalty: Annotated[
|
|
@@ -561,9 +509,6 @@ class AgentCore(BaseModel):
|
|
|
561
509
|
description="The frequency penalty is a measure of how much the AI is allowed to repeat itself. A lower value means the AI is more likely to repeat previous responses, while a higher value means the AI is more likely to generate new content. For creative tasks, you can adjust it to 1 or a bit higher. (-2.0~2.0)",
|
|
562
510
|
ge=-2.0,
|
|
563
511
|
le=2.0,
|
|
564
|
-
json_schema_extra={
|
|
565
|
-
"x-group": "ai",
|
|
566
|
-
},
|
|
567
512
|
),
|
|
568
513
|
]
|
|
569
514
|
presence_penalty: Annotated[
|
|
@@ -573,9 +518,6 @@ class AgentCore(BaseModel):
|
|
|
573
518
|
description="The presence penalty is a measure of how much the AI is allowed to deviate from the topic. A higher value means the AI is more likely to deviate from the topic, while a lower value means the AI is more likely to follow the topic. For creative tasks, you can adjust it to 1 or a bit higher. (-2.0~2.0)",
|
|
574
519
|
ge=-2.0,
|
|
575
520
|
le=2.0,
|
|
576
|
-
json_schema_extra={
|
|
577
|
-
"x-group": "ai",
|
|
578
|
-
},
|
|
579
521
|
),
|
|
580
522
|
]
|
|
581
523
|
wallet_provider: Annotated[
|
|
@@ -583,9 +525,6 @@ class AgentCore(BaseModel):
|
|
|
583
525
|
PydanticField(
|
|
584
526
|
default=None,
|
|
585
527
|
description="Provider of the agent's wallet",
|
|
586
|
-
json_schema_extra={
|
|
587
|
-
"x-group": "onchain",
|
|
588
|
-
},
|
|
589
528
|
),
|
|
590
529
|
]
|
|
591
530
|
readonly_wallet_address: Annotated[
|
|
@@ -614,9 +553,6 @@ class AgentCore(BaseModel):
|
|
|
614
553
|
PydanticField(
|
|
615
554
|
default="base-mainnet",
|
|
616
555
|
description="Network identifier",
|
|
617
|
-
json_schema_extra={
|
|
618
|
-
"x-group": "onchain",
|
|
619
|
-
},
|
|
620
556
|
),
|
|
621
557
|
]
|
|
622
558
|
skills: Annotated[
|
|
@@ -624,10 +560,6 @@ class AgentCore(BaseModel):
|
|
|
624
560
|
PydanticField(
|
|
625
561
|
default=None,
|
|
626
562
|
description="Dict of skills and their corresponding configurations",
|
|
627
|
-
json_schema_extra={
|
|
628
|
-
"x-group": "skills",
|
|
629
|
-
"x-inline": True,
|
|
630
|
-
},
|
|
631
563
|
),
|
|
632
564
|
]
|
|
633
565
|
|
|
@@ -674,9 +606,6 @@ class AgentUserInput(AgentCore):
|
|
|
674
606
|
PydanticField(
|
|
675
607
|
default="trim",
|
|
676
608
|
description="Strategy for managing short-term memory when context limit is reached. 'trim' removes oldest messages, 'summarize' creates summaries.",
|
|
677
|
-
json_schema_extra={
|
|
678
|
-
"x-group": "ai",
|
|
679
|
-
},
|
|
680
609
|
),
|
|
681
610
|
]
|
|
682
611
|
# autonomous mode
|
|
@@ -698,10 +627,6 @@ class AgentUserInput(AgentCore):
|
|
|
698
627
|
" prompt: |-\n"
|
|
699
628
|
" Say hi [sequence], use number for sequence.\n"
|
|
700
629
|
),
|
|
701
|
-
json_schema_extra={
|
|
702
|
-
"x-group": "autonomous",
|
|
703
|
-
"x-inline": True,
|
|
704
|
-
},
|
|
705
630
|
),
|
|
706
631
|
]
|
|
707
632
|
# if telegram_entrypoint_enabled, the telegram_entrypoint_enabled will be enabled, telegram_config will be checked
|
|
@@ -710,9 +635,6 @@ class AgentUserInput(AgentCore):
|
|
|
710
635
|
PydanticField(
|
|
711
636
|
default=False,
|
|
712
637
|
description="Whether the agent can play telegram bot",
|
|
713
|
-
json_schema_extra={
|
|
714
|
-
"x-group": "entrypoint",
|
|
715
|
-
},
|
|
716
638
|
),
|
|
717
639
|
]
|
|
718
640
|
telegram_entrypoint_prompt: Annotated[
|
|
@@ -721,9 +643,6 @@ class AgentUserInput(AgentCore):
|
|
|
721
643
|
default=None,
|
|
722
644
|
description="Extra prompt for telegram entrypoint",
|
|
723
645
|
max_length=10000,
|
|
724
|
-
json_schema_extra={
|
|
725
|
-
"x-group": "entrypoint",
|
|
726
|
-
},
|
|
727
646
|
),
|
|
728
647
|
]
|
|
729
648
|
telegram_config: Annotated[
|
|
@@ -731,9 +650,6 @@ class AgentUserInput(AgentCore):
|
|
|
731
650
|
PydanticField(
|
|
732
651
|
default=None,
|
|
733
652
|
description="Telegram integration configuration settings",
|
|
734
|
-
json_schema_extra={
|
|
735
|
-
"x-group": "entrypoint",
|
|
736
|
-
},
|
|
737
653
|
),
|
|
738
654
|
]
|
|
739
655
|
xmtp_entrypoint_prompt: Annotated[
|
|
@@ -742,9 +658,6 @@ class AgentUserInput(AgentCore):
|
|
|
742
658
|
default=None,
|
|
743
659
|
description="Extra prompt for xmtp entrypoint, xmtp support is in beta",
|
|
744
660
|
max_length=10000,
|
|
745
|
-
json_schema_extra={
|
|
746
|
-
"x-group": "entrypoint",
|
|
747
|
-
},
|
|
748
661
|
),
|
|
749
662
|
]
|
|
750
663
|
|
|
@@ -1380,6 +1293,113 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1380
1293
|
return None
|
|
1381
1294
|
return cls.model_validate(item)
|
|
1382
1295
|
|
|
1296
|
+
@staticmethod
|
|
1297
|
+
def _deserialize_autonomous(
|
|
1298
|
+
autonomous_data: Optional[List[Any]],
|
|
1299
|
+
) -> List[AgentAutonomous]:
|
|
1300
|
+
if not autonomous_data:
|
|
1301
|
+
return []
|
|
1302
|
+
|
|
1303
|
+
deserialized: List[AgentAutonomous] = []
|
|
1304
|
+
for entry in autonomous_data:
|
|
1305
|
+
if isinstance(entry, AgentAutonomous):
|
|
1306
|
+
deserialized.append(entry)
|
|
1307
|
+
else:
|
|
1308
|
+
deserialized.append(AgentAutonomous.model_validate(entry))
|
|
1309
|
+
return deserialized
|
|
1310
|
+
|
|
1311
|
+
@staticmethod
|
|
1312
|
+
def _serialize_autonomous(tasks: List[AgentAutonomous]) -> List[Dict[str, Any]]:
|
|
1313
|
+
return [task.model_dump() for task in tasks]
|
|
1314
|
+
|
|
1315
|
+
@staticmethod
|
|
1316
|
+
def _autonomous_not_allowed_error() -> IntentKitAPIError:
|
|
1317
|
+
return IntentKitAPIError(
|
|
1318
|
+
400,
|
|
1319
|
+
"AgentNotDeployed",
|
|
1320
|
+
"Only deployed agents can call this feature.",
|
|
1321
|
+
)
|
|
1322
|
+
|
|
1323
|
+
async def list_autonomous_tasks(self) -> List[AgentAutonomous]:
|
|
1324
|
+
persisted = await Agent.get(self.id)
|
|
1325
|
+
if persisted is None:
|
|
1326
|
+
raise self._autonomous_not_allowed_error()
|
|
1327
|
+
|
|
1328
|
+
tasks = persisted.autonomous or []
|
|
1329
|
+
# Keep local state in sync with persisted data
|
|
1330
|
+
self.autonomous = tasks
|
|
1331
|
+
return tasks
|
|
1332
|
+
|
|
1333
|
+
async def add_autonomous_task(self, task: AgentAutonomous) -> AgentAutonomous:
|
|
1334
|
+
async with get_session() as session:
|
|
1335
|
+
db_agent = await session.get(AgentTable, self.id)
|
|
1336
|
+
if db_agent is None:
|
|
1337
|
+
raise self._autonomous_not_allowed_error()
|
|
1338
|
+
|
|
1339
|
+
current_tasks = self._deserialize_autonomous(db_agent.autonomous)
|
|
1340
|
+
current_tasks.append(task)
|
|
1341
|
+
|
|
1342
|
+
db_agent.autonomous = self._serialize_autonomous(current_tasks)
|
|
1343
|
+
await session.commit()
|
|
1344
|
+
|
|
1345
|
+
self.autonomous = current_tasks
|
|
1346
|
+
return task
|
|
1347
|
+
|
|
1348
|
+
async def delete_autonomous_task(self, task_id: str) -> None:
|
|
1349
|
+
async with get_session() as session:
|
|
1350
|
+
db_agent = await session.get(AgentTable, self.id)
|
|
1351
|
+
if db_agent is None:
|
|
1352
|
+
raise self._autonomous_not_allowed_error()
|
|
1353
|
+
|
|
1354
|
+
current_tasks = self._deserialize_autonomous(db_agent.autonomous)
|
|
1355
|
+
|
|
1356
|
+
updated_tasks = [task for task in current_tasks if task.id != task_id]
|
|
1357
|
+
if len(updated_tasks) == len(current_tasks):
|
|
1358
|
+
raise IntentKitAPIError(
|
|
1359
|
+
404,
|
|
1360
|
+
"TaskNotFound",
|
|
1361
|
+
f"Autonomous task with ID {task_id} not found.",
|
|
1362
|
+
)
|
|
1363
|
+
|
|
1364
|
+
db_agent.autonomous = self._serialize_autonomous(updated_tasks)
|
|
1365
|
+
await session.commit()
|
|
1366
|
+
|
|
1367
|
+
self.autonomous = updated_tasks
|
|
1368
|
+
|
|
1369
|
+
async def update_autonomous_task(
|
|
1370
|
+
self, task_id: str, task_updates: dict
|
|
1371
|
+
) -> AgentAutonomous:
|
|
1372
|
+
async with get_session() as session:
|
|
1373
|
+
db_agent = await session.get(AgentTable, self.id)
|
|
1374
|
+
if db_agent is None:
|
|
1375
|
+
raise self._autonomous_not_allowed_error()
|
|
1376
|
+
|
|
1377
|
+
current_tasks = self._deserialize_autonomous(db_agent.autonomous)
|
|
1378
|
+
|
|
1379
|
+
updated_task: Optional[AgentAutonomous] = None
|
|
1380
|
+
rewritten_tasks: List[AgentAutonomous] = []
|
|
1381
|
+
for task in current_tasks:
|
|
1382
|
+
if task.id == task_id:
|
|
1383
|
+
task_dict = task.model_dump()
|
|
1384
|
+
task_dict.update(task_updates)
|
|
1385
|
+
updated_task = AgentAutonomous.model_validate(task_dict)
|
|
1386
|
+
rewritten_tasks.append(updated_task)
|
|
1387
|
+
else:
|
|
1388
|
+
rewritten_tasks.append(task)
|
|
1389
|
+
|
|
1390
|
+
if updated_task is None:
|
|
1391
|
+
raise IntentKitAPIError(
|
|
1392
|
+
404,
|
|
1393
|
+
"TaskNotFound",
|
|
1394
|
+
f"Autonomous task with ID {task_id} not found.",
|
|
1395
|
+
)
|
|
1396
|
+
|
|
1397
|
+
db_agent.autonomous = self._serialize_autonomous(rewritten_tasks)
|
|
1398
|
+
await session.commit()
|
|
1399
|
+
|
|
1400
|
+
self.autonomous = rewritten_tasks
|
|
1401
|
+
return updated_task
|
|
1402
|
+
|
|
1383
1403
|
def skill_config(self, category: str) -> Dict[str, Any]:
|
|
1384
1404
|
return self.skills.get(category, {}) if self.skills else {}
|
|
1385
1405
|
|
|
@@ -158,7 +158,8 @@
|
|
|
158
158
|
"trim",
|
|
159
159
|
"summarize"
|
|
160
160
|
],
|
|
161
|
-
"x-group": "llm"
|
|
161
|
+
"x-group": "llm",
|
|
162
|
+
"x-advanced": true
|
|
162
163
|
},
|
|
163
164
|
"temperature": {
|
|
164
165
|
"title": "Temperature",
|
|
@@ -168,7 +169,8 @@
|
|
|
168
169
|
"minimum": 0.0,
|
|
169
170
|
"maximum": 1.5,
|
|
170
171
|
"x-group": "llm",
|
|
171
|
-
"x-step": 0.1
|
|
172
|
+
"x-step": 0.1,
|
|
173
|
+
"x-advanced": true
|
|
172
174
|
},
|
|
173
175
|
"frequency_penalty": {
|
|
174
176
|
"title": "Frequency Penalty",
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import NotRequired, TypedDict
|
|
5
5
|
|
|
6
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
7
6
|
from intentkit.skills.acolyt.ask import AcolytAskGpt
|
|
8
7
|
from intentkit.skills.acolyt.base import AcolytBaseTool
|
|
9
8
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
@@ -28,7 +27,6 @@ class Config(SkillConfig):
|
|
|
28
27
|
async def get_skills(
|
|
29
28
|
config: "Config",
|
|
30
29
|
is_private: bool,
|
|
31
|
-
store: SkillStoreABC,
|
|
32
30
|
**_,
|
|
33
31
|
) -> list[AcolytBaseTool]:
|
|
34
32
|
"""Get all Acolyt skills.
|
|
@@ -36,7 +34,6 @@ async def get_skills(
|
|
|
36
34
|
Args:
|
|
37
35
|
config: The configuration for Acolyt skills.
|
|
38
36
|
is_private: Whether to include private skills.
|
|
39
|
-
store: The skill store for persisting data.
|
|
40
37
|
|
|
41
38
|
Returns:
|
|
42
39
|
A list of Acolyt skills.
|
|
@@ -53,7 +50,7 @@ async def get_skills(
|
|
|
53
50
|
# Get each skill using the cached getter
|
|
54
51
|
result = []
|
|
55
52
|
for name in available_skills:
|
|
56
|
-
skill = get_acolyt_skill(name
|
|
53
|
+
skill = get_acolyt_skill(name)
|
|
57
54
|
if skill:
|
|
58
55
|
result.append(skill)
|
|
59
56
|
return result
|
|
@@ -61,22 +58,18 @@ async def get_skills(
|
|
|
61
58
|
|
|
62
59
|
def get_acolyt_skill(
|
|
63
60
|
name: str,
|
|
64
|
-
store: SkillStoreABC,
|
|
65
61
|
) -> AcolytBaseTool | None:
|
|
66
62
|
"""Get an Acolyt skill by name.
|
|
67
63
|
|
|
68
64
|
Args:
|
|
69
65
|
name: The name of the skill to get
|
|
70
|
-
store: The skill store for persisting data
|
|
71
66
|
|
|
72
67
|
Returns:
|
|
73
68
|
The requested Acolyt skill
|
|
74
69
|
"""
|
|
75
70
|
if name == "ask_gpt":
|
|
76
71
|
if name not in _cache:
|
|
77
|
-
_cache[name] = AcolytAskGpt(
|
|
78
|
-
skill_store=store,
|
|
79
|
-
)
|
|
72
|
+
_cache[name] = AcolytAskGpt()
|
|
80
73
|
return _cache[name]
|
|
81
74
|
else:
|
|
82
75
|
logger.warning(f"Unknown Acolyt skill: {name}")
|
intentkit/skills/acolyt/base.py
CHANGED
|
@@ -3,7 +3,7 @@ from typing import Type
|
|
|
3
3
|
from langchain_core.tools.base import ToolException
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
6
|
-
from intentkit.
|
|
6
|
+
from intentkit.config.config import config
|
|
7
7
|
from intentkit.skills.base import IntentKitSkill
|
|
8
8
|
|
|
9
9
|
base_url = "https://acolyt-oracle-poc.vercel.app"
|
|
@@ -15,16 +15,13 @@ class AcolytBaseTool(IntentKitSkill):
|
|
|
15
15
|
name: str = Field(description="The name of the tool")
|
|
16
16
|
description: str = Field(description="A description of what the tool does")
|
|
17
17
|
args_schema: Type[BaseModel]
|
|
18
|
-
skill_store: SkillStoreABC = Field(
|
|
19
|
-
description="The skill store for persisting data"
|
|
20
|
-
)
|
|
21
18
|
|
|
22
19
|
def get_api_key(self) -> str:
|
|
23
20
|
context = self.get_context()
|
|
24
21
|
skill_config = context.agent.skill_config(self.category)
|
|
25
22
|
api_key_provider = skill_config.get("api_key_provider")
|
|
26
23
|
if api_key_provider == "platform":
|
|
27
|
-
return
|
|
24
|
+
return config.acolyt_api_key
|
|
28
25
|
# for backward compatibility, may only have api_key in skill_config
|
|
29
26
|
elif skill_config.get("api_key"):
|
|
30
27
|
return skill_config.get("api_key")
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from typing import TypedDict
|
|
2
2
|
|
|
3
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
4
3
|
from intentkit.skills.aixbt.base import AIXBTBaseTool
|
|
5
4
|
from intentkit.skills.aixbt.projects import AIXBTProjects
|
|
6
5
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
@@ -27,7 +26,6 @@ class Config(SkillConfig):
|
|
|
27
26
|
async def get_skills(
|
|
28
27
|
config: "Config",
|
|
29
28
|
is_private: bool,
|
|
30
|
-
store: SkillStoreABC,
|
|
31
29
|
**_,
|
|
32
30
|
) -> list[AIXBTBaseTool]:
|
|
33
31
|
"""Get all AIXBT API skills."""
|
|
@@ -44,26 +42,17 @@ async def get_skills(
|
|
|
44
42
|
available_skills.append(skill_name)
|
|
45
43
|
|
|
46
44
|
# Get each skill using the cached getter
|
|
47
|
-
return [
|
|
48
|
-
get_aixbt_skill(
|
|
49
|
-
name=name,
|
|
50
|
-
store=store,
|
|
51
|
-
)
|
|
52
|
-
for name in available_skills
|
|
53
|
-
]
|
|
45
|
+
return [get_aixbt_skill(name) for name in available_skills]
|
|
54
46
|
|
|
55
47
|
|
|
56
48
|
def get_aixbt_skill(
|
|
57
49
|
name: str,
|
|
58
|
-
store: SkillStoreABC,
|
|
59
50
|
) -> AIXBTBaseTool:
|
|
60
51
|
"""Get an AIXBT API skill by name."""
|
|
61
52
|
|
|
62
53
|
if name == "aixbt_projects":
|
|
63
54
|
if name not in _cache:
|
|
64
|
-
_cache[name] = AIXBTProjects(
|
|
65
|
-
skill_store=store,
|
|
66
|
-
)
|
|
55
|
+
_cache[name] = AIXBTProjects()
|
|
67
56
|
return _cache[name]
|
|
68
57
|
else:
|
|
69
58
|
raise ValueError(f"Unknown AIXBT skill: {name}")
|
intentkit/skills/aixbt/base.py
CHANGED
|
@@ -2,7 +2,6 @@ from typing import Type
|
|
|
2
2
|
|
|
3
3
|
from pydantic import BaseModel, Field
|
|
4
4
|
|
|
5
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
6
5
|
from intentkit.skills.base import IntentKitSkill
|
|
7
6
|
|
|
8
7
|
|
|
@@ -12,9 +11,6 @@ class AIXBTBaseTool(IntentKitSkill):
|
|
|
12
11
|
name: str = Field(description="The name of the tool")
|
|
13
12
|
description: str = Field(description="A description of what the tool does")
|
|
14
13
|
args_schema: Type[BaseModel]
|
|
15
|
-
skill_store: SkillStoreABC = Field(
|
|
16
|
-
description="The skill store for persisting data"
|
|
17
|
-
)
|
|
18
14
|
|
|
19
15
|
@property
|
|
20
16
|
def category(self) -> str:
|
|
@@ -89,9 +89,8 @@ class AIXBTProjects(AIXBTBaseTool):
|
|
|
89
89
|
"rate_limit_minutes"
|
|
90
90
|
):
|
|
91
91
|
await self.user_rate_limit_by_category(
|
|
92
|
-
context.user_id,
|
|
93
92
|
skill_config["rate_limit_number"],
|
|
94
|
-
skill_config["rate_limit_minutes"],
|
|
93
|
+
skill_config["rate_limit_minutes"] * 60,
|
|
95
94
|
)
|
|
96
95
|
|
|
97
96
|
# Get the API key from the agent's configuration
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import NotRequired, TypedDict
|
|
5
5
|
|
|
6
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
7
6
|
from intentkit.skills.allora.base import AlloraBaseTool
|
|
8
7
|
from intentkit.skills.allora.price import AlloraGetPrice
|
|
9
8
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
@@ -28,7 +27,6 @@ class Config(SkillConfig):
|
|
|
28
27
|
async def get_skills(
|
|
29
28
|
config: "Config",
|
|
30
29
|
is_private: bool,
|
|
31
|
-
store: SkillStoreABC,
|
|
32
30
|
**_,
|
|
33
31
|
) -> list[AlloraBaseTool]:
|
|
34
32
|
"""Get all Allora skills.
|
|
@@ -36,7 +34,6 @@ async def get_skills(
|
|
|
36
34
|
Args:
|
|
37
35
|
config: The configuration for Allora skills.
|
|
38
36
|
is_private: Whether to include private skills.
|
|
39
|
-
store: The skill store for persisting data.
|
|
40
37
|
|
|
41
38
|
Returns:
|
|
42
39
|
A list of Allora skills.
|
|
@@ -53,7 +50,7 @@ async def get_skills(
|
|
|
53
50
|
# Get each skill using the cached getter
|
|
54
51
|
result = []
|
|
55
52
|
for name in available_skills:
|
|
56
|
-
skill = get_allora_skill(name
|
|
53
|
+
skill = get_allora_skill(name)
|
|
57
54
|
if skill:
|
|
58
55
|
result.append(skill)
|
|
59
56
|
return result
|
|
@@ -61,22 +58,18 @@ async def get_skills(
|
|
|
61
58
|
|
|
62
59
|
def get_allora_skill(
|
|
63
60
|
name: str,
|
|
64
|
-
store: SkillStoreABC,
|
|
65
61
|
) -> AlloraBaseTool:
|
|
66
62
|
"""Get an Allora skill by name.
|
|
67
63
|
|
|
68
64
|
Args:
|
|
69
65
|
name: The name of the skill to get
|
|
70
|
-
store: The skill store for persisting data
|
|
71
66
|
|
|
72
67
|
Returns:
|
|
73
68
|
The requested Allora skill
|
|
74
69
|
"""
|
|
75
70
|
if name == "get_price_prediction":
|
|
76
71
|
if name not in _cache:
|
|
77
|
-
_cache[name] = AlloraGetPrice(
|
|
78
|
-
skill_store=store,
|
|
79
|
-
)
|
|
72
|
+
_cache[name] = AlloraGetPrice()
|
|
80
73
|
return _cache[name]
|
|
81
74
|
else:
|
|
82
75
|
logger.warning(f"Unknown Allora skill: {name}")
|
intentkit/skills/allora/base.py
CHANGED
|
@@ -3,7 +3,7 @@ from typing import Type
|
|
|
3
3
|
from langchain_core.tools.base import ToolException
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
6
|
-
from intentkit.
|
|
6
|
+
from intentkit.config.config import config
|
|
7
7
|
from intentkit.skills.base import IntentKitSkill
|
|
8
8
|
|
|
9
9
|
base_url = "https://api.upshot.xyz/v2/allora"
|
|
@@ -15,16 +15,13 @@ class AlloraBaseTool(IntentKitSkill):
|
|
|
15
15
|
name: str = Field(description="The name of the tool")
|
|
16
16
|
description: str = Field(description="A description of what the tool does")
|
|
17
17
|
args_schema: Type[BaseModel]
|
|
18
|
-
skill_store: SkillStoreABC = Field(
|
|
19
|
-
description="The skill store for persisting data"
|
|
20
|
-
)
|
|
21
18
|
|
|
22
19
|
def get_api_key(self) -> str:
|
|
23
20
|
context = self.get_context()
|
|
24
21
|
skill_config = context.agent.skill_config(self.category)
|
|
25
22
|
api_key_provider = skill_config.get("api_key_provider")
|
|
26
23
|
if api_key_provider == "platform":
|
|
27
|
-
return
|
|
24
|
+
return config.allora_api_key
|
|
28
25
|
# for backward compatibility, may only have api_key in skill_config
|
|
29
26
|
elif skill_config.get("api_key"):
|
|
30
27
|
return skill_config.get("api_key")
|