This commit is contained in:
Ricky
2024-01-31 11:58:07 +08:00
committed by GitHub
parent 9e37702d24
commit 2660fbaa20
58 changed files with 312 additions and 312 deletions

View File

@@ -16,7 +16,7 @@ class ChartProvider(BuiltinToolProviderController):
}
).invoke(
user_id='',
tool_paramters={
tool_parameters={
"data": "1,3,5,7,9,2,4,6,8,10",
},
)

View File

@@ -6,9 +6,9 @@ import io
from typing import Any, Dict, List, Union
class BarChartTool(BuiltinTool):
def _invoke(self, user_id: str, tool_paramters: Dict[str, Any]) \
def _invoke(self, user_id: str, tool_parameters: Dict[str, Any]) \
-> Union[ToolInvokeMessage, List[ToolInvokeMessage]]:
data = tool_paramters.get('data', '')
data = tool_parameters.get('data', '')
if not data:
return self.create_text_message('Please input data')
data = data.split(';')
@@ -19,7 +19,7 @@ class BarChartTool(BuiltinTool):
else:
data = [float(i) for i in data]
axis = tool_paramters.get('x_axis', None) or None
axis = tool_parameters.get('x_axis', None) or None
if axis:
axis = axis.split(';')
if len(axis) != len(data):

View File

@@ -8,14 +8,14 @@ from typing import Any, Dict, List, Union
class LinearChartTool(BuiltinTool):
def _invoke(self,
user_id: str,
tool_paramters: Dict[str, Any],
tool_parameters: Dict[str, Any],
) -> Union[ToolInvokeMessage, List[ToolInvokeMessage]]:
data = tool_paramters.get('data', '')
data = tool_parameters.get('data', '')
if not data:
return self.create_text_message('Please input data')
data = data.split(';')
axis = tool_paramters.get('x_axis', None) or None
axis = tool_parameters.get('x_axis', None) or None
if axis:
axis = axis.split(';')
if len(axis) != len(data):

View File

@@ -8,13 +8,13 @@ from typing import Any, Dict, List, Union
class PieChartTool(BuiltinTool):
def _invoke(self,
user_id: str,
tool_paramters: Dict[str, Any],
tool_parameters: Dict[str, Any],
) -> Union[ToolInvokeMessage, List[ToolInvokeMessage]]:
data = tool_paramters.get('data', '')
data = tool_parameters.get('data', '')
if not data:
return self.create_text_message('Please input data')
data = data.split(';')
categories = tool_paramters.get('categories', None) or None
categories = tool_parameters.get('categories', None) or None
# if all data is int, convert to int
if all([i.isdigit() for i in data]):