Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug/fix the python import error of the sample tool #603

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/source/modules/tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 1 addition & 2 deletions docs/source_en/modules/tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
16 changes: 12 additions & 4 deletions examples/agents/data_science_assistant.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -111,7 +113,9 @@
"cell_type": "markdown",
"id": "8c8defa3",
"metadata": {},
"source": "### 构建DataScienceAssistant"
"source": [
"### 构建DataScienceAssistant"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -154,15 +158,19 @@
{
"metadata": {},
"cell_type": "markdown",
"source": "### 运行DataScienceAssistant",
"source": [
"### 运行DataScienceAssistant"
],
"id": "ecaf880ce9940581"
},
{
"metadata": {},
"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"
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/tools/local_new_tool.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions examples/tools/register_new_tool.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading