mezoAgent 0.3.8__tar.gz → 0.4.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {mezoagent-0.3.8 → mezoagent-0.4.0}/PKG-INFO +1 -1
- {mezoagent-0.3.8 → mezoagent-0.4.0}/mezoAgent.egg-info/PKG-INFO +1 -1
- {mezoagent-0.3.8 → mezoagent-0.4.0}/mezoAgent.egg-info/SOURCES.txt +2 -0
- mezoagent-0.4.0/mezo_agent/__init__.py +6 -0
- mezoagent-0.4.0/mezo_agent/characters.py +14 -0
- mezoagent-0.4.0/mezo_agent/chat.py +27 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/setup.py +1 -1
- mezoagent-0.3.8/mezo_agent/__init__.py +0 -2
- {mezoagent-0.3.8 → mezoagent-0.4.0}/MANIFEST.in +0 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/README.md +0 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/mezoAgent.egg-info/dependency_links.txt +0 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/mezoAgent.egg-info/requires.txt +0 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/mezoAgent.egg-info/top_level.txt +0 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/mezo_agent/config.py +0 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/mezo_agent/data/new_router.json +0 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/mezo_agent/parsing.py +0 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/mezo_agent/swap_musd_btc.py +0 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/mezo_agent/transaction.py +0 -0
- {mezoagent-0.3.8 → mezoagent-0.4.0}/setup.cfg +0 -0
@@ -0,0 +1,6 @@
|
|
1
|
+
from .transaction import mezo_agent_transaction_btc, mezo_agent_musd_transaction
|
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"]
|
@@ -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"])
|
@@ -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
|
+
)
|
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
|