intentkit 0.6.19.dev1__py3-none-any.whl → 0.6.19.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 CHANGED
@@ -3,7 +3,7 @@
3
3
  A powerful platform for building AI agents with blockchain and cryptocurrency capabilities.
4
4
  """
5
5
 
6
- __version__ = "0.6.19-dev1"
6
+ __version__ = "0.6.19-dev2"
7
7
  __author__ = "hyacinthus"
8
8
  __email__ = "hyacinthus@gmail.com"
9
9
 
intentkit/clients/cdp.py CHANGED
@@ -144,6 +144,17 @@ class CdpClient:
144
144
  wallet_secret=wallet_secret,
145
145
  )
146
146
  self._wallet_provider = CdpEvmServerWalletProvider(self._wallet_provider_config)
147
+ # hack for cdp bug
148
+ if network_id == "base-mainnet":
149
+ self._wallet_provider._network.network_id = "base"
150
+ elif network_id == "arbitrum-mainnet":
151
+ self._wallet_provider._network.network_id = "arbitrum"
152
+ elif network_id == "optimism-mainnet":
153
+ self._wallet_provider._network.network_id = "optimism"
154
+ elif network_id == "polygon-mainnet":
155
+ self._wallet_provider._network.network_id = "polygon"
156
+ elif network_id == "ethereum-mainnet":
157
+ self._wallet_provider._network.network_id = "ethereum"
147
158
  return self._wallet_provider
148
159
 
149
160
  async def get_account(self) -> EvmServerAccount:
intentkit/core/credit.py CHANGED
@@ -150,6 +150,9 @@ async def recharge(
150
150
  + user_account.reward_credits,
151
151
  base_amount=amount,
152
152
  base_original_amount=amount,
153
+ base_free_amount=Decimal("0"), # No free credits involved in base amount
154
+ base_reward_amount=Decimal("0"), # No reward credits involved in base amount
155
+ base_permanent_amount=amount, # All base amount is permanent for recharge
153
156
  permanent_amount=amount, # Set permanent_amount since this is a permanent credit
154
157
  free_amount=Decimal("0"), # No free credits involved
155
158
  reward_amount=Decimal("0"), # No reward credits involved
@@ -277,6 +280,11 @@ async def reward(
277
280
  + user_account.reward_credits,
278
281
  base_amount=amount,
279
282
  base_original_amount=amount,
283
+ base_free_amount=Decimal("0"), # No free credits involved in base amount
284
+ base_reward_amount=amount, # All base amount is reward for reward events
285
+ base_permanent_amount=Decimal(
286
+ "0"
287
+ ), # No permanent credits involved in base amount
280
288
  reward_amount=amount, # Set reward_amount since this is a reward credit
281
289
  free_amount=Decimal("0"), # No free credits involved
282
290
  permanent_amount=Decimal("0"), # No permanent credits involved
@@ -451,6 +459,9 @@ async def adjustment(
451
459
  + user_account.reward_credits,
452
460
  base_amount=abs_amount,
453
461
  base_original_amount=abs_amount,
462
+ base_free_amount=free_amount,
463
+ base_reward_amount=reward_amount,
464
+ base_permanent_amount=permanent_amount,
454
465
  free_amount=free_amount,
455
466
  reward_amount=reward_amount,
456
467
  permanent_amount=permanent_amount,
@@ -984,6 +995,9 @@ async def expense_message(
984
995
  + user_account.reward_credits,
985
996
  base_amount=base_amount,
986
997
  base_original_amount=base_original_amount,
998
+ base_free_amount=base_free_amount,
999
+ base_reward_amount=base_reward_amount,
1000
+ base_permanent_amount=base_permanent_amount,
987
1001
  base_llm_amount=base_llm_amount,
988
1002
  fee_platform_amount=fee_platform_amount,
989
1003
  fee_platform_free_amount=fee_platform_free_amount,
@@ -1415,6 +1429,9 @@ async def expense_skill(
1415
1429
  base_amount=skill_cost_info.base_amount,
1416
1430
  base_original_amount=skill_cost_info.base_original_amount,
1417
1431
  base_skill_amount=skill_cost_info.base_skill_amount,
1432
+ base_free_amount=base_free_amount,
1433
+ base_reward_amount=base_reward_amount,
1434
+ base_permanent_amount=base_permanent_amount,
1418
1435
  fee_platform_amount=skill_cost_info.fee_platform_amount,
1419
1436
  fee_platform_free_amount=fee_platform_free_amount,
1420
1437
  fee_platform_reward_amount=fee_platform_reward_amount,
@@ -1589,6 +1606,9 @@ async def refill_free_credits_for_account(
1589
1606
  + updated_account.reward_credits,
1590
1607
  base_amount=amount_to_add,
1591
1608
  base_original_amount=amount_to_add,
1609
+ base_free_amount=amount_to_add,
1610
+ base_reward_amount=Decimal("0"),
1611
+ base_permanent_amount=Decimal("0"),
1592
1612
  free_amount=amount_to_add, # Set free_amount since this is a free credit refill
1593
1613
  reward_amount=Decimal("0"), # No reward credits involved
1594
1614
  permanent_amount=Decimal("0"), # No permanent credits involved
@@ -1864,6 +1884,9 @@ async def expense_summarize(
1864
1884
  base_amount=base_amount,
1865
1885
  base_original_amount=base_original_amount,
1866
1886
  base_llm_amount=base_llm_amount,
1887
+ base_free_amount=base_free_amount,
1888
+ base_reward_amount=base_reward_amount,
1889
+ base_permanent_amount=base_permanent_amount,
1867
1890
  fee_platform_amount=fee_platform_amount,
1868
1891
  fee_platform_free_amount=fee_platform_free_amount,
1869
1892
  fee_platform_reward_amount=fee_platform_reward_amount,
@@ -685,7 +685,7 @@
685
685
  "network_id": {
686
686
  "title": "Default Network",
687
687
  "type": "string",
688
- "description": "Default Network",
688
+ "description": "Default Network, please note that some CDP Wallet native skills like swap only support the base network.",
689
689
  "default": "base-mainnet",
690
690
  "enum": [
691
691
  "ethereum-mainnet",
@@ -697,8 +697,7 @@
697
697
  "arbitrum-mainnet",
698
698
  "arbitrum-sepolia",
699
699
  "optimism-mainnet",
700
- "optimism-sepolia",
701
- "solana"
700
+ "optimism-sepolia"
702
701
  ],
703
702
  "x-group": "onchain"
704
703
  }
@@ -715,7 +714,7 @@
715
714
  "readonly_wallet_address": {
716
715
  "title": "Readonly Wallet Address",
717
716
  "type": "string",
718
- "description": "Wallet address for readonly wallet provider",
717
+ "description": "Set the wallet address as agent wallet, then it can only be analyzed by the agent.",
719
718
  "maxLength": 100,
720
719
  "x-group": "onchain"
721
720
  }
intentkit/models/chat.py CHANGED
@@ -503,18 +503,17 @@ class ChatMessage(ChatMessageCreate):
503
503
  def sanitize_privacy(self) -> "ChatMessage":
504
504
  """Remove sensitive information from the chat message.
