mezoAgent 0.6.3__tar.gz → 0.6.4__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {mezoagent-0.6.3 → mezoagent-0.6.4}/PKG-INFO +1 -1
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezoAgent.egg-info/PKG-INFO +1 -1
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezoAgent.egg-info/SOURCES.txt +1 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/__init__.py +3 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/token_balance_tool.py +2 -4
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/token_price_tool.py +1 -0
- mezoagent-0.6.4/mezo_agent/token_utils.py +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/setup.py +1 -1
- {mezoagent-0.6.3 → mezoagent-0.6.4}/MANIFEST.in +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/README.md +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezoAgent.egg-info/dependency_links.txt +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezoAgent.egg-info/requires.txt +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezoAgent.egg-info/top_level.txt +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/characters.py +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/chat.py +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/config.py +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/data/new_router.json +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/parsing.py +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/swap_musd_btc.py +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/transaction.py +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/mezo_agent/utils.py +0 -0
- {mezoagent-0.6.3 → mezoagent-0.6.4}/setup.cfg +0 -0
@@ -4,6 +4,7 @@ from .chat import mezo_character_chat
|
|
4
4
|
from .characters import get_character_prompt
|
5
5
|
from .token_balance_tool import mezo_agent_token_balance_tool
|
6
6
|
from .token_price_tool import mezo_agent_token_price_tool
|
7
|
+
from .token_utils import get_token_address_by_symbol # ✅ Expose new module
|
7
8
|
|
8
9
|
__all__ = [
|
9
10
|
"mezo_agent_transaction_btc",
|
@@ -11,5 +12,7 @@ __all__ = [
|
|
11
12
|
"mezo_agent_swap_musd_btc",
|
12
13
|
"mezo_character_chat",
|
13
14
|
"mezo_agent_token_balance_tool",
|
15
|
+
"mezo_agent_token_price_tool",
|
16
|
+
"get_token_address_by_symbol",
|
14
17
|
"get_character_prompt"
|
15
18
|
]
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from langchain.tools import tool
|
2
2
|
from mezo_agent.config import web3_instance, sender_address, ERC20_ABI
|
3
3
|
from mezo_agent.parsing import extract_balance_details
|
4
|
+
from mezo_agent.token_utils import get_token_address_by_symbol # ✅ Import from new module
|
4
5
|
|
5
6
|
@tool
|
6
7
|
def mezo_agent_token_balance_tool(balance_prompt: str) -> str:
|
@@ -10,8 +11,6 @@ def mezo_agent_token_balance_tool(balance_prompt: str) -> str:
|
|
10
11
|
:param balance_prompt: User query containing the token symbol.
|
11
12
|
:return: Token balance for the sender's address.
|
12
13
|
"""
|
13
|
-
from mezo_agent.utils import get_token_address_by_symbol # ✅ Import moved inside function
|
14
|
-
|
15
14
|
details = extract_balance_details(balance_prompt)
|
16
15
|
|
17
16
|
if isinstance(details, str): # Handle extraction errors
|
@@ -25,7 +24,6 @@ def mezo_agent_token_balance_tool(balance_prompt: str) -> str:
|
|
25
24
|
# Get the contract address dynamically
|
26
25
|
token_address = get_token_address_by_symbol(token_symbol)
|
27
26
|
print(f"✅ Using token address: {token_address}") # Debugging
|
28
|
-
print(f"✅ Using ABI: {ERC20_ABI}")
|
29
27
|
|
30
28
|
token_contract = web3_instance.eth.contract(address=token_address, abi=ERC20_ABI)
|
31
29
|
|
@@ -34,4 +32,4 @@ def mezo_agent_token_balance_tool(balance_prompt: str) -> str:
|
|
34
32
|
balance = web3_instance.from_wei(balance_wei, "ether")
|
35
33
|
return f"✅ {token_symbol.upper()} Balance: {balance}"
|
36
34
|
except Exception as e:
|
37
|
-
return f"❌ Failed to fetch balance: {str(e)}"
|
35
|
+
return f"❌ Failed to fetch balance: {str(e)}"
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from langchain.tools import tool
|
2
2
|
from mezo_agent.config import query_graph
|
3
3
|
from mezo_agent.parsing import extract_price_details
|
4
|
+
from mezo_agent.token_utils import get_token_address_by_symbol # ✅ Import from new module
|
4
5
|
|
5
6
|
@tool
|
6
7
|
def mezo_agent_token_price_tool(price_prompt: str) -> str:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|