Skip to content

Commit

Permalink
Add doc about tool_cn,start_cn and memory,fix#391
Browse files Browse the repository at this point in the history
  • Loading branch information
杨堃 authored and 杨堃 committed Apr 10, 2024
1 parent 79bf5b2 commit a648d3b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/get_started/quickstart_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ agent结合了大型语言模型(LLM)以及特定任务的工具,并利用
- 样本代码使用了 qwen-max 模型、绘图工具和天气预报工具。
- 使用 qwen-max 模型需要将示例中的 YOUR_DASHSCOPE_API_KEY 替换为您的 API-KEY,以便代码正常运行。您的 YOUR_DASHSCOPE_API_KEY 可以在[这里](https://help.aliyun.com/zh/dashscope/developer-reference/activate-dashscope-and-create-an-api-key)获得。绘图工具也调用了 DASHSCOPE API(wanx),因此不需要额外配置。
- 在使用天气预报工具时,需要将示例中的 YOUR_AMAP_TOKEN 替换为您的高德天气 API-KEY,以便代码能够正常运行。您的 YOUR_AMAP_TOKEN 可以在[这里](https://lbs.amap.com/api/javascript-api-v2/guide/services/weather)获得。

```Python
# 配置环境变量;如果您已经提前将api-key提前配置到您的运行环境中,可以省略这个步骤
import os
Expand Down Expand Up @@ -52,4 +52,4 @@ Action Input: {"text": "朝阳区城市风光", "resolution": "1024*1024"}
目前,朝阳区的天气状况为阴天,气温为1度。同时,我已为你生成了一张朝阳区的城市风光图,如下所示:

![](https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/1d/45/20240204/3ab595ad/96d55ca6-6550-4514-9013-afe0f917c7ac-1.jpg?Expires=1707123521&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=RsJRt7zsv2y4kg7D9QtQHuVkXZY%3D)
```
```
12 changes: 6 additions & 6 deletions docs/modules/memory_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ memory可以通过读取本地文件来创建Langchain VectorStore来实现调

下载本地语料库
```shell
wget -P /root/you_data/ https://modelscope.oss-cn-beijing.aliyuncs.com/resource/agent/modelscope_qa.txt
wget -P /root/you_data/ https://modelscope.oss-cn-beijing.aliyuncs.com/resource/agent/modelscope_qa.txt
```

agent实现调用本地知识库进行回答
Expand All @@ -44,7 +44,7 @@ from modelscope_agent.agents import RolePlay
role_template = '你扮演一个python专家,需要给出解决方案'

llm_config = {
'model': 'qwen-max',
'model': 'qwen-max',
'model_server': 'dashscope',
}

Expand Down Expand Up @@ -81,7 +81,7 @@ from modelscope_agent.agents import RolePlay
role_template = '你扮演一个历史人物专家,了解从古至今的历史人物'

llm_config = {
'model': 'qwen-max',
'model': 'qwen-max',
'model_server': 'dashscope',
}

Expand Down Expand Up @@ -134,7 +134,7 @@ from modelscope_agent.agents import RolePlay
role_template = '你扮演一个明星人物专家,了解从古至今的电影明星'

llm_config = {
'model': 'qwen-max',
'model': 'qwen-max',
'model_server': 'dashscope',
}

Expand Down Expand Up @@ -165,7 +165,7 @@ memory.save_history()
role_template = '你扮演一个电影专家,了解从古至今的电影'

llm_config = {
'model': 'qwen-max',
'model': 'qwen-max',
'model_server': 'dashscope',
}

Expand All @@ -180,4 +180,4 @@ text = ''
for chunk in response:
text += chunk
print(text)
```
```
4 changes: 2 additions & 2 deletions docs/modules/tool_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TOOL_REGISTRY['terminal'] = LangchainTool
role_template = '你是一个助手,试图用工具帮助人类解决问题。'

llm_config = {
'model': 'qwen-max',
'model': 'qwen-max',
'model_server': 'dashscope',
}

Expand All @@ -70,4 +70,4 @@ bot = RolePlay(function_list=function_list,llm=llm_config,instruction=role_templ
- `image_enhancement`: [追影放大镜](https://github.com/dreamoving/Phantom). [DASHSCOPE_API_KEY](https://help.aliyun.com/zh/dashscope/developer-reference/activate-dashscope-and-create-an-api-key) 需要在环境变量中进行配置。
- `text-address`: [地理编码](https://www.modelscope.cn/models/iic/mgeo_geographic_elements_tagging_chinese_base/summary). [MODELSCOPE_API_TOKEN](https://www.modelscope.cn/my/myaccesstoken) 需要在环境变量中进行配置。
- `speech-generation`: [语音生成](https://www.modelscope.cn/models/iic/speech_sambert-hifigan_tts_zh-cn_16k/summary). [MODELSCOPE_API_TOKEN](https://www.modelscope.cn/my/myaccesstoken) 需要在环境变量中进行配置。
- `video-generation`: [视频生成](https://www.modelscope.cn/models/iic/text-to-video-synthesis/summary). [MODELSCOPE_API_TOKEN](https://www.modelscope.cn/my/myaccesstoken) 需要在环境变量中进行配置。
- `video-generation`: [视频生成](https://www.modelscope.cn/models/iic/text-to-video-synthesis/summary). [MODELSCOPE_API_TOKEN](https://www.modelscope.cn/my/myaccesstoken) 需要在环境变量中进行配置。

0 comments on commit a648d3b

Please sign in to comment.