chore: apply ruff's pyupgrade linter rules to modernize Python code with targeted version (#2419)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List, Union
|
||||
from typing import Any, Union
|
||||
|
||||
import pandas as pd
|
||||
from requests.exceptions import HTTPError, ReadTimeout
|
||||
@@ -10,8 +10,8 @@ from core.tools.tool.builtin_tool import BuiltinTool
|
||||
|
||||
|
||||
class YahooFinanceAnalyticsTool(BuiltinTool):
|
||||
def _invoke(self, user_id: str, tool_parameters: Dict[str, Any]) \
|
||||
-> Union[ToolInvokeMessage, List[ToolInvokeMessage]]:
|
||||
def _invoke(self, user_id: str, tool_parameters: dict[str, Any]) \
|
||||
-> Union[ToolInvokeMessage, list[ToolInvokeMessage]]:
|
||||
"""
|
||||
invoke tools
|
||||
"""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, List, Union
|
||||
from typing import Any, Union
|
||||
|
||||
import yfinance
|
||||
from requests.exceptions import HTTPError, ReadTimeout
|
||||
@@ -8,8 +8,8 @@ from core.tools.tool.builtin_tool import BuiltinTool
|
||||
|
||||
|
||||
class YahooFinanceSearchTickerTool(BuiltinTool):
|
||||
def _invoke(self,user_id: str, tool_parameters: Dict[str, Any]) \
|
||||
-> Union[ToolInvokeMessage, List[ToolInvokeMessage]]:
|
||||
def _invoke(self,user_id: str, tool_parameters: dict[str, Any]) \
|
||||
-> Union[ToolInvokeMessage, list[ToolInvokeMessage]]:
|
||||
'''
|
||||
invoke tools
|
||||
'''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, List, Union
|
||||
from typing import Any, Union
|
||||
|
||||
from requests.exceptions import HTTPError, ReadTimeout
|
||||
from yfinance import Ticker
|
||||
@@ -8,8 +8,8 @@ from core.tools.tool.builtin_tool import BuiltinTool
|
||||
|
||||
|
||||
class YahooFinanceSearchTickerTool(BuiltinTool):
|
||||
def _invoke(self, user_id: str, tool_parameters: Dict[str, Any]) \
|
||||
-> Union[ToolInvokeMessage, List[ToolInvokeMessage]]:
|
||||
def _invoke(self, user_id: str, tool_parameters: dict[str, Any]) \
|
||||
-> Union[ToolInvokeMessage, list[ToolInvokeMessage]]:
|
||||
"""
|
||||
invoke tools
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user