diff --git a/docs/source/modules/tool.md b/docs/source/modules/tool.md index 75ca594bb..2f3f3fca7 100644 --- a/docs/source/modules/tool.md +++ b/docs/source/modules/tool.md @@ -5,8 +5,7 @@ 此外,您还可以通过继承基本工具来自定义工具,并根据预定义的模式定义名称、描述和参数。您可以根据自己的需求实现`call()`。提供了一个自定义工具的示例: ```python -from modelscope_agent.tools.base import BaseTool -from modelscope_agent.tools import register_tool +from modelscope_agent.tools.base import BaseTool, register_tool # 注册自定义工具名称 @register_tool('RenewInstance') diff --git a/docs/source_en/modules/tool.md b/docs/source_en/modules/tool.md index 3eb9e915c..6f8c5bcd8 100644 --- a/docs/source_en/modules/tool.md +++ b/docs/source_en/modules/tool.md @@ -5,8 +5,7 @@ We offer a variety of multi-domain default pipeline tools integrated within Mode Additionally, you can customize tools by inheriting the basic ones and define the name, description, and parameters according to predefined schemas. You can implement `call()` as per your own requirements. An example of a custom tool is provided: ```python -from modelscope_agent.tools.base import BaseTool -from modelscope_agent.tools import register_tool +from modelscope_agent.tools.base import BaseTool, register_tool # Register a custom tool name. @register_tool('RenewInstance') diff --git a/examples/agents/data_science_assistant.ipynb b/examples/agents/data_science_assistant.ipynb index f2ac656a7..071475a1e 100644 --- a/examples/agents/data_science_assistant.ipynb +++ b/examples/agents/data_science_assistant.ipynb @@ -3,7 +3,9 @@ { "metadata": {}, "cell_type": "markdown", - "source": "Data Science Assistant 介绍请参考:https://github.com/modelscope/modelscope-agent/blob/master/docs/source/agents/data_science_assistant.md", + "source": [ + "Data Science Assistant 介绍请参考:https://github.com/modelscope/modelscope-agent/blob/master/docs/source/agents/data_science_assistant.md" + ], "id": "6806543b7c528e4" }, { @@ -111,7 +113,9 @@ "cell_type": "markdown", "id": "8c8defa3", "metadata": {}, - "source": "### 构建DataScienceAssistant" + "source": [ + "### 构建DataScienceAssistant" + ] }, { "cell_type": "code", @@ -154,7 +158,9 @@ { "metadata": {}, "cell_type": "markdown", - "source": "### 运行DataScienceAssistant", + "source": [ + "### 运行DataScienceAssistant" + ], "id": "ecaf880ce9940581" }, { @@ -162,7 +168,9 @@ "cell_type": "code", "outputs": [], "execution_count": null, - "source": "data_science_assistant.run(\"This is a customers financial dataset. Your goal is to predict the value of transactions for each potential customer. The target column is target. Perform data analysis, data preprocessing, feature engineering, and modeling to predict the target. Report RMSLE on the eval data. Train data path: './dataset/08_santander-value-prediction-challenge/split_train.csv', eval data path: './dataset/08_santander-value-prediction-challenge/split_eval.csv' .\")", + "source": [ + "data_science_assistant.run(\"This is a customers financial dataset. Your goal is to predict the value of transactions for each potential customer. The target column is target. Perform data analysis, data preprocessing, feature engineering, and modeling to predict the target. Report RMSLE on the eval data. Train data path: './dataset/08_santander-value-prediction-challenge/split_train.csv', eval data path: './dataset/08_santander-value-prediction-challenge/split_eval.csv' .\")" + ], "id": "fafed4d52f259f79" }, { diff --git a/examples/tools/local_new_tool.ipynb b/examples/tools/local_new_tool.ipynb index d7455f85b..595dbba3e 100644 --- a/examples/tools/local_new_tool.ipynb +++ b/examples/tools/local_new_tool.ipynb @@ -201,8 +201,8 @@ }, "outputs": [], "source": [ - "from modelscope_agent.tools.base import BaseTool\n", - "from modelscope_agent.tools import register_tool\n", + "from modelscope_agent.tools.base import BaseTool, register_tool\n", + "\n", "import requests\n", "import json\n", "\n", diff --git a/examples/tools/register_new_tool.ipynb b/examples/tools/register_new_tool.ipynb index b60427499..a378fda26 100644 --- a/examples/tools/register_new_tool.ipynb +++ b/examples/tools/register_new_tool.ipynb @@ -111,8 +111,7 @@ "metadata": {}, "outputs": [], "source": [ - "from modelscope_agent.tools.base import BaseTool\n", - "from modelscope_agent.tools import register_tool\n", + "from modelscope_agent.tools.base import BaseTool, register_tool\n", "\n", "@register_tool('RenewInstance')\n", "class AliyunRenewInstanceTool(BaseTool):\n", diff --git a/modelscope_agent/tools/rapidapi_tools/Modelscope/text_ie_tool.py b/modelscope_agent/tools/rapidapi_tools/Modelscope/text_ie_tool.py index 2e726956e..bbe9cb975 100644 --- a/modelscope_agent/tools/rapidapi_tools/Modelscope/text_ie_tool.py +++ b/modelscope_agent/tools/rapidapi_tools/Modelscope/text_ie_tool.py @@ -1,7 +1,7 @@ from collections import defaultdict from typing import Union -from modelscope_agent.tools import register_tool +from modelscope_agent.tools.base import register_tool from modelscope.utils.constant import Tasks from .pipeline_tool import ModelscopepipelinetoolForAlphaUmi