From 75324c06b2e349684de4b2f9d9372f2e8b2ef0a3 Mon Sep 17 00:00:00 2001 From: ideoutrea Date: Thu, 7 Mar 2024 11:33:48 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E6=B5=81=E6=B0=B4=E7=BA=BF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 557f64d3d..b18600784 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -4,6 +4,7 @@ name: Python package on: + workflow_dispatch: push: branches: [ "master" ] pull_request: From 9230893a6bf140d3b3c37100f24b5d2744092bd7 Mon Sep 17 00:00:00 2001 From: hermitgreen Date: Sat, 9 Mar 2024 12:07:46 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=BF=AE=E5=A4=8Djson?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=9A=84visible=5Fscope?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/components/handwrite_ocr/component.py | 14 ++++++++++++-- .../core/components/mix_card_ocr/component.py | 14 ++++++++++++-- .../core/components/qrcode_ocr/component.py | 15 +++++++++++++-- appbuilder/core/components/table_ocr/component.py | 15 +++++++++++++-- 4 files changed, 50 insertions(+), 8 deletions(-) diff --git a/appbuilder/core/components/handwrite_ocr/component.py b/appbuilder/core/components/handwrite_ocr/component.py index 3d2a82f48..7753f1671 100644 --- a/appbuilder/core/components/handwrite_ocr/component.py +++ b/appbuilder/core/components/handwrite_ocr/component.py @@ -122,10 +122,20 @@ def tool_eval(self, name: str, streaming: bool, **kwargs): response = self._recognize(req) result[file_name] = [w.words for w in response.words_result] + result = json.dumps(result, ensure_ascii=False) if streaming: - yield json.dumps(result, ensure_ascii=False) + yield { + "type": "text", + "text": result, + "visible_scope": 'llm', + } + yield { + "type": "text", + "text": "", + "visible_scope": "user", + } else: - return json.dumps(result, ensure_ascii=False) + return result def _recognize(self, request: HandwriteOCRRequest, timeout: float = None, retry: int = 0) -> HandwriteOCRResponse: r"""调用底层接口进行通用文字识别 diff --git a/appbuilder/core/components/mix_card_ocr/component.py b/appbuilder/core/components/mix_card_ocr/component.py index 93f352bbd..5e6704eba 100644 --- a/appbuilder/core/components/mix_card_ocr/component.py +++ b/appbuilder/core/components/mix_card_ocr/component.py @@ -183,7 +183,17 @@ def tool_eval(self, name: str, streaming: bool, **kwargs): out.direction = response.direction result[file_name] = out.dict() + result = json.dumps(result, ensure_ascii=False) if streaming: - yield json.dumps(result, ensure_ascii=False) + yield { + "type": "text", + "text": result, + "visible_scope": 'llm', + } + yield { + "type": "text", + "text": "", + "visible_scope": "user", + } else: - return json.dumps(result, ensure_ascii=False) + return result diff --git a/appbuilder/core/components/qrcode_ocr/component.py b/appbuilder/core/components/qrcode_ocr/component.py index 5edb5a0b8..95628b6a6 100644 --- a/appbuilder/core/components/qrcode_ocr/component.py +++ b/appbuilder/core/components/qrcode_ocr/component.py @@ -168,7 +168,18 @@ def tool_eval(self, name: str, streaming: bool, **kwargs): req.location = location resp = self._recognize(req) result[file_name] = [item["text"] for item in proto.Message.to_dict(resp).get("codes_result", [])] + + result = json.dumps(result, ensure_ascii=False) if streaming: - yield json.dumps(result, ensure_ascii=False) + yield { + "type": "text", + "text": result, + "visible_scope": 'llm', + } + yield { + "type": "text", + "text": "", + "visible_scope": "user", + } else: - return json.dumps(result, ensure_ascii=False) + return result diff --git a/appbuilder/core/components/table_ocr/component.py b/appbuilder/core/components/table_ocr/component.py index 0947d36be..29326772c 100644 --- a/appbuilder/core/components/table_ocr/component.py +++ b/appbuilder/core/components/table_ocr/component.py @@ -194,7 +194,18 @@ def tool_eval(self, name: str, streaming: bool, **kwargs): tables_result = proto.Message.to_dict(resp)["tables_result"] markdowns = self.get_table_markdown(tables_result) result[file_name] = markdowns + + result = json.dumps(result, ensure_ascii=False) if streaming: - yield json.dumps(result, ensure_ascii=False) + yield { + "type": "text", + "text": result, + "visible_scope": 'llm', + } + yield { + "type": "text", + "text": "", + "visible_scope": "user", + } else: - return json.dumps(result, ensure_ascii=False) + return result From db55d35a90d50be002623b57ba57660a0e89981a Mon Sep 17 00:00:00 2001 From: zhongsonghui Date: Sat, 9 Mar 2024 12:33:06 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E9=87=8D=E6=9E=84=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appbuilder/core/components/animal_recognize/component.py | 7 +------ appbuilder/core/components/image_understand/component.py | 7 +------ appbuilder/core/components/plant_recognize/component.py | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/appbuilder/core/components/animal_recognize/component.py b/appbuilder/core/components/animal_recognize/component.py index e41bb3050..239711ad8 100644 --- a/appbuilder/core/components/animal_recognize/component.py +++ b/appbuilder/core/components/animal_recognize/component.py @@ -162,8 +162,6 @@ def _recognize_w_post_process(self, img_path, img_url, file_urls) -> str: 返回: str: 动物识别结果,包括识别出的动物类别和相应的置信度信息 """ - if not img_path and not img_url: - return "Image path and image url cannot be all empty" req = AnimalRecognitionRequest() if img_path in file_urls: req.url = file_urls[img_path] @@ -171,10 +169,7 @@ def _recognize_w_post_process(self, img_path, img_url, file_urls) -> str: req.url = img_url req.top_num = 6 req.baike_num = 0 - try: - result = self._recognize(req) - except Exception as ex: - return "API call failed: {}".format(str(ex)) + result = self._recognize(req) result_dict = proto.Message.to_dict(result) rec_res = "模型识别结果为:\n" for rec_info in result_dict['result']: diff --git a/appbuilder/core/components/image_understand/component.py b/appbuilder/core/components/image_understand/component.py index 629a1b0d2..66c9be424 100644 --- a/appbuilder/core/components/image_understand/component.py +++ b/appbuilder/core/components/image_understand/component.py @@ -183,18 +183,13 @@ def _recognize_w_post_process(self, img_path, img_url, file_urls, question="图 返回: str: 图片内容理解结果 """ - if question == "": - return "Question cannot be empty" req = ImageUnderstandRequest() req.question = question if img_path in file_urls: req.url = file_urls[img_path] if img_url: req.url = img_url - try: - response = self.__recognize(req) - except Exception as ex: - return "API call failed: {}".format(str(ex)) + response = self.__recognize(req) description_to_llm = response.result.description_to_llm description_processed = description_to_llm.rsplit("。", 2)[0] return description_processed diff --git a/appbuilder/core/components/plant_recognize/component.py b/appbuilder/core/components/plant_recognize/component.py index cc6d4165c..a503cf519 100644 --- a/appbuilder/core/components/plant_recognize/component.py +++ b/appbuilder/core/components/plant_recognize/component.py @@ -167,8 +167,6 @@ def _recognize_w_post_process(self, img_path, img_url, file_urls): 返回: str: 植物识别结果,包括识别出的动物类别和相应的置信度信息 """ - if not img_path and not img_url: - return "Image path and image url cannot be all empty" req = PlantRecognitionRequest() if img_path in file_urls: req.url = file_urls[img_path] @@ -176,10 +174,7 @@ def _recognize_w_post_process(self, img_path, img_url, file_urls): req.url = img_url req.top_num = 6 req.baike_num = 0 - try: - result = self.__recognize(req) - except Exception as ex: - return "API call failed: {}".format(str(ex)) + result = self.__recognize(req) result_dict = proto.Message.to_dict(result) rec_res = "模型识别结果为:\n" for rec_info in result_dict['result']: From 4578508642918ad3b67d2348f20747fc450ea94e Mon Sep 17 00:00:00 2001 From: hermitgreen Date: Sun, 10 Mar 2024 12:09:18 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E6=96=87=E7=94=9F=E5=9B=BEqps=20limit?= =?UTF-8?q?=E6=97=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appbuilder/core/components/text_to_image/component.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appbuilder/core/components/text_to_image/component.py b/appbuilder/core/components/text_to_image/component.py index 42b8525a9..1824b9bc6 100644 --- a/appbuilder/core/components/text_to_image/component.py +++ b/appbuilder/core/components/text_to_image/component.py @@ -203,7 +203,7 @@ def tool_eval( 'text': result.content['img_urls'][0], } except Exception as e: - result = f'绘图时发生错误:{e}' + raise AppBuilderServerException(f'绘图时发生错误:{e}') if streaming: yield result else: From 252c5ff0bb26fd57d21e97539b309eb9d6d3e2c9 Mon Sep 17 00:00:00 2001 From: wangmin24 Date: Mon, 11 Mar 2024 11:46:43 +0800 Subject: [PATCH 05/18] =?UTF-8?q?wangmin:markdown=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/animal_recognize/README.md | 2 +- appbuilder/core/components/asr/README.md | 2 +- .../core/components/dish_recognize/README.md | 2 +- .../components/doc_crop_enhance/README.md | 2 +- .../core/components/doc_parser/README.md | 2 +- .../core/components/doc_splitter/README.md | 4 ++-- .../core/components/embeddings/README.md | 2 +- .../core/components/extract_table/README.md | 2 +- .../core/components/general_ocr/README.md | 2 +- .../core/components/handwrite_ocr/README.md | 2 +- .../components/image_understand/README.md | 2 +- .../components/landmark_recognize/README.md | 2 +- .../components/llms/dialog_summary/README.md | 2 +- .../llms/is_complex_query/README.md | 2 +- appbuilder/core/components/llms/mrc/README.md | 2 +- .../core/components/llms/nl2pandas/README.md | 2 +- .../llms/oral_query_generation/README.md | 2 +- .../components/llms/qa_pair_mining/README.md | 2 +- .../llms/query_decomposition/README.md | 2 +- .../components/llms/query_rewrite/README.md | 2 +- .../components/llms/style_rewrite/README.md | 2 +- .../components/llms/style_writing/README.md | 2 +- .../components/llms/tag_extraction/README.md | 2 +- appbuilder/core/components/matching/README.md | 2 +- .../core/components/mix_card_ocr/README.md | 2 +- .../components/object_recognize/README.md | 2 +- .../core/components/plant_recognize/README.md | 2 +- .../core/components/qrcode_ocr/README.md | 2 +- .../rag_with_baidu_search/README.md | 2 +- .../core/components/retriever/README.md | 2 +- .../core/components/table_ocr/README.md | 2 +- .../core/components/text_to_image/README.md | 2 +- .../core/components/translate/README.md | 2 +- appbuilder/core/components/tts/README.md | 2 +- appbuilder/core/console/dataset/README.md | 2 +- appbuilder/core/console/rag/README.md | 2 +- docs/get_model_list.md | 2 +- docs/tools/markdown_parse.py | 22 +++++++++++++++---- 38 files changed, 56 insertions(+), 42 deletions(-) diff --git a/appbuilder/core/components/animal_recognize/README.md b/appbuilder/core/components/animal_recognize/README.md index 6341420cd..3d42221d9 100644 --- a/appbuilder/core/components/animal_recognize/README.md +++ b/appbuilder/core/components/animal_recognize/README.md @@ -45,7 +45,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/asr/README.md b/appbuilder/core/components/asr/README.md index 5a63a917f..14fb73118 100644 --- a/appbuilder/core/components/asr/README.md +++ b/appbuilder/core/components/asr/README.md @@ -38,7 +38,7 @@ print(out.content) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/dish_recognize/README.md b/appbuilder/core/components/dish_recognize/README.md index 038b3c72d..16f6af62f 100644 --- a/appbuilder/core/components/dish_recognize/README.md +++ b/appbuilder/core/components/dish_recognize/README.md @@ -39,7 +39,7 @@ print(resp.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/doc_crop_enhance/README.md b/appbuilder/core/components/doc_crop_enhance/README.md index 375914b94..34d3900a1 100644 --- a/appbuilder/core/components/doc_crop_enhance/README.md +++ b/appbuilder/core/components/doc_crop_enhance/README.md @@ -43,7 +43,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/doc_parser/README.md b/appbuilder/core/components/doc_parser/README.md index 8df4cbf4e..416bb887b 100644 --- a/appbuilder/core/components/doc_parser/README.md +++ b/appbuilder/core/components/doc_parser/README.md @@ -52,7 +52,7 @@ print(parse_result.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/doc_splitter/README.md b/appbuilder/core/components/doc_splitter/README.md index 3af147f7d..1ccc07f2d 100644 --- a/appbuilder/core/components/doc_splitter/README.md +++ b/appbuilder/core/components/doc_splitter/README.md @@ -57,7 +57,7 @@ print(res_paras.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" @@ -128,7 +128,7 @@ print(res_paras.content) ## 参数说明: ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/embeddings/README.md b/appbuilder/core/components/embeddings/README.md index 052fa21c8..3c66b8312 100644 --- a/appbuilder/core/components/embeddings/README.md +++ b/appbuilder/core/components/embeddings/README.md @@ -103,7 +103,7 @@ print(outs.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/extract_table/README.md b/appbuilder/core/components/extract_table/README.md index 02c0d7bd1..3dd48a4d9 100644 --- a/appbuilder/core/components/extract_table/README.md +++ b/appbuilder/core/components/extract_table/README.md @@ -52,7 +52,7 @@ logger.info("Tables: {}".format( ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/general_ocr/README.md b/appbuilder/core/components/general_ocr/README.md index 4328ee801..7063e3f47 100644 --- a/appbuilder/core/components/general_ocr/README.md +++ b/appbuilder/core/components/general_ocr/README.md @@ -38,7 +38,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/handwrite_ocr/README.md b/appbuilder/core/components/handwrite_ocr/README.md index 4fe9b6a83..32669779b 100644 --- a/appbuilder/core/components/handwrite_ocr/README.md +++ b/appbuilder/core/components/handwrite_ocr/README.md @@ -44,7 +44,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/components/image_understand/README.md b/appbuilder/core/components/image_understand/README.md index 1c485b900..0dd9bfc3c 100644 --- a/appbuilder/core/components/image_understand/README.md +++ b/appbuilder/core/components/image_understand/README.md @@ -37,7 +37,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os os.environ["APPBUILDER_TOKEN"] = "..." diff --git a/appbuilder/core/components/landmark_recognize/README.md b/appbuilder/core/components/landmark_recognize/README.md index 6d3750e0b..06abfcdb1 100644 --- a/appbuilder/core/components/landmark_recognize/README.md +++ b/appbuilder/core/components/landmark_recognize/README.md @@ -44,7 +44,7 @@ print(out.content) # eg: {"landmark": "尼罗河"} ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/components/llms/dialog_summary/README.md b/appbuilder/core/components/llms/dialog_summary/README.md index d0a5783e1..65de41d55 100644 --- a/appbuilder/core/components/llms/dialog_summary/README.md +++ b/appbuilder/core/components/llms/dialog_summary/README.md @@ -32,7 +32,7 @@ print(answer) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/is_complex_query/README.md b/appbuilder/core/components/llms/is_complex_query/README.md index f842b4e75..9b3a2e911 100644 --- a/appbuilder/core/components/llms/is_complex_query/README.md +++ b/appbuilder/core/components/llms/is_complex_query/README.md @@ -33,7 +33,7 @@ print("Answer: \n{}".format(answer.content)) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/mrc/README.md b/appbuilder/core/components/llms/mrc/README.md index 1a3f46964..489e333d5 100644 --- a/appbuilder/core/components/llms/mrc/README.md +++ b/appbuilder/core/components/llms/mrc/README.md @@ -63,7 +63,7 @@ print(result) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 import os diff --git a/appbuilder/core/components/llms/nl2pandas/README.md b/appbuilder/core/components/llms/nl2pandas/README.md index cd7471856..97afd1781 100644 --- a/appbuilder/core/components/llms/nl2pandas/README.md +++ b/appbuilder/core/components/llms/nl2pandas/README.md @@ -37,7 +37,7 @@ answer = nl2pandas(query, table_info = table_info) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/oral_query_generation/README.md b/appbuilder/core/components/llms/oral_query_generation/README.md index 4989bfa5a..52ec7895e 100644 --- a/appbuilder/core/components/llms/oral_query_generation/README.md +++ b/appbuilder/core/components/llms/oral_query_generation/README.md @@ -33,7 +33,7 @@ print(result) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/qa_pair_mining/README.md b/appbuilder/core/components/llms/qa_pair_mining/README.md index 64e8cd03a..a3fdd5050 100644 --- a/appbuilder/core/components/llms/qa_pair_mining/README.md +++ b/appbuilder/core/components/llms/qa_pair_mining/README.md @@ -36,7 +36,7 @@ print(">>> Output: {}".format(answer.content)) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/query_decomposition/README.md b/appbuilder/core/components/llms/query_decomposition/README.md index f3c459aad..943fa7918 100644 --- a/appbuilder/core/components/llms/query_decomposition/README.md +++ b/appbuilder/core/components/llms/query_decomposition/README.md @@ -33,7 +33,7 @@ print("Answer: \n{}".format(answer.content)) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/query_rewrite/README.md b/appbuilder/core/components/llms/query_rewrite/README.md index a701beee1..2b28dcf3d 100644 --- a/appbuilder/core/components/llms/query_rewrite/README.md +++ b/appbuilder/core/components/llms/query_rewrite/README.md @@ -32,7 +32,7 @@ print(answer) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/style_rewrite/README.md b/appbuilder/core/components/llms/style_rewrite/README.md index fa460bb35..35d7e3c02 100644 --- a/appbuilder/core/components/llms/style_rewrite/README.md +++ b/appbuilder/core/components/llms/style_rewrite/README.md @@ -42,7 +42,7 @@ answer = style_rewrite(appbuilder.Message("文心大模型发布新版"), style= ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/style_writing/README.md b/appbuilder/core/components/llms/style_writing/README.md index b84817f92..09c18ddfe 100644 --- a/appbuilder/core/components/llms/style_writing/README.md +++ b/appbuilder/core/components/llms/style_writing/README.md @@ -41,7 +41,7 @@ print(answer) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/tag_extraction/README.md b/appbuilder/core/components/llms/tag_extraction/README.md index 34a348d06..7515fcb86 100644 --- a/appbuilder/core/components/llms/tag_extraction/README.md +++ b/appbuilder/core/components/llms/tag_extraction/README.md @@ -40,7 +40,7 @@ result = tag_extraction(appbuilder.Message("从这段文本中抽取关键标签 ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/matching/README.md b/appbuilder/core/components/matching/README.md index a9dec8531..08a679f90 100644 --- a/appbuilder/core/components/matching/README.md +++ b/appbuilder/core/components/matching/README.md @@ -46,7 +46,7 @@ print(contexts_matched.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/mix_card_ocr/README.md b/appbuilder/core/components/mix_card_ocr/README.md index dfe2e3734..f1a09040b 100644 --- a/appbuilder/core/components/mix_card_ocr/README.md +++ b/appbuilder/core/components/mix_card_ocr/README.md @@ -47,7 +47,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/components/object_recognize/README.md b/appbuilder/core/components/object_recognize/README.md index 9e019de9a..c72f3a347 100644 --- a/appbuilder/core/components/object_recognize/README.md +++ b/appbuilder/core/components/object_recognize/README.md @@ -40,7 +40,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/plant_recognize/README.md b/appbuilder/core/components/plant_recognize/README.md index 2ea13cc08..f7781526e 100644 --- a/appbuilder/core/components/plant_recognize/README.md +++ b/appbuilder/core/components/plant_recognize/README.md @@ -41,7 +41,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/components/qrcode_ocr/README.md b/appbuilder/core/components/qrcode_ocr/README.md index 0c54b3fb7..8093a4b22 100644 --- a/appbuilder/core/components/qrcode_ocr/README.md +++ b/appbuilder/core/components/qrcode_ocr/README.md @@ -46,7 +46,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/rag_with_baidu_search/README.md b/appbuilder/core/components/rag_with_baidu_search/README.md index 0ddbc9688..e0606575e 100644 --- a/appbuilder/core/components/rag_with_baidu_search/README.md +++ b/appbuilder/core/components/rag_with_baidu_search/README.md @@ -43,7 +43,7 @@ print(result) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/components/retriever/README.md b/appbuilder/core/components/retriever/README.md index 336c623d6..fa0a74df5 100644 --- a/appbuilder/core/components/retriever/README.md +++ b/appbuilder/core/components/retriever/README.md @@ -49,7 +49,7 @@ vector_index.delete_all_segments() ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/table_ocr/README.md b/appbuilder/core/components/table_ocr/README.md index f172685d7..9d00d0f75 100644 --- a/appbuilder/core/components/table_ocr/README.md +++ b/appbuilder/core/components/table_ocr/README.md @@ -47,7 +47,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/text_to_image/README.md b/appbuilder/core/components/text_to_image/README.md index 5d6ae996c..18f0a3afe 100644 --- a/appbuilder/core/components/text_to_image/README.md +++ b/appbuilder/core/components/text_to_image/README.md @@ -31,7 +31,7 @@ print(out.content) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/translate/README.md b/appbuilder/core/components/translate/README.md index f34f8c1f0..5391f154d 100644 --- a/appbuilder/core/components/translate/README.md +++ b/appbuilder/core/components/translate/README.md @@ -43,7 +43,7 @@ print(resp.content) ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 diff --git a/appbuilder/core/components/tts/README.md b/appbuilder/core/components/tts/README.md index 5a47e2a85..15f8b03d3 100644 --- a/appbuilder/core/components/tts/README.md +++ b/appbuilder/core/components/tts/README.md @@ -46,7 +46,7 @@ print("成功将文本转语音,wav格式文件已写入:{}".format(wav_samp ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/console/dataset/README.md b/appbuilder/core/console/dataset/README.md index 0c1fedcbd..7f84a8e99 100644 --- a/appbuilder/core/console/dataset/README.md +++ b/appbuilder/core/console/dataset/README.md @@ -51,7 +51,7 @@ dataset.delete_documents(document_ids) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/console/rag/README.md b/appbuilder/core/console/rag/README.md index a67d39926..690bc0517 100644 --- a/appbuilder/core/console/rag/README.md +++ b/appbuilder/core/console/rag/README.md @@ -37,7 +37,7 @@ print(answer.extra) # 获取结果来源 ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/docs/get_model_list.md b/docs/get_model_list.md index c47030785..1482e6e24 100644 --- a/docs/get_model_list.md +++ b/docs/get_model_list.md @@ -19,7 +19,7 @@ print(models) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/docs/tools/markdown_parse.py b/docs/tools/markdown_parse.py index 1237903c8..db82cf3f4 100644 --- a/docs/tools/markdown_parse.py +++ b/docs/tools/markdown_parse.py @@ -49,12 +49,26 @@ "object_recognize": "object_recognize", "plant_recognize": "plant_recognize", "qrcode_ocr": "qrcode_ocr", - "rag_with_baidu_search": "rag_with_baidu_search", + "rag_with_baidu_search": "web_search", "retriever": "retriever", "table_ocr": "table_ocr", - "text_to_image": "text_to_image", + "text_to_image": "image", "translate": "translate", - "tts": "tts_base" + "tts": "tts", + "tts_high": "tts_high", + "tts_audio": "tts_audio", + "code_interpreter": "code_interpreter", + "web_pilot": "web_pilot", + "wolfram_alpha": "wolfram_alpha", + "arxiv": "arxiv", + "product_query": "product_query", + "flight_query": "flight_query", + "query_express_package": "query_express_package", + "bing_image_search": "bing_image_search", + "news_get": "news_get", + "weather_query": "weather_query", + "video_get": "video_get" + } # 循环中的数据 @@ -174,7 +188,7 @@ def parse_file(file_path): sdk_detail_sql = f"insert into sdk_detail(sdk_code, introduce, interface_doc, deploy_package, title) values('{sdk_code}','{introduce}','{interface_doc}',null,'{parsed_content.get('title')}') on conflict(sdk_code) do update set introduce='{introduce}',interface_doc='{interface_doc}',title='{parsed_content.get('title')}';" sdk_detail_sqls.append(sdk_detail_sql) remark = parsed_content.get('remark').replace('\n', '') - sdk_component_sql = f"update sdk_component set name = '{parsed_content.get('name')}',remark='{remark}' where sdk_code = '{sdk_code}';" + sdk_component_sql = f"update sdk_tool set name = '{parsed_content.get('name')}',remark='{remark}' where sdk_code = '{sdk_code}';" sdk_component_sqls.append(sdk_component_sql) for key, value in parsed_content.get('基本用法').items(): code = value.replace('\n', r'\n').replace('\'', '\'\'') From b779eb918a523e635e8d7c10be119c3ebeb4fe10 Mon Sep 17 00:00:00 2001 From: MrChengmo Date: Mon, 11 Mar 2024 11:51:55 +0800 Subject: [PATCH 06/18] rename eb-turbo-appbuilder --- README.md | 12 ++--- appbuilder/core/agent.py | 2 +- appbuilder/core/components/gbi/basic.py | 2 +- .../core/components/gbi/nl2sql/README.md | 2 +- .../core/components/gbi/nl2sql/component.py | 2 +- .../components/gbi/select_table/README.md | 2 +- .../components/gbi/select_table/component.py | 2 +- .../components/llms/dialog_summary/README.md | 2 +- .../llms/dialog_summary/component.py | 2 +- .../llms/is_complex_query/README.md | 4 +- .../llms/is_complex_query/component.py | 2 +- appbuilder/core/components/llms/mrc/README.md | 6 +-- .../core/components/llms/nl2pandas/README.md | 2 +- .../components/llms/nl2pandas/component.py | 2 +- .../llms/oral_query_generation/README.md | 4 +- .../llms/oral_query_generation/component.py | 2 +- .../core/components/llms/playground/README.md | 2 +- .../components/llms/playground/component.py | 2 +- .../components/llms/qa_pair_mining/README.md | 4 +- .../llms/qa_pair_mining/component.py | 2 +- .../llms/query_decomposition/README.md | 4 +- .../llms/query_decomposition/component.py | 2 +- .../components/llms/query_rewrite/README.md | 2 +- .../llms/query_rewrite/component.py | 2 +- .../llms/similar_question/README.md | 2 +- .../llms/similar_question/component.py | 2 +- .../components/llms/style_rewrite/README.md | 2 +- .../llms/style_rewrite/component.py | 2 +- .../components/llms/style_writing/README.md | 2 +- .../llms/style_writing/component.py | 2 +- .../components/llms/tag_extraction/README.md | 2 +- .../llms/tag_extraction/component.py | 2 +- .../rag_with_baidu_search/README.md | 4 +- appbuilder/tests/test_dialog_summary.py | 8 +-- appbuilder/tests/test_is_complex_query.py | 2 +- appbuilder/tests/test_mrc.py | 2 +- appbuilder/tests/test_nl2pandas.py | 2 +- .../tests/test_oral_query_generation.py | 2 +- appbuilder/tests/test_qa_pair_mining.py | 2 +- appbuilder/tests/test_query_decomposition.py | 2 +- appbuilder/tests/test_query_rewrite.py | 4 +- appbuilder/tests/test_rag_baidu_search.py | 2 +- appbuilder/tests/test_similar_question.py | 2 +- appbuilder/tests/test_style_rewrite.py | 6 +-- appbuilder/tests/test_style_writing.py | 8 +-- appbuilder/tests/test_tag_extraction.py | 2 +- appbuilder/utils/model_util.py | 4 +- cookbooks/agent_runtime.ipynb | 50 +++++++++++++++++-- cookbooks/rag.ipynb | 4 +- cookbooks/rag_with_baidusearch.ipynb | 4 +- cookbooks/text_generation.ipynb | 8 +-- 51 files changed, 123 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index 03220c70a..295073bce 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ print(", ".join(models)) 填写自己的Token,获取模型列表输出如下: ``` shell -ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, EB-turbo-AppBuilder专用版, Qianfan-Chinese-Llama-2-7B, Yi-34B-Chat, Llama-2-7B-Chat, Llama-2-13B-Chat, Llama-2-70B-Chat, ChatGLM2-6B-32K, ChatLaw, BLOOMZ-7B, Qianfan-BLOOMZ-7B-compressed, AquilaChat-7B +ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, ERNIE Speed-AppBuilder, Qianfan-Chinese-Llama-2-7B, Yi-34B-Chat, Llama-2-7B-Chat, Llama-2-13B-Chat, Llama-2-70B-Chat, ChatGLM2-6B-32K, ChatLaw, BLOOMZ-7B, Qianfan-BLOOMZ-7B-compressed, AquilaChat-7B ``` 为方便用户更容易使用模型,以下是一些模型的短名称 @@ -81,7 +81,7 @@ ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, EB-turbo-AppBuilder专 | ERNIE-Bot-8K | eb-8k | | ERNIE-Bot | eb | | ERNIE-Bot-turbo | eb-turbo | -| EB-turbo-AppBuilder专用版 | eb-turbo-appbuilder | +| ERNIE Speed-AppBuilder | ernie_speed_appbuilder | ### 典型示例 @@ -94,7 +94,7 @@ import appbuilder # 空模版组件 template_str = "你扮演{role}, 请回答我的问题。\n\n问题:{question}。\n\n回答:" -playground = appbuilder.Playground(prompt_template=template_str, model="eb-turbo-appbuilder") +playground = appbuilder.Playground(prompt_template=template_str, model="ERNIE Speed-AppBuilder") # 定义输入,调用空模版组件 input = appbuilder.Message({"role": "java工程师", "question": "java语言的内存回收机制是什么"}) @@ -107,7 +107,7 @@ print(playground(input, stream=False, temperature=1e-10)) import appbuilder # 相似问生成组件 -similar_q = appbuilder.SimilarQuestion(model="eb-turbo-appbuilder") +similar_q = appbuilder.SimilarQuestion(model="ERNIE Speed-AppBuilder") # 定义输入,调用相似问生成 input = appbuilder.Message("我想吃冰淇淋,哪里的冰淇淋比较好吃?") @@ -149,7 +149,7 @@ import appbuilder # 空模版组件 playground = appbuilder.Playground( prompt_template="{query}", - model="eb-turbo-appbuilder" + model="ERNIE Speed-AppBuilder" ) # 使用 AgentRuntime 来服务化playground组件 @@ -196,7 +196,7 @@ class SimilarQuestion(CompletionBaseComponent): os.environ["APPBUILDER_TOKEN"] = "..." - qa_mining = appbuilder.SimilarQuestion(model="eb-turbo-appbuilder") + qa_mining = appbuilder.SimilarQuestion(model="ERNIE Speed-AppBuilder") msg = "我想吃冰淇淋,哪里的冰淇淋比较好吃?" msg = appbuilder.Message(msg) diff --git a/appbuilder/core/agent.py b/appbuilder/core/agent.py index c0f7fb288..d0efb11d9 100644 --- a/appbuilder/core/agent.py +++ b/appbuilder/core/agent.py @@ -104,7 +104,7 @@ class AgentRuntime(BaseModel): class PlaygroundWithHistory(Component): def __init__(self): super().__init__() - self.query_rewrite = QueryRewrite(model="eb-turbo-appbuilder") + self.query_rewrite = QueryRewrite(model="ERNIE Speed-AppBuilder") self.play = Playground( prompt_template="{query}", model="eb-4" diff --git a/appbuilder/core/components/gbi/basic.py b/appbuilder/core/components/gbi/basic.py index 28fa34b81..0a0b0d593 100644 --- a/appbuilder/core/components/gbi/basic.py +++ b/appbuilder/core/components/gbi/basic.py @@ -50,5 +50,5 @@ class ColumnItem(BaseModel): SUPPORTED_MODEL_NAME = { - "ERNIE-Bot 4.0", "ERNIE-Bot-8K", "ERNIE-Bot", "ERNIE-Bot-turbo", "EB-turbo-AppBuilder" + "ERNIE-Bot 4.0", "ERNIE-Bot-8K", "ERNIE-Bot", "ERNIE-Bot-turbo", "ERNIE Speed-AppBuilder" } diff --git a/appbuilder/core/components/gbi/nl2sql/README.md b/appbuilder/core/components/gbi/nl2sql/README.md index 763620119..b05eb817c 100644 --- a/appbuilder/core/components/gbi/nl2sql/README.md +++ b/appbuilder/core/components/gbi/nl2sql/README.md @@ -59,7 +59,7 @@ print(f"llm result: {nl2sql_result_message.content.llm_result}") ## 参数说明 ### 初始化参数 -- model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, EB-turbo-AppBuilder" +- model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, ERNIE Speed-AppBuilder - table_schemas: 表的 schema,例如: ``` diff --git a/appbuilder/core/components/gbi/nl2sql/component.py b/appbuilder/core/components/gbi/nl2sql/component.py index 9410a0067..e0c47ba9d 100644 --- a/appbuilder/core/components/gbi/nl2sql/component.py +++ b/appbuilder/core/components/gbi/nl2sql/component.py @@ -45,7 +45,7 @@ def __init__(self, model_name: str, table_schemas: List[str], knowledge: Dict = """ 创建 gbi nl2sql 对象 Args: - model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, EB-turbo-AppBuilder + model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, ERNIE Speed-AppBuilder table_schemas: 表的 schema 列表,例如: ``` CREATE TABLE `mytable` ( `d_year` COMMENT '年度,2019,2020..2022..', diff --git a/appbuilder/core/components/gbi/select_table/README.md b/appbuilder/core/components/gbi/select_table/README.md index 3d69be8f1..b5b0558e3 100644 --- a/appbuilder/core/components/gbi/select_table/README.md +++ b/appbuilder/core/components/gbi/select_table/README.md @@ -51,7 +51,7 @@ print(f"选的表是: {select_table_result_message.content}") ## 参数说明 ### 初始化参数 -- model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, EB-turbo-AppBuilder +- model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, ERNIE Speed-AppBuilder - table_descriptions: 表的描述是个字典,key: 是表的名字, value: 是表的描述,例如: ``` diff --git a/appbuilder/core/components/gbi/select_table/component.py b/appbuilder/core/components/gbi/select_table/component.py index 5bb0c5160..0dda8598f 100644 --- a/appbuilder/core/components/gbi/select_table/component.py +++ b/appbuilder/core/components/gbi/select_table/component.py @@ -41,7 +41,7 @@ def __init__(self, model_name: str, table_descriptions: Dict[str, str], """ 创建 GBI 选表对象 Args: - model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, EB-turbo-AppBuilder + model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, ERNIE Speed-AppBuilder table_descriptions: 表的描述是个字典,key: 是表的名字, value: 是表的描述,例如: { "超市营收明细表": "超市营收明细表,包含超市各种信息等", diff --git a/appbuilder/core/components/llms/dialog_summary/README.md b/appbuilder/core/components/llms/dialog_summary/README.md index d0a5783e1..303be03d6 100644 --- a/appbuilder/core/components/llms/dialog_summary/README.md +++ b/appbuilder/core/components/llms/dialog_summary/README.md @@ -23,7 +23,7 @@ import os # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" -dialog_summary = appbuilder.DialogSummary("eb-turbo-appbuilder") +dialog_summary = appbuilder.DialogSummary("ERNIE Speed-AppBuilder") text = "用户:喂我想查一下我的话费\n坐席:好的女士您话费余的话还有87.49元钱\n用户:好的知道了谢谢\n坐席:嗯不客气祝您生活愉快再见" answer = dialog_summary(appbuilder.Message(text)) print(answer) diff --git a/appbuilder/core/components/llms/dialog_summary/component.py b/appbuilder/core/components/llms/dialog_summary/component.py index a34967b12..08d542ddf 100644 --- a/appbuilder/core/components/llms/dialog_summary/component.py +++ b/appbuilder/core/components/llms/dialog_summary/component.py @@ -44,7 +44,7 @@ class DialogSummary(CompletionBaseComponent): # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = '...' - dialog_summary = appbuilder.DialogSummary("eb-turbo-appbuilder") + dialog_summary = appbuilder.DialogSummary("ERNIE Speed-AppBuilder") text = "用户:喂我想查一下我的话费\n坐席:好的女士您话费余的话还有87.49元钱\n用户:好的知道了谢谢\n坐席:嗯不客气祝您生活愉快再见" answer = dialog_summary(appbuilder.Message(text)) print(answer) diff --git a/appbuilder/core/components/llms/is_complex_query/README.md b/appbuilder/core/components/llms/is_complex_query/README.md index f842b4e75..b3176fa7a 100644 --- a/appbuilder/core/components/llms/is_complex_query/README.md +++ b/appbuilder/core/components/llms/is_complex_query/README.md @@ -21,7 +21,7 @@ import appbuilder # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = "..." -is_complex_query = appbuilder.IsComplexQuery(model="eb-turbo-appbuilder") +is_complex_query = appbuilder.IsComplexQuery(model="ERNIE Speed-AppBuilder") msg = "吸塑包装盒在工业化生产和物流运输中分别有什么重要性?" msg = appbuilder.Message(msg) @@ -42,7 +42,7 @@ os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" ### 初始化参数 |参数名称 |参数类型 |是否必须 |描述 |示例值| |--------|--------|--------|----|------| -|model |str |是 |模型名称,用于指定要使用的千帆模型|eb-turbo-appbuilder| +|model |str |是 |模型名称,用于指定要使用的千帆模型|ERNIE Speed-AppBuilder| ### 调用参数 |参数名称 |参数类型 |是否必须 |描述 |示例值| diff --git a/appbuilder/core/components/llms/is_complex_query/component.py b/appbuilder/core/components/llms/is_complex_query/component.py index 562835ada..f268d814d 100644 --- a/appbuilder/core/components/llms/is_complex_query/component.py +++ b/appbuilder/core/components/llms/is_complex_query/component.py @@ -42,7 +42,7 @@ class IsComplexQuery(CompletionBaseComponent): # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = "..." - is_complex_query = appbuilder.IsComplexQuery(model="eb-turbo-appbuilder") + is_complex_query = appbuilder.IsComplexQuery(model="ERNIE Speed-AppBuilder") msg = "吸塑包装盒在工业化生产和物流运输中分别有什么重要性?" msg = appbuilder.Message(msg) diff --git a/appbuilder/core/components/llms/mrc/README.md b/appbuilder/core/components/llms/mrc/README.md index 1a3f46964..c541ea427 100644 --- a/appbuilder/core/components/llms/mrc/README.md +++ b/appbuilder/core/components/llms/mrc/README.md @@ -9,7 +9,7 @@ MRC(阅读理解问答模块)是一项先进的自然语言处理功能, ### 特色优势 我们的MRC模块,基于百度自研的先进语言模型文新一言,提供了一系列强大的阅读理解问答功能。在保持文本理解和问题回答的高精度的同时, 我们特别强调了答案的质量和交互体验。以下是我们MRC模块的几个主要功能特色: - - 1.多版本模型支持:我们的MRC模块包括不同版本的文新一言大模型,Erniebot 4.0、EB-turbo-AppBuilder等,每个版本都针对特定的应用场景进行了优化。 用户可以根据自己的需求选择最适合的模型版本,以获得最佳的性能。 + - 1.多版本模型支持:我们的MRC模块包括不同版本的文新一言大模型,Erniebot 4.0、ERNIE Speed-AppBuilder等,每个版本都针对特定的应用场景进行了优化。 用户可以根据自己的需求选择最适合的模型版本,以获得最佳的性能。 - 2.答案格式的多样性: - 拒答功能:当问题超出模型知识范围或不具体时,模型可以选择不回答,避免提供误导性信息。 - 澄清功能:对于模棱两可或含糊的问题,模型可以请求更多信息或对问题进行澄清,以确保答案的准确性。 @@ -41,7 +41,7 @@ import os os.environ["APPBUILDER_TOKEN"] = "..." # 创建MRC对象 -mrc_component = appbuilder.MRC(model="eb-turbo-appbuilder") +mrc_component = appbuilder.MRC(model="ERNIE Speed-AppBuilder") # 初始化参数 msg = "残疾人怎么办相关证件" @@ -119,7 +119,7 @@ import os os.environ["APPBUILDER_TOKEN"] = '...' # 创建MRC对象 -mrc_component = appbuilder.MRC(model="eb-turbo-appbuilder") +mrc_component = appbuilder.MRC(model="ERNIE Speed-AppBuilder") # 初始化参数 msg = "残疾人怎么办相关证件" diff --git a/appbuilder/core/components/llms/nl2pandas/README.md b/appbuilder/core/components/llms/nl2pandas/README.md index cd7471856..e0a843f27 100644 --- a/appbuilder/core/components/llms/nl2pandas/README.md +++ b/appbuilder/core/components/llms/nl2pandas/README.md @@ -30,7 +30,7 @@ query = "海淀区有哪些学校" query = appbuilder.Message(query) #定义并运行Nl2pandas实例,得到结果 -nl2pandas = appbuilder.Nl2pandasComponent(model="eb-turbo-appbuilder") +nl2pandas = appbuilder.Nl2pandasComponent(model="ERNIE Speed-AppBuilder") answer = nl2pandas(query, table_info = table_info) ``` diff --git a/appbuilder/core/components/llms/nl2pandas/component.py b/appbuilder/core/components/llms/nl2pandas/component.py index 3fe14284f..ca4569ba7 100644 --- a/appbuilder/core/components/llms/nl2pandas/component.py +++ b/appbuilder/core/components/llms/nl2pandas/component.py @@ -55,7 +55,7 @@ class Nl2pandasComponent(CompletionBaseComponent): query = "海淀区有哪些学校" query = appbuilder.Message(query) - nl2pandas = appbuilder.Nl2pandasComponent(model="eb-turbo-appbuilder") + nl2pandas = appbuilder.Nl2pandasComponent(model="ERNIE Speed-AppBuilder") answer = nl2pandas(query, table_info = table_info) """ name = "nl2pandas" diff --git a/appbuilder/core/components/llms/oral_query_generation/README.md b/appbuilder/core/components/llms/oral_query_generation/README.md index 4989bfa5a..23a69e641 100644 --- a/appbuilder/core/components/llms/oral_query_generation/README.md +++ b/appbuilder/core/components/llms/oral_query_generation/README.md @@ -26,7 +26,7 @@ text = ('文档标题:在OPPO Reno5上使用视频超级防抖\n' '防抖 开启路径:打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能,开启超级' '防抖后手机屏幕将出现超级防抖Pro开关,点击即可开启或关闭。 除此之外,前置视频同样加持防抖算法,边走边拍也能稳定聚焦脸部' ',实时视频分享您的生活。') -oral_query_generation = appbuilder.OralQueryGeneration(model='eb-turbo-appbuilder') +oral_query_generation = appbuilder.OralQueryGeneration(model='ERNIE Speed-AppBuilder') result = oral_query_generation(appbuilder.Message(text)) print(result) ``` @@ -43,7 +43,7 @@ os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" | 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 | | ------- | ------- | -------- | -------- | -------- | -| `model` | str | 否 | 模型名称,用于指定要使用的千帆模型。 | eb-turbo-appbuilder | +| `model` | str | 否 | 模型名称,用于指定要使用的千帆模型。 | ERNIE Speed-AppBuilder | | `secret_key` | str | 否 | 用户鉴权token,默认从环境变量中获取: `os.getenv("APPBUILDER_TOKEN", "")` | | | `gateway` | str | 否 | 后端网关服务地址,默认从环境变量中获取: `os.getenv("GATEWAY_URL", "")` | | | `lazy_certification` | bool | 否 | 延迟认证,为True时在第一次运行时认证。默认为False。 | False | diff --git a/appbuilder/core/components/llms/oral_query_generation/component.py b/appbuilder/core/components/llms/oral_query_generation/component.py index 65d48193d..8e45252aa 100644 --- a/appbuilder/core/components/llms/oral_query_generation/component.py +++ b/appbuilder/core/components/llms/oral_query_generation/component.py @@ -54,7 +54,7 @@ class OralQueryGeneration(CompletionBaseComponent): '防抖 开启路径:打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能,开启超级' '防抖后手机屏幕将出现超级防抖Pro开关,点击即可开启或关闭。 除此之外,前置视频同样加持防抖算法,边走边拍也能稳定聚焦脸部' ',实时视频分享您的生活。') - oral_query_generation = appbuilder.OralQueryGeneration(model='eb-turbo-appbuilder') + oral_query_generation = appbuilder.OralQueryGeneration(model='ERNIE Speed-AppBuilder') answer = oral_query_generation(appbuilder.Message(text)) print(answer.content) """ diff --git a/appbuilder/core/components/llms/playground/README.md b/appbuilder/core/components/llms/playground/README.md index 100afb7ed..f3c094701 100644 --- a/appbuilder/core/components/llms/playground/README.md +++ b/appbuilder/core/components/llms/playground/README.md @@ -26,7 +26,7 @@ os.environ["APPBUILDER_TOKEN"] = "..." play = appbuilder.Playground( prompt_template="你好,{name},我是{bot_name},{bot_name}是一个{bot_type},我可以{bot_function},你可以问我{bot_question}。", - model="eb-turbo-appbuilder" + model="ERNIE Speed-AppBuilder" ) play(appbuilder.Message({"name": "小明", "bot_name": "小红", "bot_type": "聊天机器人", "bot_function": "聊天", "bot_question": "你好吗?"}), stream=False) ``` diff --git a/appbuilder/core/components/llms/playground/component.py b/appbuilder/core/components/llms/playground/component.py index d27d2680f..c9a652d68 100644 --- a/appbuilder/core/components/llms/playground/component.py +++ b/appbuilder/core/components/llms/playground/component.py @@ -41,7 +41,7 @@ class Playground(CompletionBaseComponent): import appbuilder os.environ["APPBUILDER_TOKEN"] = "..." - play = appbuilder.Playground(prompt_template="你好,{name},我是{bot_name},{bot_name}是一个{bot_type},我可以{bot_function},你可以问我{bot_question}。", model="eb-turbo-appbuilder") + play = appbuilder.Playground(prompt_template="你好,{name},我是{bot_name},{bot_name}是一个{bot_type},我可以{bot_function},你可以问我{bot_question}。", model="ERNIE Speed-AppBuilder") play(appbuilder.Message({"name": "小明", "bot_name": "小红", "bot_type": "聊天机器人", "bot_function": "聊天", "bot_question": "你好吗?"}), stream=False) """ diff --git a/appbuilder/core/components/llms/qa_pair_mining/README.md b/appbuilder/core/components/llms/qa_pair_mining/README.md index 64e8cd03a..c2a575075 100644 --- a/appbuilder/core/components/llms/qa_pair_mining/README.md +++ b/appbuilder/core/components/llms/qa_pair_mining/README.md @@ -23,7 +23,7 @@ import appbuilder # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = "..." -qa_mining = appbuilder.QAPairMining(model="eb-turbo-appbuilder") +qa_mining = appbuilder.QAPairMining(model="ERNIE Speed-AppBuilder") # 输入文本(对此文本挖掘问答对) msg = '2017年,工商银行根据外部宏观环境变化,及时调整业务策略,优化资产负债结构,' + \ '保持存贷款业务协调发展,提升资产负债配置效率。' + \ @@ -110,7 +110,7 @@ split_result = splitter(parse_result) # 每个段落抽取问答对,并返回结果 for doc_segment in split_result.content["paragraphs"]: - qa_mining = QAPairMining(model="eb-turbo-appbuilder") + qa_mining = QAPairMining(model="ERNIE Speed-AppBuilder") text = doc_segment.get("text", "") if text == "": logger.error("Text is null. break") diff --git a/appbuilder/core/components/llms/qa_pair_mining/component.py b/appbuilder/core/components/llms/qa_pair_mining/component.py index a21496e1c..d68fde065 100644 --- a/appbuilder/core/components/llms/qa_pair_mining/component.py +++ b/appbuilder/core/components/llms/qa_pair_mining/component.py @@ -41,7 +41,7 @@ class QAPairMining(CompletionBaseComponent): os.environ["APPBUILDER_TOKEN"] = "..." - qa_mining = appbuilder.QAPairMining(model="eb-turbo-appbuilder") + qa_mining = appbuilder.QAPairMining(model="ERNIE Speed-AppBuilder") # 输入文本(对此文本挖掘问答对) msg = '2017年,工商银行根据外部宏观环境变化,及时调整业务策略,优化资产负债结构,' + \ '保持存贷款业务协调发展,提升资产负债配置效率。' + \ diff --git a/appbuilder/core/components/llms/query_decomposition/README.md b/appbuilder/core/components/llms/query_decomposition/README.md index f3c459aad..7a482b3cb 100644 --- a/appbuilder/core/components/llms/query_decomposition/README.md +++ b/appbuilder/core/components/llms/query_decomposition/README.md @@ -21,7 +21,7 @@ import appbuilder # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = "..." -query_decomposition = appbuilder.QueryDecomposition(model="eb-turbo-appbuilder") +query_decomposition = appbuilder.QueryDecomposition(model="ERNIE Speed-AppBuilder") msg = "吸塑包装盒在工业化生产和物流运输中分别有什么重要性?" msg = appbuilder.Message(msg) @@ -42,7 +42,7 @@ os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" ### 初始化参数 |参数名称 |参数类型 |是否必须 |描述 |示例值| |--------|--------|--------|----|------| -|model |str |是 |模型名称,用于指定要使用的千帆模型|eb-turbo-appbuilder| +|model |str |是 |模型名称,用于指定要使用的千帆模型|ERNIE Speed-AppBuilder| ### 调用参数 |参数名称 |参数类型 |是否必须 |描述 |示例值| diff --git a/appbuilder/core/components/llms/query_decomposition/component.py b/appbuilder/core/components/llms/query_decomposition/component.py index e3f1a0e58..9bb54eb7b 100644 --- a/appbuilder/core/components/llms/query_decomposition/component.py +++ b/appbuilder/core/components/llms/query_decomposition/component.py @@ -42,7 +42,7 @@ class QueryDecomposition(CompletionBaseComponent): # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = "..." - query_decomposition = appbuilder.QueryDecomposition(model="eb-turbo-appbuilder") + query_decomposition = appbuilder.QueryDecomposition(model="ERNIE Speed-AppBuilder") msg = "吸塑包装盒在工业化生产和物流运输中分别有什么重要性?" msg = appbuilder.Message(msg) diff --git a/appbuilder/core/components/llms/query_rewrite/README.md b/appbuilder/core/components/llms/query_rewrite/README.md index a701beee1..cee4fe0ba 100644 --- a/appbuilder/core/components/llms/query_rewrite/README.md +++ b/appbuilder/core/components/llms/query_rewrite/README.md @@ -24,7 +24,7 @@ import appbuilder os.environ["APPBUILDER_TOKEN"] = '...' # 初始化并使用 QueryRewrite 组件 -query_rewrite = appbuilder.QueryRewrite(model="eb-turbo-appbuilder") +query_rewrite = appbuilder.QueryRewrite(model="ERNIE Speed-AppBuilder") answer = query_rewrite(appbuilder.Message(['我应该怎么办理护照?', '您可以查询官网或人工咨询', '我需要准备哪些材料?', '身份证、免冠照片一张以及填写完整的《中国公民因私出国(境)申请表》', '在哪里办']), rewrite_type="带机器人回复") print(answer) ``` diff --git a/appbuilder/core/components/llms/query_rewrite/component.py b/appbuilder/core/components/llms/query_rewrite/component.py index e4f061b77..3f84e7b17 100644 --- a/appbuilder/core/components/llms/query_rewrite/component.py +++ b/appbuilder/core/components/llms/query_rewrite/component.py @@ -71,7 +71,7 @@ class QueryRewrite(CompletionBaseComponent): import appbuilder os.environ["APPBUILDER_TOKEN"] = '...' - query_rewrite = appbuilder.QueryRewrite(model="eb-turbo-appbuilder") + query_rewrite = appbuilder.QueryRewrite(model="ERNIE Speed-AppBuilder") answer = query_rewrite(appbuilder.Message(['我应该怎么办理护照?', '您可以查询官网或人工咨询', '我需要准备哪些材料?', diff --git a/appbuilder/core/components/llms/similar_question/README.md b/appbuilder/core/components/llms/similar_question/README.md index a34d9f291..c7e46c0a4 100644 --- a/appbuilder/core/components/llms/similar_question/README.md +++ b/appbuilder/core/components/llms/similar_question/README.md @@ -23,7 +23,7 @@ import appbuilder # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = "..." -similar_question = appbuilder.SimilarQuestion(model="eb-turbo-appbuilder") +similar_question = appbuilder.SimilarQuestion(model="ERNIE Speed-AppBuilder") msg = "我想吃冰淇淋,哪里的冰淇淋比较好吃?" msg = appbuilder.Message(msg) diff --git a/appbuilder/core/components/llms/similar_question/component.py b/appbuilder/core/components/llms/similar_question/component.py index b813168de..70174cbe9 100644 --- a/appbuilder/core/components/llms/similar_question/component.py +++ b/appbuilder/core/components/llms/similar_question/component.py @@ -40,7 +40,7 @@ class SimilarQuestion(CompletionBaseComponent): os.environ["APPBUILDER_TOKEN"] = "..." - qa_mining = appbuilder.SimilarQuestion(model="eb-turbo-appbuilder") + qa_mining = appbuilder.SimilarQuestion(model="ERNIE Speed-AppBuilder") msg = "我想吃冰淇淋,哪里的冰淇淋比较好吃?" msg = appbuilder.Message(msg) diff --git a/appbuilder/core/components/llms/style_rewrite/README.md b/appbuilder/core/components/llms/style_rewrite/README.md index fa460bb35..cb0aaa7ba 100644 --- a/appbuilder/core/components/llms/style_rewrite/README.md +++ b/appbuilder/core/components/llms/style_rewrite/README.md @@ -33,7 +33,7 @@ import appbuilder os.environ["APPBUILDER_TOKEN"] = "..." # 初始化并使用 StyleRewrite 组件 -style_rewrite = appbuilder.StyleRewrite(model="eb-turbo-appbuilder") +style_rewrite = appbuilder.StyleRewrite(model="ERNIE Speed-AppBuilder") answer = style_rewrite(appbuilder.Message("文心大模型发布新版"), style="激励话术") ``` diff --git a/appbuilder/core/components/llms/style_rewrite/component.py b/appbuilder/core/components/llms/style_rewrite/component.py index 471f19d02..5c4f21dbd 100644 --- a/appbuilder/core/components/llms/style_rewrite/component.py +++ b/appbuilder/core/components/llms/style_rewrite/component.py @@ -77,7 +77,7 @@ class StyleRewrite(CompletionBaseComponent): import appbuilder os.environ["APPBUILDER_TOKEN"] = '...' - style_rewrite = appbuilder.StyleRewrite(model="eb-turbo-appbuilder") + style_rewrite = appbuilder.StyleRewrite(model="ERNIE Speed-AppBuilder") answer = style_rewrite(appbuilder.Message("文心大模型发布新版本"), style="激励话术") """ diff --git a/appbuilder/core/components/llms/style_writing/README.md b/appbuilder/core/components/llms/style_writing/README.md index b84817f92..44a11c8ef 100644 --- a/appbuilder/core/components/llms/style_writing/README.md +++ b/appbuilder/core/components/llms/style_writing/README.md @@ -26,7 +26,7 @@ import os # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = "..." -model = "eb-turbo-appbuilder" +model = "ERNIE Speed-AppBuilder" style_writing = appbuilder.StyleWriting(model) query = "帮我写一篇关于人体工学椅的文案" diff --git a/appbuilder/core/components/llms/style_writing/component.py b/appbuilder/core/components/llms/style_writing/component.py index 150e61fef..1f944363e 100644 --- a/appbuilder/core/components/llms/style_writing/component.py +++ b/appbuilder/core/components/llms/style_writing/component.py @@ -98,7 +98,7 @@ class StyleWriting(CompletionBaseComponent): # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = '...' - style_writing = appbuilder.StyleWriting(model="eb-turbo-appbuilder") + style_writing = appbuilder.StyleWriting(model="ERNIE Speed-AppBuilder") answer = style_writing(appbuilder.Message("帮我写一篇关于人体工学椅的文案"), style_query="小红书", length=100) """ diff --git a/appbuilder/core/components/llms/tag_extraction/README.md b/appbuilder/core/components/llms/tag_extraction/README.md index 34a348d06..2c40df958 100644 --- a/appbuilder/core/components/llms/tag_extraction/README.md +++ b/appbuilder/core/components/llms/tag_extraction/README.md @@ -31,7 +31,7 @@ import appbuilder # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = '...' -tag_extraction = appbuilder.TagExtraction(model="eb-turbo-appbuilder") +tag_extraction = appbuilder.TagExtraction(model="ERNIE Speed-AppBuilder") result = tag_extraction(appbuilder.Message("从这段文本中抽取关键标签")) ``` diff --git a/appbuilder/core/components/llms/tag_extraction/component.py b/appbuilder/core/components/llms/tag_extraction/component.py index 21af22f49..a69c4be2a 100644 --- a/appbuilder/core/components/llms/tag_extraction/component.py +++ b/appbuilder/core/components/llms/tag_extraction/component.py @@ -41,7 +41,7 @@ class TagExtraction(CompletionBaseComponent): # 请前往千帆AppBuilder官网创建密钥,流程详见:https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5 os.environ["APPBUILDER_TOKEN"] = '...' - tag_extraction = appbuilder.TagExtraction(model="eb-turbo-appbuilder") + tag_extraction = appbuilder.TagExtraction(model="ERNIE Speed-AppBuilder") answer = tag_extraction(appbuilder.Message("从这段文本中抽取关键标签")) """ diff --git a/appbuilder/core/components/rag_with_baidu_search/README.md b/appbuilder/core/components/rag_with_baidu_search/README.md index 0ddbc9688..8d3ca4e1b 100644 --- a/appbuilder/core/components/rag_with_baidu_search/README.md +++ b/appbuilder/core/components/rag_with_baidu_search/README.md @@ -28,7 +28,7 @@ import os os.environ["APPBUILDER_TOKEN"] = '...' # 创建rag_with_baidusearch对象 -rag_with_baidusearch_component = appbuilder.RAGWithBaiduSearch(model="eb-turbo-appbuilder") +rag_with_baidusearch_component = appbuilder.RAGWithBaiduSearch(model="ERNIE Speed-AppBuilder") # 运行rag_with_baidusearch基本组件 msg = appbuilder.Message("残疾人怎么办相关证件") @@ -101,7 +101,7 @@ os.environ["APPBUILDER_TOKEN"] = '...' # 创建rag_with_baidusearch对象, 并初始化人设指令 rag_with_baidusearch_component = appbuilder.RAGWithBaiduSearch( - model="eb-turbo-appbuilder", + model="ERNIE Speed-AppBuilder", instruction=appbuilder.Message("你是问答助手,在回答问题前需要加上: 很高兴为您解答")) diff --git a/appbuilder/tests/test_dialog_summary.py b/appbuilder/tests/test_dialog_summary.py index 20a57bf85..96a63592d 100644 --- a/appbuilder/tests/test_dialog_summary.py +++ b/appbuilder/tests/test_dialog_summary.py @@ -28,7 +28,7 @@ def setUp(self): Returns: 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.node = appbuilder.DialogSummary(model=self.model_name) def test_run_with_default_params(self): @@ -49,12 +49,12 @@ def test_run_with_model_names(self): """测试不同的 stream 和 temperature 参数值""" chats = appbuilder.get_model_list(api_type_filter=["chat"]) - self.assertTrue("EB-turbo-AppBuilder专用版" in chats) + self.assertTrue("ERNIE Speed-AppBuilder专用版" in chats) - appbuilder.DialogSummary(model="EB-turbo-AppBuilder专用版") + appbuilder.DialogSummary(model="ERNIE Speed-AppBuilder专用版") with self.assertRaises(Exception): - appbuilder.DialogSummary(model="EB-turbo-AppBuilder-None") + appbuilder.DialogSummary(model="ERNIE Speed-AppBuilder-None") if __name__ == '__main__': diff --git a/appbuilder/tests/test_is_complex_query.py b/appbuilder/tests/test_is_complex_query.py index 1cc42d52d..2afe988bb 100644 --- a/appbuilder/tests/test_is_complex_query.py +++ b/appbuilder/tests/test_is_complex_query.py @@ -29,7 +29,7 @@ def setUp(self): Returns: 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.node = appbuilder.IsComplexQuery(model=self.model_name) def test_run_with_default_params(self): diff --git a/appbuilder/tests/test_mrc.py b/appbuilder/tests/test_mrc.py index 8e940f4a0..467ebbf9a 100644 --- a/appbuilder/tests/test_mrc.py +++ b/appbuilder/tests/test_mrc.py @@ -24,7 +24,7 @@ def setUp(self): return mrc class ''' # 设置环境变量和初始化TestMRCComponent实例 - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.mrc = appbuilder.MRC(model=self.model_name) def test_mrc_with_default_params(self): diff --git a/appbuilder/tests/test_nl2pandas.py b/appbuilder/tests/test_nl2pandas.py index 2b8bf03d9..470987d47 100644 --- a/appbuilder/tests/test_nl2pandas.py +++ b/appbuilder/tests/test_nl2pandas.py @@ -25,7 +25,7 @@ def setUp(self): """ 设置环境变量及必要数据。 """ - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.node = appbuilder.Nl2pandasComponent(model=self.model_name) self.table_info = '''表格列信息如下: 学校名 : 清华附小 , 字符串类型,代表小学学校的名称 diff --git a/appbuilder/tests/test_oral_query_generation.py b/appbuilder/tests/test_oral_query_generation.py index b9156ef5e..54da94218 100644 --- a/appbuilder/tests/test_oral_query_generation.py +++ b/appbuilder/tests/test_oral_query_generation.py @@ -38,7 +38,7 @@ def setUp(self): 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = 'eb-turbo-appbuilder' + self.model_name = 'ERNIE Speed-AppBuilder' self.node = appbuilder.OralQueryGeneration(model=self.model_name) def test_run_with_default_params(self): diff --git a/appbuilder/tests/test_qa_pair_mining.py b/appbuilder/tests/test_qa_pair_mining.py index fb1f6d390..d343e09b8 100644 --- a/appbuilder/tests/test_qa_pair_mining.py +++ b/appbuilder/tests/test_qa_pair_mining.py @@ -30,7 +30,7 @@ def setUp(self): Returns: 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.node = appbuilder.QAPairMining(model=self.model_name) def test_run_with_default_params(self): diff --git a/appbuilder/tests/test_query_decomposition.py b/appbuilder/tests/test_query_decomposition.py index 497e7e4e4..5baeff09d 100644 --- a/appbuilder/tests/test_query_decomposition.py +++ b/appbuilder/tests/test_query_decomposition.py @@ -29,7 +29,7 @@ def setUp(self): Returns: 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.node = appbuilder.QueryDecomposition(model=self.model_name) def test_run_with_default_params(self): diff --git a/appbuilder/tests/test_query_rewrite.py b/appbuilder/tests/test_query_rewrite.py index 20bf150b3..e7f90721e 100644 --- a/appbuilder/tests/test_query_rewrite.py +++ b/appbuilder/tests/test_query_rewrite.py @@ -32,7 +32,7 @@ def setUp(self): 无返回值。 """ # 设置环境变量和初始化TranslateComponent实例 - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.node = appbuilder.QueryRewrite(model=self.model_name) def test_run_with_default_params(self): @@ -54,7 +54,7 @@ def test_run_with_custom_params(self): def test_run_with_stream_and_temperature(self): """测试不同的 stream 和 temperature 参数值""" - node = appbuilder.QueryRewrite("eb-turbo-appbuilder") + node = appbuilder.QueryRewrite("ERNIE Speed-AppBuilder") query = ['我应该怎么办理护照?', '您可以查询官网或人工咨询', '我需要准备哪些材料?', '身份证、免冠照片一张以及填写完整的《中国公民因私出国(境)申请表》', '在哪里办'] msg = appbuilder.Message(query) answer = node(msg, rewrite_type="带机器人回复", stream=False, temperature=0.5) diff --git a/appbuilder/tests/test_rag_baidu_search.py b/appbuilder/tests/test_rag_baidu_search.py index 98321d8d8..d6042c494 100644 --- a/appbuilder/tests/test_rag_baidu_search.py +++ b/appbuilder/tests/test_rag_baidu_search.py @@ -11,7 +11,7 @@ def setUp(self): return rag_with_baidu_search class """ # 设置环境变量和初始化TestMRCComponent实例 - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.rag_with_baidu_search = appbuilder.RAGWithBaiduSearch(model=self.model_name) def test_rag_with_baidu_search(self): diff --git a/appbuilder/tests/test_similar_question.py b/appbuilder/tests/test_similar_question.py index aeb351232..a8e2d45f4 100644 --- a/appbuilder/tests/test_similar_question.py +++ b/appbuilder/tests/test_similar_question.py @@ -30,7 +30,7 @@ def setUp(self): 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.node = appbuilder.SimilarQuestion(model=self.model_name) def test_run_with_default_params(self): diff --git a/appbuilder/tests/test_style_rewrite.py b/appbuilder/tests/test_style_rewrite.py index 50fb1415d..243b3376e 100644 --- a/appbuilder/tests/test_style_rewrite.py +++ b/appbuilder/tests/test_style_rewrite.py @@ -31,7 +31,7 @@ def setUp(self): Returns: 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.node = appbuilder.StyleRewrite(model=self.model_name) def test_run_with_default_params(self): @@ -61,7 +61,7 @@ def test_run_with_invalid_params(self): def test_run_with_different_style(self): """测试不同的 style 参数值""" - node = appbuilder.StyleRewrite("eb-turbo-appbuilder") + node = appbuilder.StyleRewrite("ERNIE Speed-AppBuilder") msg = appbuilder.Message("测试消息") for style in StyleChoices: with self.subTest(style=style): @@ -70,7 +70,7 @@ def test_run_with_different_style(self): def test_run_with_stream_and_temperature(self): """测试不同的 stream 和 temperature 参数值""" - node = appbuilder.StyleRewrite("eb-turbo-appbuilder") + node = appbuilder.StyleRewrite("ERNIE Speed-AppBuilder") msg = appbuilder.Message("测试消息") answer = node(msg, style="激励话术", stream=False, temperature=0.5) self.assertIsNotNone(answer) diff --git a/appbuilder/tests/test_style_writing.py b/appbuilder/tests/test_style_writing.py index 0961018fa..7d9570b50 100644 --- a/appbuilder/tests/test_style_writing.py +++ b/appbuilder/tests/test_style_writing.py @@ -30,7 +30,7 @@ def setUp(self): Returns: 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.node = appbuilder.StyleWriting(model=self.model_name) def test_run_with_default_params(self): @@ -61,7 +61,7 @@ def test_run_with_invalid_params(self): def test_run_with_different_style_query(self): """测试不同的 style_query 参数值""" - node = appbuilder.StyleWriting("eb-turbo-appbuilder") + node = appbuilder.StyleWriting("ERNIE Speed-AppBuilder") msg = appbuilder.Message("测试消息") for style_query in StyleQueryChoices: with self.subTest(style_query=style_query): @@ -70,7 +70,7 @@ def test_run_with_different_style_query(self): def test_run_with_different_length(self): """测试不同的 length 参数值""" - node = appbuilder.StyleWriting("eb-turbo-appbuilder") + node = appbuilder.StyleWriting("ERNIE Speed-AppBuilder") msg = appbuilder.Message("测试消息") for length in LengthChoices: with self.subTest(length=length): @@ -79,7 +79,7 @@ def test_run_with_different_length(self): def test_run_with_stream_and_temperature(self): """测试不同的 stream 和 temperature 参数值""" - node = appbuilder.StyleWriting("eb-turbo-appbuilder") + node = appbuilder.StyleWriting("ERNIE Speed-AppBuilder") msg = appbuilder.Message("测试消息") answer = node(msg, style_query="通用", length=100, stream=False, temperature=0.5) self.assertIsNotNone(answer) diff --git a/appbuilder/tests/test_tag_extraction.py b/appbuilder/tests/test_tag_extraction.py index 87084d4ca..6224fa9e3 100644 --- a/appbuilder/tests/test_tag_extraction.py +++ b/appbuilder/tests/test_tag_extraction.py @@ -25,7 +25,7 @@ def setUp(self): Returns: 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "eb-turbo-appbuilder" + self.model_name = "ERNIE Speed-AppBuilder" self.tag_extraction = appbuilder.TagExtraction(model=self.model_name) def test_run_with_default_params(self): diff --git a/appbuilder/utils/model_util.py b/appbuilder/utils/model_util.py index 91270594b..4836820bb 100644 --- a/appbuilder/utils/model_util.py +++ b/appbuilder/utils/model_util.py @@ -26,7 +26,9 @@ "ERNIE-Bot-8K": "eb-8k", "ERNIE-Bot": "eb", "ERNIE-Bot-turbo": "eb-turbo", - "EB-turbo-AppBuilder专用版": "eb-turbo-appbuilder", + "EB-turbo-AppBuilder专用版": "ERNIE Speed-AppBuilder", + "ERNIE Speed-AppBuilder": "ERNIE Speed-AppBuilder", + "ernie_speed_appbuilder": "ERNIE Speed-AppBuilder", } diff --git a/cookbooks/agent_runtime.ipynb b/cookbooks/agent_runtime.ipynb index 289006f25..8aed09855 100644 --- a/cookbooks/agent_runtime.ipynb +++ b/cookbooks/agent_runtime.ipynb @@ -34,7 +34,42 @@ "languageId": "shellscript" } }, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mFailed to start the Kernel. \n", + "\u001b[1;31mJupyter server crashed. Unable to connect. \n", + "\u001b[1;31mError code from Jupyter: 1\n", + "\u001b[1;31musage: jupyter.py [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]\n", + "\u001b[1;31m [--paths] [--json] [--debug]\n", + "\u001b[1;31m [subcommand]\n", + "\u001b[1;31m\n", + "\u001b[1;31mJupyter: Interactive Computing\n", + "\u001b[1;31m\n", + "\u001b[1;31mpositional arguments:\n", + "\u001b[1;31m subcommand the subcommand to launch\n", + "\u001b[1;31m\n", + "\u001b[1;31moptional arguments:\n", + "\u001b[1;31m -h, --help show this help message and exit\n", + "\u001b[1;31m --version show the versions of core jupyter packages and exit\n", + "\u001b[1;31m --config-dir show Jupyter config dir\n", + "\u001b[1;31m --data-dir show Jupyter data dir\n", + "\u001b[1;31m --runtime-dir show Jupyter runtime dir\n", + "\u001b[1;31m --paths show all Jupyter paths. Add --json for machine-readable\n", + "\u001b[1;31m format.\n", + "\u001b[1;31m --json output paths as machine-readable json\n", + "\u001b[1;31m --debug output debug information about paths\n", + "\u001b[1;31m\n", + "\u001b[1;31mAvailable subcommands:\n", + "\u001b[1;31m\n", + "\u001b[1;31mJupyter command `jupyter-notebook` not found. \n", + "\u001b[1;31mView Jupyter log for further details." + ] + } + ], "source": [ "pip install appbuilder-sdk 'appbuilder-sdk[serve]'" ] @@ -348,7 +383,7 @@ }, { "cell_type": "markdown", - "id": "2392f46d", + "id": "2392f46d",ERNIE Speed-AppBuilder "metadata": {}, "source": [ "### 2. Session 数据管理\n", @@ -383,7 +418,7 @@ "class PlaygroundWithHistory(Component):\n", " def __init__(self):\n", " super().__init__()\n", - " self.query_rewrite = QueryRewrite(model=\"EB-turbo-AppBuilder专用版\")\n", + " self.query_rewrite = QueryRewrite(model=\"ERNIE Speed-AppBuilder\")\n", " self.playground = Playground(\n", " prompt_template=\"{query}\",\n", " model=\"ERNIE-Bot\"\n", @@ -508,7 +543,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -522,7 +557,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.9" + "version": "3.9.6" + }, + "vscode": { + "interpreter": { + "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6" + } } }, "nbformat": 4, diff --git a/cookbooks/rag.ipynb b/cookbooks/rag.ipynb index c71f49d66..07d5cb378 100644 --- a/cookbooks/rag.ipynb +++ b/cookbooks/rag.ipynb @@ -171,7 +171,7 @@ "具备团队协作精神,能够与团队成员有效沟通,共同推进项目进展。'''\n", "\n", "# 标签抽取的组件\n", - "tagger = appbuilder.TagExtraction(model=\"eb-turbo-appbuilder\")\n", + "tagger = appbuilder.TagExtraction(model=\"ERNIE Speed-AppBuilder\")\n", "\n", "# 从JD抽取标签并打印\n", "tags = tagger(appbuilder.Message(job_desc))\n", @@ -234,7 +234,7 @@ "\n", "play = appbuilder.Playground(\n", " prompt_template=\"基于候选人姓名、职责描述和简历内容,概括一下{name}的推荐理由。\\n候选人姓名: {name}\\n职责描述: {JD}\\n简历内容: {resume}\\n推荐理由: \",\n", - " model=\"eb-turbo-appbuilder\"\n", + " model=\"ERNIE Speed-AppBuilder\"\n", ")\n", "\n", "resume_summary = play(appbuilder.Message({\"JD\": job_desc, \"name\": sorted_resumes[0][0], \"resume\": \"\\n\".join(list(resume_content[sorted_resumes[0][0]]))}))\n", diff --git a/cookbooks/rag_with_baidusearch.ipynb b/cookbooks/rag_with_baidusearch.ipynb index f137b1fb4..8af26086b 100644 --- a/cookbooks/rag_with_baidusearch.ipynb +++ b/cookbooks/rag_with_baidusearch.ipynb @@ -82,8 +82,8 @@ "friendly = False # 友好度提升\n", "cite = True # 溯源\n", "\n", - "# 使用 eb-turbo-appbuilder 模型\n", - "component = appbuilder.RAGWithBaiduSearch(model=\"eb-turbo-appbuilder\")\n", + "# 使用 ERNIE Speed-AppBuilderder 模型\n", + "component = appbuilder.RAGWithBaiduSearch(model=\"ERNIE Speed-AppBuilderder\")\n", "query = appbuilder.Message(\"海淀区的面积是多少\")\n", "\n", "answer = component.run(\n", diff --git a/cookbooks/text_generation.ipynb b/cookbooks/text_generation.ipynb index e05143ce4..f9dd3d5f1 100644 --- a/cookbooks/text_generation.ipynb +++ b/cookbooks/text_generation.ipynb @@ -101,7 +101,7 @@ "商品信息:\n", "'''\n", "# 创建商品信息生成组件\n", - "product_information_generation = Playground(prompt_template=prompt_template, model='eb-turbo-appbuilder')\n", + "product_information_generation = Playground(prompt_template=prompt_template, model='ERNIE Speed-AppBuilder')\n", "\n", "# 获取商品信息\n", "# 填充prompt_template参数的参数映射表,需要与prompt_template对应\n", @@ -152,7 +152,7 @@ "from appbuilder import QAPairMining\n", "\n", "# 初始化问答对生成组件\n", - "qa_pair_mining = QAPairMining(model='eb-turbo-appbuilder')\n", + "qa_pair_mining = QAPairMining(model='ERNIE Speed-AppBuilder')\n", "\n", "# 获取问答对\n", "response = qa_pair_mining(Message(product_information), stream=False, temperature=1e-10)\n", @@ -210,7 +210,7 @@ "'''\n", "\n", "# 初始化风格写作组件\n", - "style_writing = StyleWriting(model='eb-turbo-appbuilder')\n", + "style_writing = StyleWriting(model='ERNIE Speed-AppBuilder')\n", "\n", "# 获取小红书文案\n", "response = style_writing(Message(query), style_query='小红书', length=300)\n", @@ -260,7 +260,7 @@ "from appbuilder import TagExtraction\n", "\n", "# 初始化标签抽取组件\n", - "tag_extraction = TagExtraction(model='eb-turbo-appbuilder')\n", + "tag_extraction = TagExtraction(model='ERNIE Speed-AppBuilder')\n", "\n", "# 获取标签\n", "response = tag_extraction(Message(copywriting), stream=False, temperature=1e-10)\n", From 0ff9bf7f0b1fc783d25ef118722a95a8157cdd5a Mon Sep 17 00:00:00 2001 From: MrChengmo Date: Mon, 11 Mar 2024 12:06:39 +0800 Subject: [PATCH 07/18] return cookbooks/agent_runtime.ipynb --- cookbooks/agent_runtime.ipynb | 50 ++++------------------------------- 1 file changed, 5 insertions(+), 45 deletions(-) diff --git a/cookbooks/agent_runtime.ipynb b/cookbooks/agent_runtime.ipynb index 8aed09855..289006f25 100644 --- a/cookbooks/agent_runtime.ipynb +++ b/cookbooks/agent_runtime.ipynb @@ -34,42 +34,7 @@ "languageId": "shellscript" } }, - "outputs": [ - { - "ename": "", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[1;31mFailed to start the Kernel. \n", - "\u001b[1;31mJupyter server crashed. Unable to connect. \n", - "\u001b[1;31mError code from Jupyter: 1\n", - "\u001b[1;31musage: jupyter.py [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]\n", - "\u001b[1;31m [--paths] [--json] [--debug]\n", - "\u001b[1;31m [subcommand]\n", - "\u001b[1;31m\n", - "\u001b[1;31mJupyter: Interactive Computing\n", - "\u001b[1;31m\n", - "\u001b[1;31mpositional arguments:\n", - "\u001b[1;31m subcommand the subcommand to launch\n", - "\u001b[1;31m\n", - "\u001b[1;31moptional arguments:\n", - "\u001b[1;31m -h, --help show this help message and exit\n", - "\u001b[1;31m --version show the versions of core jupyter packages and exit\n", - "\u001b[1;31m --config-dir show Jupyter config dir\n", - "\u001b[1;31m --data-dir show Jupyter data dir\n", - "\u001b[1;31m --runtime-dir show Jupyter runtime dir\n", - "\u001b[1;31m --paths show all Jupyter paths. Add --json for machine-readable\n", - "\u001b[1;31m format.\n", - "\u001b[1;31m --json output paths as machine-readable json\n", - "\u001b[1;31m --debug output debug information about paths\n", - "\u001b[1;31m\n", - "\u001b[1;31mAvailable subcommands:\n", - "\u001b[1;31m\n", - "\u001b[1;31mJupyter command `jupyter-notebook` not found. \n", - "\u001b[1;31mView Jupyter log for further details." - ] - } - ], + "outputs": [], "source": [ "pip install appbuilder-sdk 'appbuilder-sdk[serve]'" ] @@ -383,7 +348,7 @@ }, { "cell_type": "markdown", - "id": "2392f46d",ERNIE Speed-AppBuilder + "id": "2392f46d", "metadata": {}, "source": [ "### 2. Session 数据管理\n", @@ -418,7 +383,7 @@ "class PlaygroundWithHistory(Component):\n", " def __init__(self):\n", " super().__init__()\n", - " self.query_rewrite = QueryRewrite(model=\"ERNIE Speed-AppBuilder\")\n", + " self.query_rewrite = QueryRewrite(model=\"EB-turbo-AppBuilder专用版\")\n", " self.playground = Playground(\n", " prompt_template=\"{query}\",\n", " model=\"ERNIE-Bot\"\n", @@ -543,7 +508,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -557,12 +522,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" - }, - "vscode": { - "interpreter": { - "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6" - } + "version": "3.8.9" } }, "nbformat": 4, From 1a91f348ace307575bee1c8fc5077c379a1facdf Mon Sep 17 00:00:00 2001 From: MrChengmo Date: Mon, 11 Mar 2024 12:11:44 +0800 Subject: [PATCH 08/18] fix agent runtime --- cookbooks/agent_runtime.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbooks/agent_runtime.ipynb b/cookbooks/agent_runtime.ipynb index 289006f25..1760bb52d 100644 --- a/cookbooks/agent_runtime.ipynb +++ b/cookbooks/agent_runtime.ipynb @@ -383,7 +383,7 @@ "class PlaygroundWithHistory(Component):\n", " def __init__(self):\n", " super().__init__()\n", - " self.query_rewrite = QueryRewrite(model=\"EB-turbo-AppBuilder专用版\")\n", + " self.query_rewrite = QueryRewrite(model=\"ERNIE Speed-AppBuilder\")\n", " self.playground = Playground(\n", " prompt_template=\"{query}\",\n", " model=\"ERNIE-Bot\"\n", From 4246c5824512c7d64b15912dc53cf8e2a5d1ef2d Mon Sep 17 00:00:00 2001 From: MrChengmo Date: Mon, 11 Mar 2024 14:23:44 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E9=87=8D=E6=9E=84model=5Fname=5Fmapping?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appbuilder/core/utils.py | 16 ++--- appbuilder/utils/model_util.py | 118 +++++++++++++++++++++++++++------ 2 files changed, 105 insertions(+), 29 deletions(-) diff --git a/appbuilder/core/utils.py b/appbuilder/core/utils.py index 8b6c40859..c9ed19599 100644 --- a/appbuilder/core/utils.py +++ b/appbuilder/core/utils.py @@ -16,7 +16,7 @@ from urllib.parse import urlparse from appbuilder.core._client import HTTPClient from appbuilder.core._exception import TypeNotSupportedException, ModelNotSupportedException -from appbuilder.utils.model_util import GetModelListRequest, Models, model_name_mapping +from appbuilder.utils.model_util import GetModelListRequest, Models, RemoteModelCollector def utils_get_user_agent(): @@ -81,14 +81,14 @@ def __init__(self, client: HTTPClient): self.client = client response = Models(client).list() self.model_list = [*response.result.common, *response.result.custom] + for m in self.model_list: + print("support model name: {}".format(m.name)) def get_model_url(self, model_name: str) -> str: """获取模型在工作台网关的请求url""" origin_name = model_name - for key, value in model_name_mapping.items(): - if origin_name == value: - origin_name = key - break + remote_model_name_collector = RemoteModelCollector() + origin_name = remote_model_name_collector.get_remote_name_by_short_name(origin_name) for model in self.model_list: if model.name == origin_name: return convert_cloudhub_url(self.client, model.url) @@ -98,10 +98,8 @@ def get_model_url(self, model_name: str) -> str: def get_model_type(self, model_name: str) -> str: """获取模型类型""" origin_name = model_name - for key, value in model_name_mapping.items(): - if origin_name == value: - origin_name = key - break + remote_model_name_collector = RemoteModelCollector() + origin_name = remote_model_name_collector.get_remote_name_by_short_name(origin_name) for model in self.model_list: if model.name == origin_name: return model.apiType diff --git a/appbuilder/utils/model_util.py b/appbuilder/utils/model_util.py index 4836820bb..8dbd7f929 100644 --- a/appbuilder/utils/model_util.py +++ b/appbuilder/utils/model_util.py @@ -21,16 +21,105 @@ r"""模型名称到简称的映射. """ -model_name_mapping = { - "ERNIE-Bot 4.0": "eb-4", - "ERNIE-Bot-8K": "eb-8k", - "ERNIE-Bot": "eb", - "ERNIE-Bot-turbo": "eb-turbo", - "EB-turbo-AppBuilder专用版": "ERNIE Speed-AppBuilder", - "ERNIE Speed-AppBuilder": "ERNIE Speed-AppBuilder", - "ernie_speed_appbuilder": "ERNIE Speed-AppBuilder", -} +# Note(chengmo): 模型名称到简称的映射,是一个1:n的映射关系,之前的假设是模型与简称一一对应 +# 实际上,模型名称和简称之间存在多对一的关系,因此这里不能仅使用一个字典来存储名称映射信息 +model_name_mapping = [ + ("ERNIE-Bot 4.0", "eb-4"), + ("ERNIE-Bot-8K", "eb-8k"), + ("ERNIE-Bot", "eb"), + ("ERNIE-Bot-turbo", "eb-turbo"), + ("EB-turbo-AppBuilder专用版", "eb-turbo-appbuilder"), + ("EB-turbo-AppBuilder专用版", "ernie_speed_appbuilder"), + ("EB-turbo-AppBuilder专用版", "ERNIE Speed-AppBuilder"), +] + +class RemoteModel(object): + r"""远程模型类,用于封装远程模型的名称信息. + 参数: + name(str): + 模型名称。 + short_name(str): + 模型简称, 可能存在多个 + """ + def __init__(self, remote_name: str): + self.remote_name = remote_name + self.short_names = [] + + def register_short_name(self, short_name: str): + r"""注册模型简称. + 参数: + short_name(str): + 模型简称。 + """ + if short_name not in self.short_names: + self.short_names.append(short_name) + + def get_remote_name_by_short_name(self, short_name: str) -> Optional[str]: + r"""根据模型简称获取模型名称. + 参数: + short_name(str): + 模型简称。 + """ + if short_name == "eb-turbo-appbuilder": + print("deprecate warning: model [eb-turbo-appbuilder] is deprecated, please use [ERNIE Speed-AppBuilder]") + + if short_name in self.short_names: + return self.remote_name + return None + +class RemoteModelCollector(): + r"""远程模型收集器,用于收集远程模型信息. 是一个全局单例 + 有两个核心功能: + 1、注册远程模型名和本地short_name + 2、根据short_name获取远程模型名 + """ + _instance = None + _initialized = False + def __init__(self): + if self._initialized: + return + self._initialized = True + self.remote_models = {} + + def __new__(cls, *args, **kwargs): + """ + 单例模式 + """ + if cls._instance is None: + cls._instance = object.__new__(cls) + return cls._instance + + def register_remote_model_name(self, remote_name: str, short_name: str): + r"""注册远程模型名和本地short_name. + 参数: + remote_name(str): + 远程模型名称。 + short_name(str): + 模型简称。 + """ + if remote_name not in self.remote_models: + self.remote_models[remote_name] = RemoteModel(remote_name) + + self.remote_models[remote_name].register_short_name(short_name) + + def get_remote_name_by_short_name(self, short_name: str) -> Optional[str]: + r"""根据short_name获取远程模型名. + 参数: + short_name(str): + 模型简称。 + """ + for remote_model in self.remote_models.values(): + remote_name = remote_model.get_remote_name_by_short_name(short_name) + if remote_name is not None: + return remote_name + + return None + + +remote_model_collector = RemoteModelCollector() +for remote_name, short_name in model_name_mapping: + remote_model_collector.register_remote_model_name(remote_name, short_name) class GetModelListRequest(proto.Message): r"""获取模型列表请求体 @@ -255,14 +344,3 @@ def _check_service_error(request_id: str, data: dict): request_id=request_id, service_err_code=data["error_code"], service_err_message=data["error_msg"]) - - -def map_model_name(model_name: str) -> str: - r"""模型名称映射函数 - - 参数: - model_name (str) : 模型名称 - 返回: - str: 映射后的模型名称 - """ - return model_name_mapping.get(model_name, model_name) From 791dab369f277bd0af45a48ca8ff87bb46eee638 Mon Sep 17 00:00:00 2001 From: MrChengmo Date: Mon, 11 Mar 2024 14:25:07 +0800 Subject: [PATCH 10/18] code clean --- appbuilder/core/utils.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/appbuilder/core/utils.py b/appbuilder/core/utils.py index c9ed19599..f68184df0 100644 --- a/appbuilder/core/utils.py +++ b/appbuilder/core/utils.py @@ -81,8 +81,6 @@ def __init__(self, client: HTTPClient): self.client = client response = Models(client).list() self.model_list = [*response.result.common, *response.result.custom] - for m in self.model_list: - print("support model name: {}".format(m.name)) def get_model_url(self, model_name: str) -> str: """获取模型在工作台网关的请求url""" From d2853cdabcdfbf50e4663954cc8fccf984cf5068 Mon Sep 17 00:00:00 2001 From: MrChengmo Date: Mon, 11 Mar 2024 14:28:35 +0800 Subject: [PATCH 11/18] add todo --- appbuilder/utils/model_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appbuilder/utils/model_util.py b/appbuilder/utils/model_util.py index 8dbd7f929..f7576c399 100644 --- a/appbuilder/utils/model_util.py +++ b/appbuilder/utils/model_util.py @@ -60,8 +60,9 @@ def get_remote_name_by_short_name(self, short_name: str) -> Optional[str]: short_name(str): 模型简称。 """ + # TODO(chengmo): 使用logging 替换 print,解决print多次的问题 if short_name == "eb-turbo-appbuilder": - print("deprecate warning: model [eb-turbo-appbuilder] is deprecated, please use [ERNIE Speed-AppBuilder]") + print("Deprecate warning: model [eb-turbo-appbuilder] is deprecated, please use [ERNIE Speed-AppBuilder]") if short_name in self.short_names: return self.remote_name From eba59b9a1a8a9d2958cec7dade73e02aa4c9be79 Mon Sep 17 00:00:00 2001 From: MrChengmo Date: Tue, 12 Mar 2024 08:43:37 +0800 Subject: [PATCH 12/18] fixed readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 295073bce..b659fb801 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ print(", ".join(models)) 填写自己的Token,获取模型列表输出如下: ``` shell -ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, ERNIE Speed-AppBuilder, Qianfan-Chinese-Llama-2-7B, Yi-34B-Chat, Llama-2-7B-Chat, Llama-2-13B-Chat, Llama-2-70B-Chat, ChatGLM2-6B-32K, ChatLaw, BLOOMZ-7B, Qianfan-BLOOMZ-7B-compressed, AquilaChat-7B +ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, EB-turbo-AppBuilder专用版, Qianfan-Chinese-Llama-2-7B, Yi-34B-Chat, Llama-2-7B-Chat, Llama-2-13B-Chat, Llama-2-70B-Chat, ChatGLM2-6B-32K, ChatLaw, BLOOMZ-7B, Qianfan-BLOOMZ-7B-compressed, AquilaChat-7B ``` 为方便用户更容易使用模型,以下是一些模型的短名称 From 64aef9e187476c6d7d2d1e156e3eaab31fb107d7 Mon Sep 17 00:00:00 2001 From: MrChengmo Date: Tue, 12 Mar 2024 08:46:29 +0800 Subject: [PATCH 13/18] add todo --- appbuilder/core/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appbuilder/core/utils.py b/appbuilder/core/utils.py index f68184df0..ad7f40932 100644 --- a/appbuilder/core/utils.py +++ b/appbuilder/core/utils.py @@ -22,7 +22,9 @@ def utils_get_user_agent(): return 'appbuilder-sdk-python/{}'.format("__version__") - +# Todo(chengmo): 此处返回的模型名称为原始名称,并非推荐使用的short name +# 应当返回一个详细的列表,告知用户原始名 + 对应的short名 +# 同时考虑是否返回每个模型可用的余额 def get_model_list(secret_key: str = "", api_type_filter: List[str] = [], is_available: bool = False) -> list: """ 返回用户的模型列表。 From 2352a2574bdfcfff22f0ba7413d9318781a85b3d Mon Sep 17 00:00:00 2001 From: MrChengmo Date: Tue, 12 Mar 2024 08:50:19 +0800 Subject: [PATCH 14/18] update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b659fb801..2f533e57b 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ ERNIE-Bot 4.0, ERNIE-Bot-8K, ERNIE-Bot, ERNIE-Bot-turbo, EB-turbo-AppBuilder专 | ERNIE-Bot-8K | eb-8k | | ERNIE-Bot | eb | | ERNIE-Bot-turbo | eb-turbo | +| EB-turbo-AppBuilder专用版 | ernie_speed_appbuilder | | ERNIE Speed-AppBuilder | ernie_speed_appbuilder | From 2288b91f536820e5c2244aed96487f3cdf926c1e Mon Sep 17 00:00:00 2001 From: ideoutrea Date: Tue, 12 Mar 2024 15:50:38 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E5=BF=BD=E7=95=A5=E6=9C=AA=E7=9F=A5?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8C=E9=81=BF=E5=85=8D=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appbuilder/utils/model_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appbuilder/utils/model_util.py b/appbuilder/utils/model_util.py index 91270594b..639490b1c 100644 --- a/appbuilder/utils/model_util.py +++ b/appbuilder/utils/model_util.py @@ -234,7 +234,7 @@ def list(self, request: GetModelListRequest = None, timeout: float = None, self.http_client.check_response_json(data) request_id = self.http_client.response_request_id(response) self.__class__._check_service_error(request_id, data) - response = GetModelListResponse.from_json(payload=json.dumps(data)) + response = GetModelListResponse.from_json(payload=json.dumps(data), ignore_unknown_fields=True) response.request_id = request_id return response From 4d7f31d33f0961e7e4d8e59e37432297c6e97c41 Mon Sep 17 00:00:00 2001 From: MrChengmo Date: Tue, 12 Mar 2024 20:13:23 +0800 Subject: [PATCH 16/18] fix get_model_type & get_model_url when model hasn't short name --- appbuilder/core/utils.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/appbuilder/core/utils.py b/appbuilder/core/utils.py index ad7f40932..fa6af8f31 100644 --- a/appbuilder/core/utils.py +++ b/appbuilder/core/utils.py @@ -86,9 +86,11 @@ def __init__(self, client: HTTPClient): def get_model_url(self, model_name: str) -> str: """获取模型在工作台网关的请求url""" - origin_name = model_name + short_name = model_name remote_model_name_collector = RemoteModelCollector() - origin_name = remote_model_name_collector.get_remote_name_by_short_name(origin_name) + origin_name = remote_model_name_collector.get_remote_name_by_short_name(short_name) + if not origin_name: + origin_name = short_name for model in self.model_list: if model.name == origin_name: return convert_cloudhub_url(self.client, model.url) @@ -97,9 +99,11 @@ def get_model_url(self, model_name: str) -> str: def get_model_type(self, model_name: str) -> str: """获取模型类型""" - origin_name = model_name + short_name = model_name remote_model_name_collector = RemoteModelCollector() - origin_name = remote_model_name_collector.get_remote_name_by_short_name(origin_name) + origin_name = remote_model_name_collector.get_remote_name_by_short_name(short_name) + if not origin_name: + origin_name = short_name for model in self.model_list: if model.name == origin_name: return model.apiType From 31ac0aa96dcaec92c380f72f360fa11e590fb3e1 Mon Sep 17 00:00:00 2001 From: wangmin24 Date: Tue, 12 Mar 2024 20:39:24 +0800 Subject: [PATCH 17/18] =?UTF-8?q?wangmin:=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/components/gbi/select_table/README.md | 8 ++++---- .../components/rag_with_baidu_search/README.md | 18 +++++++----------- appbuilder/core/components/translate/README.md | 1 - 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/appbuilder/core/components/gbi/select_table/README.md b/appbuilder/core/components/gbi/select_table/README.md index b5b0558e3..e9fb27323 100644 --- a/appbuilder/core/components/gbi/select_table/README.md +++ b/appbuilder/core/components/gbi/select_table/README.md @@ -1,13 +1,13 @@ # GBI 选表 ## 简介 -GBI 选表,根据提供的多个 MySql 表名 以及 表名对应的描述信息,通过 query 选择一个或多个最合适的表来回答该 query. -一般的试用场景是,当有数据库有多个表的时候,但是实际只有1个表能回答该 query,那么,通过该能力将该表选择出来,用于后面的 问表 环节。 +GBI 选表:根据提供的多个 MySql 表名 以及 表名对应的描述信息,通过 query 选择一个或多个最合适的表来回答该 query。 +一般的适用场景是,当有数据库有多个表的时候,但是实际只有1个表能回答该 query,那么,通过该能力将该表选择出来,用于后面的 问表 环节。 ### 功能介绍 -GBI 选表,根据提供的多个 MySql 表名 以及 表名对应的描述信息,通过 query 选择一个或多个最合适的表来回答该 query. -一般的试用场景是,当有数据库有多个表的时候,但是实际只有1个表能回答该 query,那么,通过该能力将该表选择出来,用于后面的 问表 环节。 +GBI 选表,根据提供的多个 MySql 表名 以及 表名对应的描述信息,通过 query 选择一个或多个最合适的表来回答该 query。 +一般的适用场景是,当有数据库有多个表的时候,但是实际只有1个表能回答该 query,那么,通过该能力将该表选择出来,用于后面的 问表 环节。 ### 特色优势 可直接通过上传Excel进行数据问答 diff --git a/appbuilder/core/components/rag_with_baidu_search/README.md b/appbuilder/core/components/rag_with_baidu_search/README.md index 637354081..f30f4e07c 100644 --- a/appbuilder/core/components/rag_with_baidu_search/README.md +++ b/appbuilder/core/components/rag_with_baidu_search/README.md @@ -1,23 +1,19 @@ -# RAG With BaiduSearch +# 百度搜索 ## 简介 -RAG with BaiduSearch是基于生成式大模型的问答组件,使用百度搜索引擎检索候选文本进行检索增强,通过与百度搜索引擎集成, -该组件可以更好地理解问题并提供更准确的答案。 +百度搜索(BaiduSearch),通过百度搜索引擎搜索相关内容。 ### 功能介绍 -RAG with BaiduSearch利用生成式大模型技术,并结合百度搜索引擎的检索能力,实现了强大的问答功能。该组件能够根据用户提出的问题,从互联网上获取候选文本,通过模型理解并生成准确的答案。 +百度搜索是最大的中文搜索引擎,帮助用户在海量信息中找到最需要的内容。 ### 特色优势 -整合百度搜索引擎:通过与百度搜索引擎的集成,能够实现更全面、准确的信息检索,为用户提供更具参考价值的答案。 -生成式大模型支持:利用生成式大模型技术,能够处理复杂的自然语言问题,并生成高质量的答案,提供更智能的问答服务。 -实时检索和分析:支持对实时的互联网文本数据进行检索和分析,保证了信息的及时性和准确性。 +百度搜索凭借先进的中文搜索技术、个性化推荐、全面的信息覆盖、即时的搜索结果和强大的安全防护,为用户提供快速、准确、安全的搜索体验,满足多样化的信息需求。 -### 适用场景 -智能客服:可用于构建智能客服系统,帮助用户快速获取相关信息和解决问题。 -知识库问答:可用于构建企业内部或公共领域的问答系统,提供高效的知识检索和问答服务。 +### 应用场景 +通用搜索领域 ## 基本用法 -以下是一个简单的例子来演示如何开始使用RAG With BaiduSearch组件: +以下是一个简单的例子来演示如何开始使用百度搜索组件: ```python import appbuilder diff --git a/appbuilder/core/components/translate/README.md b/appbuilder/core/components/translate/README.md index 5391f154d..a7b8b9b21 100644 --- a/appbuilder/core/components/translate/README.md +++ b/appbuilder/core/components/translate/README.md @@ -55,7 +55,6 @@ os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" 无 ### 调用参数说明 -语种列表详见[语种列表](#语种列表) |参数名称 |参数类型 |是否必须 |描述 | 示例值 | |--------|--------|--------|----|--------| From 98a4e2dcfaf5dacbe7553fb4810c7b0c0d81f6cb Mon Sep 17 00:00:00 2001 From: wangmin24 Date: Wed, 13 Mar 2024 10:34:23 +0800 Subject: [PATCH 18/18] =?UTF-8?q?wangmin:=E6=9B=B4=E6=96=B0=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appbuilder/core/components/animal_recognize/README.md | 2 +- appbuilder/core/components/asr/README.md | 2 +- appbuilder/core/components/dish_recognize/README.md | 2 +- appbuilder/core/components/doc_crop_enhance/README.md | 2 +- appbuilder/core/components/doc_parser/README.md | 2 +- appbuilder/core/components/doc_splitter/README.md | 4 ++-- appbuilder/core/components/embeddings/README.md | 2 +- appbuilder/core/components/extract_table/README.md | 2 +- appbuilder/core/components/general_ocr/README.md | 2 +- appbuilder/core/components/handwrite_ocr/README.md | 2 +- appbuilder/core/components/image_understand/README.md | 2 +- appbuilder/core/components/landmark_recognize/README.md | 2 +- appbuilder/core/components/llms/dialog_summary/README.md | 2 +- appbuilder/core/components/llms/is_complex_query/README.md | 2 +- appbuilder/core/components/llms/mrc/README.md | 2 +- appbuilder/core/components/llms/nl2pandas/README.md | 2 +- .../core/components/llms/oral_query_generation/README.md | 2 +- appbuilder/core/components/llms/qa_pair_mining/README.md | 2 +- appbuilder/core/components/llms/query_decomposition/README.md | 2 +- appbuilder/core/components/llms/query_rewrite/README.md | 2 +- appbuilder/core/components/llms/style_rewrite/README.md | 2 +- appbuilder/core/components/llms/style_writing/README.md | 2 +- appbuilder/core/components/llms/tag_extraction/README.md | 2 +- appbuilder/core/components/matching/README.md | 2 +- appbuilder/core/components/mix_card_ocr/README.md | 2 +- appbuilder/core/components/object_recognize/README.md | 2 +- appbuilder/core/components/plant_recognize/README.md | 2 +- appbuilder/core/components/qrcode_ocr/README.md | 2 +- appbuilder/core/components/rag_with_baidu_search/README.md | 2 +- appbuilder/core/components/retriever/README.md | 2 +- appbuilder/core/components/table_ocr/README.md | 2 +- appbuilder/core/components/text_to_image/README.md | 2 +- appbuilder/core/components/translate/README.md | 2 +- appbuilder/core/components/tts/README.md | 2 +- appbuilder/core/console/dataset/README.md | 2 +- appbuilder/core/console/rag/README.md | 2 +- docs/get_model_list.md | 2 +- 37 files changed, 38 insertions(+), 38 deletions(-) diff --git a/appbuilder/core/components/animal_recognize/README.md b/appbuilder/core/components/animal_recognize/README.md index 3d42221d9..478fd45b9 100644 --- a/appbuilder/core/components/animal_recognize/README.md +++ b/appbuilder/core/components/animal_recognize/README.md @@ -45,7 +45,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/asr/README.md b/appbuilder/core/components/asr/README.md index 14fb73118..1d48e79fe 100644 --- a/appbuilder/core/components/asr/README.md +++ b/appbuilder/core/components/asr/README.md @@ -38,7 +38,7 @@ print(out.content) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/dish_recognize/README.md b/appbuilder/core/components/dish_recognize/README.md index 16f6af62f..241552efd 100644 --- a/appbuilder/core/components/dish_recognize/README.md +++ b/appbuilder/core/components/dish_recognize/README.md @@ -39,7 +39,7 @@ print(resp.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/doc_crop_enhance/README.md b/appbuilder/core/components/doc_crop_enhance/README.md index 34d3900a1..d3cdc62f1 100644 --- a/appbuilder/core/components/doc_crop_enhance/README.md +++ b/appbuilder/core/components/doc_crop_enhance/README.md @@ -43,7 +43,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/doc_parser/README.md b/appbuilder/core/components/doc_parser/README.md index 416bb887b..5d66bed5d 100644 --- a/appbuilder/core/components/doc_parser/README.md +++ b/appbuilder/core/components/doc_parser/README.md @@ -52,7 +52,7 @@ print(parse_result.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/doc_splitter/README.md b/appbuilder/core/components/doc_splitter/README.md index 1ccc07f2d..01185f1a6 100644 --- a/appbuilder/core/components/doc_splitter/README.md +++ b/appbuilder/core/components/doc_splitter/README.md @@ -57,7 +57,7 @@ print(res_paras.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" @@ -128,7 +128,7 @@ print(res_paras.content) ## 参数说明: ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/embeddings/README.md b/appbuilder/core/components/embeddings/README.md index 3c66b8312..f3c54390d 100644 --- a/appbuilder/core/components/embeddings/README.md +++ b/appbuilder/core/components/embeddings/README.md @@ -103,7 +103,7 @@ print(outs.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/extract_table/README.md b/appbuilder/core/components/extract_table/README.md index 3dd48a4d9..2a0b9c1cd 100644 --- a/appbuilder/core/components/extract_table/README.md +++ b/appbuilder/core/components/extract_table/README.md @@ -52,7 +52,7 @@ logger.info("Tables: {}".format( ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/general_ocr/README.md b/appbuilder/core/components/general_ocr/README.md index 7063e3f47..b32d68469 100644 --- a/appbuilder/core/components/general_ocr/README.md +++ b/appbuilder/core/components/general_ocr/README.md @@ -38,7 +38,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/handwrite_ocr/README.md b/appbuilder/core/components/handwrite_ocr/README.md index 32669779b..a0ad06631 100644 --- a/appbuilder/core/components/handwrite_ocr/README.md +++ b/appbuilder/core/components/handwrite_ocr/README.md @@ -44,7 +44,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/components/image_understand/README.md b/appbuilder/core/components/image_understand/README.md index 0dd9bfc3c..649a13091 100644 --- a/appbuilder/core/components/image_understand/README.md +++ b/appbuilder/core/components/image_understand/README.md @@ -37,7 +37,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os os.environ["APPBUILDER_TOKEN"] = "..." diff --git a/appbuilder/core/components/landmark_recognize/README.md b/appbuilder/core/components/landmark_recognize/README.md index 06abfcdb1..70c69cf33 100644 --- a/appbuilder/core/components/landmark_recognize/README.md +++ b/appbuilder/core/components/landmark_recognize/README.md @@ -44,7 +44,7 @@ print(out.content) # eg: {"landmark": "尼罗河"} ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/components/llms/dialog_summary/README.md b/appbuilder/core/components/llms/dialog_summary/README.md index 3e0bb4efd..f7d12fff2 100644 --- a/appbuilder/core/components/llms/dialog_summary/README.md +++ b/appbuilder/core/components/llms/dialog_summary/README.md @@ -32,7 +32,7 @@ print(answer) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/is_complex_query/README.md b/appbuilder/core/components/llms/is_complex_query/README.md index cd03f9183..b38fd6eac 100644 --- a/appbuilder/core/components/llms/is_complex_query/README.md +++ b/appbuilder/core/components/llms/is_complex_query/README.md @@ -33,7 +33,7 @@ print("Answer: \n{}".format(answer.content)) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/mrc/README.md b/appbuilder/core/components/llms/mrc/README.md index 9f8addb33..75f2c6a6f 100644 --- a/appbuilder/core/components/llms/mrc/README.md +++ b/appbuilder/core/components/llms/mrc/README.md @@ -63,7 +63,7 @@ print(result) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 import os diff --git a/appbuilder/core/components/llms/nl2pandas/README.md b/appbuilder/core/components/llms/nl2pandas/README.md index 7673c06c8..2c5190631 100644 --- a/appbuilder/core/components/llms/nl2pandas/README.md +++ b/appbuilder/core/components/llms/nl2pandas/README.md @@ -37,7 +37,7 @@ answer = nl2pandas(query, table_info = table_info) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/oral_query_generation/README.md b/appbuilder/core/components/llms/oral_query_generation/README.md index 10035f3ff..714d0bbfe 100644 --- a/appbuilder/core/components/llms/oral_query_generation/README.md +++ b/appbuilder/core/components/llms/oral_query_generation/README.md @@ -33,7 +33,7 @@ print(result) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/qa_pair_mining/README.md b/appbuilder/core/components/llms/qa_pair_mining/README.md index 9fbb10c4d..03f9025dc 100644 --- a/appbuilder/core/components/llms/qa_pair_mining/README.md +++ b/appbuilder/core/components/llms/qa_pair_mining/README.md @@ -36,7 +36,7 @@ print(">>> Output: {}".format(answer.content)) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/query_decomposition/README.md b/appbuilder/core/components/llms/query_decomposition/README.md index 4161a4f16..de2a7e20b 100644 --- a/appbuilder/core/components/llms/query_decomposition/README.md +++ b/appbuilder/core/components/llms/query_decomposition/README.md @@ -33,7 +33,7 @@ print("Answer: \n{}".format(answer.content)) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/query_rewrite/README.md b/appbuilder/core/components/llms/query_rewrite/README.md index 7958b2110..2887685d9 100644 --- a/appbuilder/core/components/llms/query_rewrite/README.md +++ b/appbuilder/core/components/llms/query_rewrite/README.md @@ -32,7 +32,7 @@ print(answer) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/style_rewrite/README.md b/appbuilder/core/components/llms/style_rewrite/README.md index eaf633652..46607cfdc 100644 --- a/appbuilder/core/components/llms/style_rewrite/README.md +++ b/appbuilder/core/components/llms/style_rewrite/README.md @@ -42,7 +42,7 @@ answer = style_rewrite(appbuilder.Message("文心大模型发布新版"), style= ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/style_writing/README.md b/appbuilder/core/components/llms/style_writing/README.md index a5c1cb8ed..3d8f71cf0 100644 --- a/appbuilder/core/components/llms/style_writing/README.md +++ b/appbuilder/core/components/llms/style_writing/README.md @@ -41,7 +41,7 @@ print(answer) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/llms/tag_extraction/README.md b/appbuilder/core/components/llms/tag_extraction/README.md index f495760c7..b8ac08b91 100644 --- a/appbuilder/core/components/llms/tag_extraction/README.md +++ b/appbuilder/core/components/llms/tag_extraction/README.md @@ -40,7 +40,7 @@ result = tag_extraction(appbuilder.Message("从这段文本中抽取关键标签 ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/matching/README.md b/appbuilder/core/components/matching/README.md index 08a679f90..3134870eb 100644 --- a/appbuilder/core/components/matching/README.md +++ b/appbuilder/core/components/matching/README.md @@ -46,7 +46,7 @@ print(contexts_matched.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/mix_card_ocr/README.md b/appbuilder/core/components/mix_card_ocr/README.md index f1a09040b..6d9b0e09b 100644 --- a/appbuilder/core/components/mix_card_ocr/README.md +++ b/appbuilder/core/components/mix_card_ocr/README.md @@ -47,7 +47,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/components/object_recognize/README.md b/appbuilder/core/components/object_recognize/README.md index c72f3a347..ed15fd24c 100644 --- a/appbuilder/core/components/object_recognize/README.md +++ b/appbuilder/core/components/object_recognize/README.md @@ -40,7 +40,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/plant_recognize/README.md b/appbuilder/core/components/plant_recognize/README.md index f7781526e..bbd045297 100644 --- a/appbuilder/core/components/plant_recognize/README.md +++ b/appbuilder/core/components/plant_recognize/README.md @@ -41,7 +41,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/components/qrcode_ocr/README.md b/appbuilder/core/components/qrcode_ocr/README.md index 8093a4b22..c26ee99db 100644 --- a/appbuilder/core/components/qrcode_ocr/README.md +++ b/appbuilder/core/components/qrcode_ocr/README.md @@ -46,7 +46,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/rag_with_baidu_search/README.md b/appbuilder/core/components/rag_with_baidu_search/README.md index f30f4e07c..f04045117 100644 --- a/appbuilder/core/components/rag_with_baidu_search/README.md +++ b/appbuilder/core/components/rag_with_baidu_search/README.md @@ -39,7 +39,7 @@ print(result) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/components/retriever/README.md b/appbuilder/core/components/retriever/README.md index fa0a74df5..73a4b494d 100644 --- a/appbuilder/core/components/retriever/README.md +++ b/appbuilder/core/components/retriever/README.md @@ -49,7 +49,7 @@ vector_index.delete_all_segments() ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/table_ocr/README.md b/appbuilder/core/components/table_ocr/README.md index 9d00d0f75..6814e6a15 100644 --- a/appbuilder/core/components/table_ocr/README.md +++ b/appbuilder/core/components/table_ocr/README.md @@ -47,7 +47,7 @@ print(out.content) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/text_to_image/README.md b/appbuilder/core/components/text_to_image/README.md index 18f0a3afe..870103530 100644 --- a/appbuilder/core/components/text_to_image/README.md +++ b/appbuilder/core/components/text_to_image/README.md @@ -31,7 +31,7 @@ print(out.content) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/components/translate/README.md b/appbuilder/core/components/translate/README.md index a7b8b9b21..47e20bbc4 100644 --- a/appbuilder/core/components/translate/README.md +++ b/appbuilder/core/components/translate/README.md @@ -43,7 +43,7 @@ print(resp.content) ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 diff --git a/appbuilder/core/components/tts/README.md b/appbuilder/core/components/tts/README.md index 15f8b03d3..61e9a0e13 100644 --- a/appbuilder/core/components/tts/README.md +++ b/appbuilder/core/components/tts/README.md @@ -46,7 +46,7 @@ print("成功将文本转语音,wav格式文件已写入:{}".format(wav_samp ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python import os diff --git a/appbuilder/core/console/dataset/README.md b/appbuilder/core/console/dataset/README.md index 7f84a8e99..907998c6f 100644 --- a/appbuilder/core/console/dataset/README.md +++ b/appbuilder/core/console/dataset/README.md @@ -51,7 +51,7 @@ dataset.delete_documents(document_ids) ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/appbuilder/core/console/rag/README.md b/appbuilder/core/console/rag/README.md index 690bc0517..ad688590e 100644 --- a/appbuilder/core/console/rag/README.md +++ b/appbuilder/core/console/rag/README.md @@ -37,7 +37,7 @@ print(answer.extra) # 获取结果来源 ## 参数说明 ### 鉴权说明 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" diff --git a/docs/get_model_list.md b/docs/get_model_list.md index 1482e6e24..7e82f6b41 100644 --- a/docs/get_model_list.md +++ b/docs/get_model_list.md @@ -19,7 +19,7 @@ print(models) ## 参数说明 ### 鉴权配置 -使用组件之前,请首先申请并设置鉴权参数,可参考[SDK使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 +使用组件之前,请首先申请并设置鉴权参数,可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。 ```python # 设置环境中的TOKEN,以下示例略 os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN"