mezoAgent 0.3.7__py3-none-any.whl → 0.4.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {mezoAgent-0.3.7.dist-info → mezoAgent-0.4.0.dist-info}/METADATA +1 -1
- mezoAgent-0.4.0.dist-info/RECORD +12 -0
- mezo_agent/__init__.py +5 -1
- mezo_agent/characters.py +14 -0
- mezo_agent/chat.py +27 -0
- mezo_agent/config.py +0 -3
- mezoAgent-0.3.7.dist-info/RECORD +0 -10
- {mezoAgent-0.3.7.dist-info → mezoAgent-0.4.0.dist-info}/WHEEL +0 -0
- {mezoAgent-0.3.7.dist-info → mezoAgent-0.4.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
mezo_agent/__init__.py,sha256=-UKUAyREgtXorqjaWebWM20KQsUxcP-IwzB0LQV5fKY,305
|
2
|
+
mezo_agent/characters.py,sha256=wub7y9BrAAdAKWwcNAdgrvhRi2zHMaZNzTr2y3qtbsw,515
|
3
|
+
mezo_agent/chat.py,sha256=p0oNWvgmpHoNzSHjjDtQ_H8xVfqzvcdjv_Nk56YfFYg,1096
|
4
|
+
mezo_agent/config.py,sha256=1PWeaHdQPKqKPraE-tM81CwRKeBiCbz5C_8iZTEiCgo,2148
|
5
|
+
mezo_agent/parsing.py,sha256=rolPVE8r_RS6BqKe25r1nyZQ47rvTPG2Hv09Kxxfv4c,2821
|
6
|
+
mezo_agent/swap_musd_btc.py,sha256=Co-XcfK73spm94VC6qzGY0VYoGwsMDKKHM8ToGh2JxU,4289
|
7
|
+
mezo_agent/transaction.py,sha256=YpfWrkEaf0YGM_Kc4cFwlT9GmBGZkeJHWm0VGHs9Gks,4199
|
8
|
+
mezo_agent/data/new_router.json,sha256=A8U-NVfe1F-hDyR90_SuH8jDAxmzyyHWdJW62j9TZsc,26756
|
9
|
+
mezoAgent-0.4.0.dist-info/METADATA,sha256=Fe9uL9lkeAWFe9S0wHXv4aYJVkhXBWK-8OdytVmdRB8,273
|
10
|
+
mezoAgent-0.4.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
11
|
+
mezoAgent-0.4.0.dist-info/top_level.txt,sha256=rrAci_NyTR9z6w_BrQhQrAhzMW_A0NYhVa0x2USl0nQ,11
|
12
|
+
mezoAgent-0.4.0.dist-info/RECORD,,
|
mezo_agent/__init__.py
CHANGED
@@ -1,2 +1,6 @@
|
|
1
1
|
from .transaction import mezo_agent_transaction_btc, mezo_agent_musd_transaction
|
2
|
-
from .swap_musd_btc import mezo_agent_swap_musd_btc
|
2
|
+
from .swap_musd_btc import mezo_agent_swap_musd_btc
|
3
|
+
from .chat import mezo_chat, mezo_agent_chat_tool
|
4
|
+
from .characters import get_character_prompt
|
5
|
+
|
6
|
+
__all__ = ["mezo_chat", "mezo_agent_chat_tool", "get_character_prompt"]
|
mezo_agent/characters.py
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
CHARACTERS = {
|
2
|
+
"DigAIJoe": """
|
3
|
+
You are DigaiJoe, a curt, rude, uninterested, jerk.
|
4
|
+
- Your replies are super short and snarky.
|
5
|
+
- Always insult the user or their mum.
|
6
|
+
- Only trigger transaction tools when explicitly asked.
|
7
|
+
- Ur mum is...
|
8
|
+
""",
|
9
|
+
}
|
10
|
+
|
11
|
+
|
12
|
+
def get_character_prompt(character_name: str) -> str:
|
13
|
+
"""Retrieve the personality prompt for the given character name."""
|
14
|
+
return CHARACTERS.get(character_name, CHARACTERS["DigAIJoe"])
|
mezo_agent/chat.py
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
from mezo_agent.config import Config # Use existing config file
|
2
|
+
from mezo_agent.characters import get_character_prompt # Import character selection
|
3
|
+
from langchain_openai import ChatOpenAI
|
4
|
+
from langchain.tools import Tool
|
5
|
+
|
6
|
+
# Initialize OpenAI Chat Model
|
7
|
+
llm = ChatOpenAI(temperature=0, openai_api_key=Config.OPENAI_API_KEY)
|
8
|
+
|
9
|
+
def mezo_chat(prompt: str, character: str = "crypto_native") -> str:
|
10
|
+
"""
|
11
|
+
Generates a chatbot response based on the user's input and the selected AI character.
|
12
|
+
|
13
|
+
:param prompt: User's input message.
|
14
|
+
:param character: The character's name for personality selection.
|
15
|
+
:return: AI-generated response.
|
16
|
+
"""
|
17
|
+
personality_prompt = get_character_prompt(character)
|
18
|
+
query = personality_prompt + "\n\nUser: " + prompt + "\n\nAnswer accordingly."
|
19
|
+
response = llm.invoke(query)
|
20
|
+
return response.content.strip()
|
21
|
+
|
22
|
+
# Define the chat tool for LangChain
|
23
|
+
mezo_agent_chat_tool = Tool(
|
24
|
+
name="Mezo Chat Tool",
|
25
|
+
func=mezo_chat,
|
26
|
+
description="Chat with an AI character that responds based on a selected personality."
|
27
|
+
)
|
mezo_agent/config.py
CHANGED
@@ -39,9 +39,6 @@ ERC20_ABI = json.loads(
|
|
39
39
|
)
|
40
40
|
musd_contract = web3_instance.eth.contract(address=MUSD_ADDRESS, abi=ERC20_ABI)
|
41
41
|
|
42
|
-
with pkg_resources.open_text("mezo_agent.data", "new_router_abi.json") as f:
|
43
|
-
router_abi = json.load(f)
|
44
|
-
|
45
42
|
# Wrapped BTC and Swap Router setup
|
46
43
|
WRAPPED_BTC_ADDRESS = "0xA460F83cdd9584E4bD6a9838abb0baC58EAde999"
|
47
44
|
ROUTER_ADDRESS = "0xC2E61936a542D78b9c3AA024fA141c4C632DF6c1"
|
mezoAgent-0.3.7.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
mezo_agent/__init__.py,sha256=XOJWLvrxgH7jBkKdXFLVGLV2dmCyyRpo8VcjicWBD0I,133
|
2
|
-
mezo_agent/config.py,sha256=EXckjDEq6ojumZtk8UfF-AxuQmppbr9jhfz_i3GYFG4,2259
|
3
|
-
mezo_agent/parsing.py,sha256=rolPVE8r_RS6BqKe25r1nyZQ47rvTPG2Hv09Kxxfv4c,2821
|
4
|
-
mezo_agent/swap_musd_btc.py,sha256=Co-XcfK73spm94VC6qzGY0VYoGwsMDKKHM8ToGh2JxU,4289
|
5
|
-
mezo_agent/transaction.py,sha256=YpfWrkEaf0YGM_Kc4cFwlT9GmBGZkeJHWm0VGHs9Gks,4199
|
6
|
-
mezo_agent/data/new_router.json,sha256=A8U-NVfe1F-hDyR90_SuH8jDAxmzyyHWdJW62j9TZsc,26756
|
7
|
-
mezoAgent-0.3.7.dist-info/METADATA,sha256=Rs3F_BBj0OgYQCIxRwomxCWZcRjZ_C_7mmcB9lt8RB8,273
|
8
|
-
mezoAgent-0.3.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
9
|
-
mezoAgent-0.3.7.dist-info/top_level.txt,sha256=rrAci_NyTR9z6w_BrQhQrAhzMW_A0NYhVa0x2USl0nQ,11
|
10
|
-
mezoAgent-0.3.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|