LONGYKING
commited on
Commit
·
575618b
1
Parent(s):
2a8ad37
added a financial market agent and made cxbt_assitant team lead
Browse files- chatxbt-assistant.py +31 -2
chatxbt-assistant.py
CHANGED
|
@@ -83,10 +83,38 @@ async def start():
|
|
| 83 |
portkey_local_gateway = bool(os.getenv("PORTKEY_LOCAL_GATEWAY_URL"))
|
| 84 |
portkey_config = generate_portkey_config(local=portkey_local_gateway)
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
# Initialize the assistant
|
| 87 |
cxbt_assistant = Assistant(
|
| 88 |
introduction="Hi, I'm ChatXBT, your AI assistant for Web3 and DeFi. I can help you with your queries related to Web3 and DeFi.",
|
| 89 |
llm=OpenAIChat(
|
|
|
|
| 90 |
# api_key=os.getenv("PORTKEY_API_KEY"),
|
| 91 |
# # base_url=os.getenv("PORTKEY_LOCAL_GATEWAY_URL") or PORTKEY_GATEWAY_URL,
|
| 92 |
# base_url=PORTKEY_GATEWAY_URL,
|
|
@@ -97,14 +125,15 @@ async def start():
|
|
| 97 |
),
|
| 98 |
tools=[
|
| 99 |
DuckDuckGo(),
|
| 100 |
-
CryptoDataTools(),
|
| 101 |
CryptoSwapTools(),
|
| 102 |
CrossChainSwapTools(),
|
| 103 |
UserProfileToolkit(),
|
| 104 |
CryptoEVMWalletTools(),
|
| 105 |
# UserConfirmationPinToolkit(),
|
| 106 |
-
YFinanceTools(stock_price=True)
|
| 107 |
],
|
|
|
|
| 108 |
show_tool_calls=False,
|
| 109 |
markdown=True,
|
| 110 |
knowledge_base=knowledge_base,
|
|
|
|
| 83 |
portkey_local_gateway = bool(os.getenv("PORTKEY_LOCAL_GATEWAY_URL"))
|
| 84 |
portkey_config = generate_portkey_config(local=portkey_local_gateway)
|
| 85 |
|
| 86 |
+
XBTfinancialmarketresearcher = Assistant(
|
| 87 |
+
name="XBT-financial-market-researcher",
|
| 88 |
+
llm=OpenAIChat(model="gpt-4o"),
|
| 89 |
+
description="A specialized assistant for researching the financial market, with a focus on crypto, Web3, and DeFi news and trends.",
|
| 90 |
+
instructions=[
|
| 91 |
+
"Use DuckDuckGo for general web searches and recent news.",
|
| 92 |
+
"Use YFinanceTools for obtaining stock prices and related financial data.",
|
| 93 |
+
"Use CryptoDataTools for accessing cryptocurrency prices and market information.",
|
| 94 |
+
"Incorporate relevant news and trends in crypto, Web3, and DeFi into your responses.",
|
| 95 |
+
"Provide accurate and up-to-date information with citations when necessary.",
|
| 96 |
+
],
|
| 97 |
+
markdown=True,
|
| 98 |
+
role="Helps research the financial market and get news and trends on crypto, Web3, and DeFi",
|
| 99 |
+
tools=[
|
| 100 |
+
DuckDuckGo(),
|
| 101 |
+
YFinanceTools(stock_price=True),
|
| 102 |
+
CryptoDataTools(),
|
| 103 |
+
],
|
| 104 |
+
show_tool_calls=is_dev_mode,
|
| 105 |
+
knowledge_base=knowledge_base,
|
| 106 |
+
storage=storage,
|
| 107 |
+
search_knowledge=True,
|
| 108 |
+
read_chat_history=True,
|
| 109 |
+
add_references_to_prompt=True,
|
| 110 |
+
add_chat_history_to_prompt=True,
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
# Initialize the assistant
|
| 114 |
cxbt_assistant = Assistant(
|
| 115 |
introduction="Hi, I'm ChatXBT, your AI assistant for Web3 and DeFi. I can help you with your queries related to Web3 and DeFi.",
|
| 116 |
llm=OpenAIChat(
|
| 117 |
+
model="gpt-4o"
|
| 118 |
# api_key=os.getenv("PORTKEY_API_KEY"),
|
| 119 |
# # base_url=os.getenv("PORTKEY_LOCAL_GATEWAY_URL") or PORTKEY_GATEWAY_URL,
|
| 120 |
# base_url=PORTKEY_GATEWAY_URL,
|
|
|
|
| 125 |
),
|
| 126 |
tools=[
|
| 127 |
DuckDuckGo(),
|
| 128 |
+
# CryptoDataTools(),
|
| 129 |
CryptoSwapTools(),
|
| 130 |
CrossChainSwapTools(),
|
| 131 |
UserProfileToolkit(),
|
| 132 |
CryptoEVMWalletTools(),
|
| 133 |
# UserConfirmationPinToolkit(),
|
| 134 |
+
# YFinanceTools(stock_price=True)
|
| 135 |
],
|
| 136 |
+
team=[XBTfinancialmarketresearcher],
|
| 137 |
show_tool_calls=False,
|
| 138 |
markdown=True,
|
| 139 |
knowledge_base=knowledge_base,
|