LONGYKING commited on
Commit
0ad2f68
·
1 Parent(s): c4ca6af

hugginface deployment fixes

Browse files
chatxbt-assistant.py CHANGED
@@ -9,6 +9,7 @@ from phi.tools.yfinance import YFinanceTools
9
  from src.databases.postgres import sqlalchemy_engine
10
  from src.knowledge_bases.combined import knowledge_base
11
  from src.tools.crypto_swap_toolkit import CryptoSwapTools
 
12
  from src.tools.crypto_data_toolkit import CryptoDataTools
13
  from portkey_ai import PORTKEY_GATEWAY_URL, createHeaders
14
  from src.config.portkey_config import generate_portkey_config
@@ -86,24 +87,25 @@ async def start():
86
  cxbt_assistant = Assistant(
87
  introduction="Hi, I'm ChatXBT, your AI assistant for Web3 and DeFi. I can help you with your queries related to Web3 and DeFi.",
88
  llm=OpenAIChat(
89
- api_key=os.getenv("PORTKEY_API_KEY"),
90
- # base_url=os.getenv("PORTKEY_LOCAL_GATEWAY_URL") or PORTKEY_GATEWAY_URL,
91
- base_url=PORTKEY_GATEWAY_URL,
92
- default_headers=createHeaders(
93
- api_key=os.getenv("PORTKEY_API_KEY") or None,
94
- config=portkey_config
95
- ),
96
  ),
97
  tools=[
98
  DuckDuckGo(),
99
  CryptoDataTools(),
100
  CryptoSwapTools(),
 
101
  UserProfileToolkit(),
102
  CryptoEVMWalletTools(),
103
- UserConfirmationPinToolkit(),
104
  YFinanceTools(stock_price=True)
105
  ],
106
- show_tool_calls=is_dev_mode,
107
  markdown=True,
108
  knowledge_base=knowledge_base,
109
  storage=storage,
 
9
  from src.databases.postgres import sqlalchemy_engine
10
  from src.knowledge_bases.combined import knowledge_base
11
  from src.tools.crypto_swap_toolkit import CryptoSwapTools
12
+ from src.tools.crypto_bridge_toolkit import CrossChainSwapTools
13
  from src.tools.crypto_data_toolkit import CryptoDataTools
14
  from portkey_ai import PORTKEY_GATEWAY_URL, createHeaders
15
  from src.config.portkey_config import generate_portkey_config
 
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,
93
+ # default_headers=createHeaders(
94
+ # api_key=os.getenv("PORTKEY_API_KEY") or None,
95
+ # config=portkey_config
96
+ # ),
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,
111
  storage=storage,
src/libs/rpc_client.py CHANGED
@@ -10,7 +10,7 @@ async def rpc_call(
10
  method_name: str, # The name of the RPC method to be called
11
  params: Optional[Union[dict, list]] = None, # Optional parameters for the RPC method
12
  url: str = rpc_server_url, # The URL of the RPC server
13
- timeout: int = 60 # Timeout in seconds
14
  ) -> dict: # Returns the JSON response from the RPC server
15
  """
16
  This function makes an RPC call to the specified URL with the given method name and parameters.
 
10
  method_name: str, # The name of the RPC method to be called
11
  params: Optional[Union[dict, list]] = None, # Optional parameters for the RPC method
12
  url: str = rpc_server_url, # The URL of the RPC server
13
+ timeout: int = 400 # Timeout in seconds
14
  ) -> dict: # Returns the JSON response from the RPC server
15
  """
16
  This function makes an RPC call to the specified URL with the given method name and parameters.
src/tools/crypto_bridge_toolkit.py CHANGED
@@ -45,7 +45,7 @@ class CrossChainSwapTools(Toolkit):
45
  - chainId (int): The ID of the chain.
46
  - amountLD (str): The amount to be swapped, in lowest denomination (e.g., wei for ETH).
47
  - recipient (str): The recipient address.
48
- - user_email (str): The email of the user for whom the wallet is being fetched and used to sign the transaction.
49
  - tokenIn (TokenParams): The input token parameters as structured from: get_cross_chain_swap_token_list. stringify object
50
  - tokenOut (TokenParams): The output token parameters as structured from: get_cross_chain_swap_token_list. stringify object
51
  - chain (str): The EVM chain for which the wallet is being fetched and used to execute this transaction. use chain base as default
 
45
  - chainId (int): The ID of the chain.
46
  - amountLD (str): The amount to be swapped, in lowest denomination (e.g., wei for ETH).
47
  - recipient (str): The recipient address.
48
+ - user_email (str): The email of the user for whom the wallet is being fetched and used to sign the transaction. get enail from user toolkit
49
  - tokenIn (TokenParams): The input token parameters as structured from: get_cross_chain_swap_token_list. stringify object
50
  - tokenOut (TokenParams): The output token parameters as structured from: get_cross_chain_swap_token_list. stringify object
51
  - chain (str): The EVM chain for which the wallet is being fetched and used to execute this transaction. use chain base as default