Skip to content

Commit

Permalink
TreeMind test case中增加sleep操作,规避QPS超限报错 (baidubce#588)
Browse files Browse the repository at this point in the history
* 优化TreeMind组件输出视觉效果

* 优化TreeMind组件视觉输出效果

* test case中增加sleep操作,规避QPS超限报错

---------

Co-authored-by: yepeiwen01 <[email protected]>
  • Loading branch information
peiwenYe and yepeiwen01 authored Nov 11, 2024
1 parent 29655a3 commit 4d1ea98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/core/components/tree_mind/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ out = treemind.run(msg)
print(out.content)

>>>
{'result': '思维导图已经为您生成好了,您可以点击'img_link'对应的链接查看,如果您觉得这个思维导图还不够完美,或者您的想法需要更自由地表达,点击'edit_link'对应的链接,对思维导图变形、变色、变内容、甚至可以添加新的元素, 'img_link': 'https://static.shutu.cn/shutu/static/open6e/2024/05/24/dbd67eddec13f3a6a75857b9c6e06d85.jpeg', 'edit_link': 'https://gapi.shutu.cn/ai/edit-mind-url?works_guid=open5ab4af46187ff7c138fcd95de09efe92_bdappbuilder'}
{'result': '思维导图已经为您生成好了,您可以点击'img_link'对应的链接查看,如果您觉得这个思维导图还不够完美,或者您的想法需要更自由地表达,点击'edit_link'对应的链接,对思维导图变形、变色、变内容、甚至可以添加新的元素,
'img_link': 'https://static.shutu.cn/shutu/static/open6e/2024/05/24/dbd67eddec13f3a6a75857b9c6e06d85.jpeg',
'edit_link': 'https://gapi.shutu.cn/ai/edit-mind-url?works_guid=open5ab4af46187ff7c138fcd95de09efe92_bdappbuilder'}
```

生成的思维导图:<br/>![图片url](https://bj.bcebos.com/appbuilder-sdk-components/TreeMind-年终总结思维导图.jpeg)
Expand All @@ -59,6 +61,6 @@ os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN"

### 响应参数

| 参数名称 |参数类型 | 描述 | 示例 |
| 参数名称 |参数类型 | 描述 | 示例值 |
|-------------|--------|------|------|
| resp | obj:`Message` | 组件返回结果 | Message(name=msg, content={'result': '生成的思维导图:xxx。思维导图已经为您生成好了,如果您觉得这个思维导图还不够完美,或者您的想法需要更自由地表达,点击编辑按钮,对思维导图变形、变色、变内容、甚至可以添加新的元素,您可以通过这个链接编辑:xxx。', 'img_link': 'xxx', 'edit_link': 'xxx'}, mtype=dict) |
2 changes: 2 additions & 0 deletions python/tests/test_treemind.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def setUp(self):
def test_treemind_component_tool_eval(self):
"""测试tool_eval方法的返回值是否正确
"""
import time
time.sleep(1)
result = self.tm.tool_eval(query=self.query)
self.assertIsNotNone(result)
for r in result:
Expand Down

0 comments on commit 4d1ea98

Please sign in to comment.