505
505
 
506
- This method clears the message content and removes parameters and response
506
+ This method clears the skill parameters and response
507
507
  from skill calls while preserving the structure and metadata.
508
508
 
509
509
  Returns:
510
510
  ChatMessage: A new ChatMessage instance with sensitive data removed
511
511
  """
512
+ if self.author_type != AuthorType.SKILL:
513
+ return self
512
514
  # Create a copy of the current message
513
515
  sanitized_data = self.model_dump()
514
516
 
515
- # Clear the message content
516
- sanitized_data["message"] = ""
517
-
518
517
  # Clear sensitive data from skill calls
519
518
  if sanitized_data.get("skill_calls"):
520
519
  for skill_call in sanitized_data["skill_calls"]:
@@ -520,6 +520,7 @@ class CreditAccount(BaseModel):
520
520
  balance_after=free_quota,
521
521
  base_amount=free_quota,
522
522
  base_original_amount=free_quota,
523
+ base_free_amount=free_quota,
523
524
  free_amount=free_quota, # Set free_amount since this is a free credit refill
524
525
  reward_amount=Decimal("0"), # No reward credits involved
525
526
  permanent_amount=Decimal("0"), # No permanent credits involved
@@ -805,6 +806,21 @@ class CreditEventTable(Base):
805
806
  default=0,
806
807
  nullable=True,
807
808
  )
809
+ base_free_amount = Column(
810
+ Numeric(22, 4),
811
+ default=0,
812
+ nullable=True,
813
+ )
814
+ base_reward_amount = Column(
815
+ Numeric(22, 4),
816
+ default=0,
817
+ nullable=True,
818
+ )
819
+ base_permanent_amount = Column(
820
+ Numeric(22, 4),
821
+ default=0,
822
+ nullable=True,
823
+ )
808
824
  fee_platform_amount = Column(
809
825
  Numeric(22, 4),
810
826
  default=0,
@@ -979,6 +995,18 @@ class CreditEvent(BaseModel):
979
995
  Optional[Decimal],
980
996
  Field(default=Decimal("0"), description="Base skill cost amount"),
981
997
  ]
998
+ base_free_amount: Annotated[
999
+ Optional[Decimal],
1000
+ Field(default=Decimal("0"), description="Base free credit amount"),
1001
+ ]
1002
+ base_reward_amount: Annotated[
1003
+ Optional[Decimal],
1004
+ Field(default=Decimal("0"), description="Base reward credit amount"),
1005
+ ]
1006
+ base_permanent_amount: Annotated[
1007
+ Optional[Decimal],
1008
+ Field(default=Decimal("0"), description="Base permanent credit amount"),
1009
+ ]
982
1010
  fee_platform_amount: Annotated[
983
1011
  Optional[Decimal],
984
1012
  Field(default=Decimal("0"), description="Platform fee amount"),
@@ -1073,6 +1101,9 @@ class CreditEvent(BaseModel):
1073
1101
  "base_original_amount",
1074
1102
  "base_llm_amount",
1075
1103
  "base_skill_amount",
1104
+ "base_free_amount",
1105
+ "base_reward_amount",
1106
+ "base_permanent_amount",
1076
1107
  "fee_platform_amount",
1077
1108
  "fee_platform_free_amount",
1078
1109
  "fee_platform_reward_amount",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: intentkit
3
- Version: 0.6.19.dev1
3
+ Version: 0.6.19.dev2
4
4
  Summary: Intent-based AI Agent Platform - Core Package
5
5
  Project-URL: Homepage, https://github.com/crestal-network/intentkit
6
6
  Project-URL: Repository, https://github.com/crestal-network/intentkit
@@ -1,4 +1,4 @@
1
- intentkit/__init__.py,sha256=quyhcKChclMLhjuy8LzOR07Mg7jKRnXvuDEATLIHjyU,384
1
+ intentkit/__init__.py,sha256=URY46LF0PzcfF5ekBoFEG5w1RPHfC3Ht-Gw_t45X9Sk,384
2
2
  intentkit/abstracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  intentkit/abstracts/agent.py,sha256=108gb5W8Q1Sy4G55F2_ZFv2-_CnY76qrBtpIr0Oxxqk,1489
4
4
  intentkit/abstracts/api.py,sha256=ZUc24vaQvQVbbjznx7bV0lbbQxdQPfEV8ZxM2R6wZWo,166
@@ -7,7 +7,7 @@ intentkit/abstracts/graph.py,sha256=sX5hVemXsODvwIYLHufaf-zSXmW97bXRoZuyxYqaEV4,
7
7
  intentkit/abstracts/skill.py,sha256=cIJ6BkASD31U1IEkE8rdAawq99w_xsg0lt3oalqa1ZA,5071
8
8
  intentkit/abstracts/twitter.py,sha256=cEtP7ygR_b-pHdc9i8kBuyooz1cPoGUGwsBHDpowJyY,1262
9
9
  intentkit/clients/__init__.py,sha256=sQ_6_bRC2MPWLPH-skQ3qsEe8ce-dUGL7i8VJOautHg,298
10
- intentkit/clients/cdp.py,sha256=VaIFzgfqpq5H4bHbFBe8UPabhkwe8s5pge_P5FssGqU,6453
10
+ intentkit/clients/cdp.py,sha256=_A0QRRi6uPYr_AL26arW-Yofez0JcrEQdfxGCVgC7kM,7038
11
11
  intentkit/clients/twitter.py,sha256=Lfa7srHOFnY96SXcElW0jfg7XKS_WliWnXjPZEe6SQc,18976
12
12
  intentkit/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  intentkit/config/config.py,sha256=jhPr7FzZZHUsLIdyiOcaKeAsZQ8FdEo6yUaiIcvmryo,8879
@@ -15,19 +15,19 @@ intentkit/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  intentkit/core/agent.py,sha256=GIKDn1dTenIHWMRxe-ud7hd1cQaHzbTDdypy5IAgPfU,16658
16
16
  intentkit/core/api.py,sha256=WfoaHNquujYJIpNPuTR1dSaaxog0S3X2W4lG9Ehmkm4,3284
17
17
  intentkit/core/client.py,sha256=J5K7f08-ucszBKAbn9K3QNOFKIC__7amTbKYii1jFkI,3056
18
- intentkit/core/credit.py,sha256=kA9h8BcsEOZ57AEvK9idlQqD0vej_EWgeOc-c_DRevw,68341
18
+ intentkit/core/credit.py,sha256=1aKT3hNLCvcQYjNckMxBsUpdtc4RH_KZQPAfzpOs-DU,69552
19
19
  intentkit/core/engine.py,sha256=H4ew1jhn2coMYJ3zR9isM1Y-XbnXNMg91SeDoeXdQ4U,36562
20
20
  intentkit/core/node.py,sha256=7h9zgDSd928bzUi3m3EZnKkhbwqlbRAQUr_uz7gKB5Y,8880
21
21
  intentkit/core/prompt.py,sha256=a6nogIGZuDt2u2EuDd29DAv73OjCBOn-bZnuqYRvY7A,15804
22
22
  intentkit/core/skill.py,sha256=vPK37sDRT9kzkMBymPwqZ5uEdxTTRtb_DfREIeyz-Xw,5788
23
23
  intentkit/models/agent.py,sha256=uC5AErdVucaEajKCXAcF6C3VwYRVIhXTIfOBp-n-Xhg,66310
24
24
  intentkit/models/agent_data.py,sha256=mVsiK8TziYa1W1ujU1KwI9osIVIeSM7XJEogGRL1WVU,28263
25
- intentkit/models/agent_schema.json,sha256=vhW6k9sPAU7Wx0VQjhNc-v9-pu0q6JsRK0z3Mgo5W6w,20999
25
+ intentkit/models/agent_schema.json,sha256=psrYONIzAbiuZB4zzYQFmANP1pw31TV_900TagSYT7o,21109
26
26
  intentkit/models/app_setting.py,sha256=iYbW63QD91bt4oEYV3wOXHuRFav2b4VXLwb_StgUQtQ,8230
27
27
  intentkit/models/base.py,sha256=o-zRjVrak-f5Jokdvj8BjLm8gcC3yYiYMCTLegwT2lA,185
28
- intentkit/models/chat.py,sha256=4z5y0Q77XsVABeGMRXnxlY2Ol6gnivTxeMrlO04IB-Q,20494
28
+ intentkit/models/chat.py,sha256=cDccEHU8nd7Y5uhrHDCuZGwqrRwhqCaeztMiZcemiug,20469
29
29
  intentkit/models/conversation.py,sha256=nrbDIw-3GK5BYi_xkI15FLdx4a6SNrFK8wfAGLCsrqk,9032
30
- intentkit/models/credit.py,sha256=o5jJGX1Hn8vWhkMRzo3eV8aIFEHBFkKtlLl0x5_8rLo,44198
30
+ intentkit/models/credit.py,sha256=BHX_Ty1u-TlPCDMjnMbogoUtlbcff0tHHVVZLzkrnGY,45090
31
31
  intentkit/models/db.py,sha256=nuDX6NEtnfD5YLr2iVpAAXsgHbSpG5diqfLC-PkHsA4,4406
32
32
  intentkit/models/db_mig.py,sha256=vT6Tanm-BHC2T7dTztuB1UG494EFBAlHADKsNzR6xaQ,3577
33
33
  intentkit/models/generator.py,sha256=lyZu9U9rZUGkqd_QT5SAhay9DY358JJY8EhDSpN8I1M,10298
@@ -411,7 +411,7 @@ intentkit/utils/random.py,sha256=DymMxu9g0kuQLgJUqalvgksnIeLdS-v0aRk5nQU0mLI,452
411
411
  intentkit/utils/s3.py,sha256=9trQNkKQ5VgxWsewVsV8Y0q_pXzGRvsCYP8xauyUYkg,8549
412
412
  intentkit/utils/slack_alert.py,sha256=s7UpRgyzLW7Pbmt8cKzTJgMA9bm4EP-1rQ5KXayHu6E,2264
413
413
  intentkit/utils/tx.py,sha256=2yLLGuhvfBEY5n_GJ8wmIWLCzn0FsYKv5kRNzw_sLUI,1454
414
- intentkit-0.6.19.dev1.dist-info/METADATA,sha256=BgyilNciFNBjtrR1TbV2aLHYv66HE9owOSnAYWk_dlo,6414
415
- intentkit-0.6.19.dev1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
416
- intentkit-0.6.19.dev1.dist-info/licenses/LICENSE,sha256=Bln6DhK-LtcO4aXy-PBcdZv2f24MlJFm_qn222biJtE,1071
417
- intentkit-0.6.19.dev1.dist-info/RECORD,,
414
+ intentkit-0.6.19.dev2.dist-info/METADATA,sha256=yH0g5MnOWthCWld7D-Xu--mKeaavKQdWxj7gLSinejo,6414
415
+ intentkit-0.6.19.dev2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
416
+ intentkit-0.6.19.dev2.dist-info/licenses/LICENSE,sha256=Bln6DhK-LtcO4aXy-PBcdZv2f24MlJFm_qn222biJtE,1071
417
+ intentkit-0.6.19.dev2.dist-info/RECORD,,