mezoAgent 0.8.2__py3-none-any.whl → 0.8.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mezoAgent
3
- Version: 0.8.2
3
+ Version: 0.8.3
4
4
  Summary: A Python package for Mezo Agent tools with LangChain tools
5
5
  Author: Dreadwulf, Duck, Digi
6
6
  Requires-Dist: python-dotenv
@@ -3,7 +3,7 @@ mezo_agent/characters.py,sha256=wub7y9BrAAdAKWwcNAdgrvhRi2zHMaZNzTr2y3qtbsw,515
3
3
  mezo_agent/chat.py,sha256=ZtNurUDV7UzJjbFyU96DNGy37hO3gl0osn19mRu7ER8,859
4
4
  mezo_agent/config.py,sha256=6xFgk80eiBLTasKGW73Ne8hNhMtx8BbQ_Ef79YOyDlc,3233
5
5
  mezo_agent/parsing.py,sha256=PeR1R6gqzM9VXt7OdWANDoL7GbzMMRjKLzuP10uugEs,5101
6
- mezo_agent/safe_mode_btc_tool.py,sha256=9kGajd8hXDPBYNF2gBnKC4HxQobph1MHrc-Yk-2mel4,3468
6
+ mezo_agent/safe_mode_btc_tool.py,sha256=lqMjzcrU1kehB91gU7oJHX3MxWnH1bAoIFPx5NWASnk,3602
7
7
  mezo_agent/swap_musd_btc.py,sha256=Co-XcfK73spm94VC6qzGY0VYoGwsMDKKHM8ToGh2JxU,4289
8
8
  mezo_agent/token_balance_tool.py,sha256=zOjDJdfYT6LuQzPuAxxNeee1srsepevE71fqboiDSWI,1422
9
9
  mezo_agent/token_price_tool.py,sha256=vD-ukq0D_4zmjIy9bZ9qL44nGctf-hWzkQuTd-0wy2U,930
@@ -13,7 +13,7 @@ mezo_agent/twitter_client.py,sha256=Va8ZQaK5lZjJUq3-bhIJWnDmX4Mmt4kWRW3aKSGbLq8,
13
13
  mezo_agent/twitter_manager.py,sha256=KvxiMOhBmQbLuLoVrAQ77DpAnFIdiDSztsKbZ_3-ar4,2363
14
14
  mezo_agent/utils.py,sha256=hsGtL_iXvUVGnY5aHPQ0v6Jejxd4P4qw0yOtS1omToU,1397
15
15
  mezo_agent/data/new_router.json,sha256=A8U-NVfe1F-hDyR90_SuH8jDAxmzyyHWdJW62j9TZsc,26756
16
- mezoAgent-0.8.2.dist-info/METADATA,sha256=39CXNxtnZCSZs8tzgyMqciAIrwCzMoDUd9gtB9wCmVQ,266
17
- mezoAgent-0.8.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
18
- mezoAgent-0.8.2.dist-info/top_level.txt,sha256=rrAci_NyTR9z6w_BrQhQrAhzMW_A0NYhVa0x2USl0nQ,11
19
- mezoAgent-0.8.2.dist-info/RECORD,,
16
+ mezoAgent-0.8.3.dist-info/METADATA,sha256=TSlWeFI6Umzez4U-jq-noFYP93xQCZm6RAHioLSor3w,266
17
+ mezoAgent-0.8.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
18
+ mezoAgent-0.8.3.dist-info/top_level.txt,sha256=rrAci_NyTR9z6w_BrQhQrAhzMW_A0NYhVa0x2USl0nQ,11
19
+ mezoAgent-0.8.3.dist-info/RECORD,,
@@ -1,19 +1,24 @@
1
- from langchain.tools import tool
2
1
  from web3.exceptions import Web3Exception
3
2
  import json
4
3
  from mezo_agent.config import web3_instance, sender_address, account
5
4
  from mezo_agent.parsing import extract_transaction_details
6
5
  from langchain_openai import ChatOpenAI
7
6
  from .config import OPENAI_API_KEY
7
+ from langchain.tools import tool
8
8
 
9
9
  @tool
10
- def mezo_agent_safe_mode_btc_transaction(prompt: str, confirm_before_sending: bool = True) -> str:
10
+ def mezo_agent_safe_mode_btc_transaction(prompt: str) -> str:
11
11
  """
12
12
  Sends BTC on Mezo Matsnet with a Human-in-the-Loop confirmation step.
13
+
13
14
  1) Parses user prompt for transaction details.
14
15
  2) Calls LLM to provide a verbose explanation of the transaction data.
15
16
  3) Shows both raw data and LLM explanation to the user.
16
- 4) Prompts user for confirmation before broadcasting.
17
+ 4) ALWAYS prompts the user for confirmation before broadcasting.
18
+
19
+ NOTE: Because this function is decorated with @tool, it can only take a
20
+ single string argument (prompt). The confirm_before_sending parameter
21
+ has been removed to avoid LangChain's TypeError.
17
22
  """
18
23
 
19
24
  # 1) Parse transaction details
@@ -42,10 +47,10 @@ def mezo_agent_safe_mode_btc_transaction(prompt: str, confirm_before_sending: bo
42
47
  "gas": gas_limit,
43
48
  "gasPrice": gas_price,
44
49
  "nonce": nonce,
45
- "chainId": 31611, # Mezo Testnet Chain ID
50
+ "chainId": 31611, # Mezo Testnet chain ID
46
51
  }
47
52
 
48
- # 4) Generate a LLM Explanation
53
+ # 4) Generate LLM Explanation
49
54
  analysis_prompt = f"""
50
55
  You are given the following transaction data on Mezo Matsnet:
51
56
  - Recipient: {recipient}
@@ -66,19 +71,18 @@ Use a concise and helpful tone.
66
71
  analysis_response = llm.invoke(analysis_prompt)
67
72
  explanation_text = analysis_response.content if analysis_response else "❌ LLM explanation unavailable."
68
73
 
69
- # 5) Show user raw data & explanation, confirm
70
- if confirm_before_sending:
71
- print("\n--- BTC Transaction Data ---")
72
- print(json.dumps(tx_data, indent=2))
73
- print("----------------------------")
74
+ # 5) ALWAYS confirm with the user before sending
75
+ print("\n--- BTC Transaction Data ---")
76
+ print(json.dumps(tx_data, indent=2))
77
+ print("----------------------------")
74
78
 
75
- print("\n--- LLM Analysis ---")
76
- print(explanation_text)
77
- print("--------------------")
79
+ print("\n--- LLM Analysis ---")
80
+ print(explanation_text)
81
+ print("--------------------")
78
82
 
79
- choice = input("Do you want to proceed with this BTC transaction? [y/n]: ").strip().lower()
80
- if choice != 'y':
81
- return "❌ Transaction aborted by user."
83
+ choice = input("Do you want to proceed with this BTC transaction? [y/n]: ").strip().lower()
84
+ if choice != 'y':
85
+ return "❌ Transaction aborted by user."
82
86
 
83
87
  # 6) Sign & send
84
88
  try:
@@ -87,3 +91,4 @@ Use a concise and helpful tone.
87
91
  return f"✅ BTC transaction successful! Hash: {tx_hash.hex()}"
88
92
  except Web3Exception as e:
89
93
  return f"❌ Transaction failed: {str(e)}"
94
+