diff --git a/README.md b/README.md index ff177d909..2c51dcf69 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ template_str = "你扮演{role}, 请回答我的问题。\n\n问题:{question} # 定义输入,调用playground组件 input = appbuilder.Message({"role": "java工程师", "question": "请简要回答java语言的内存回收机制是什么,要求100字以内"}) -playground = appbuilder.Playground(prompt_template=template_str, model="ERNIE Speed-AppBuilder") +playground = appbuilder.Playground(prompt_template=template_str, model="Qianfan-Appbuilder-Speed-8k") # 以打字机的方式,流式展示大模型回答内容 output = playground(input, stream=True, temperature=1e-10) @@ -157,7 +157,7 @@ import os # 设置环境中的TOKEN,以下TOKEN为访问和QPS受限的试用TOKEN,正式使用请替换为您的个人TOKEN os.environ["APPBUILDER_TOKEN"] = "bce-v3/ALTAK-n5AYUIUJMarF7F7iFXVeK/1bf65eed7c8c7efef9b11388524fa1087f90ea58" -rag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model="ERNIE Speed-AppBuilder") +rag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model="Qianfan-Appbuilder-Speed-8k") input = appbuilder.Message("9.11和9.8哪个大") result = rag_with_baidu_search_pro.run( diff --git a/appbuilder/core/agent.py b/appbuilder/core/agent.py index 27cce613a..dd4a2d1d2 100644 --- a/appbuilder/core/agent.py +++ b/appbuilder/core/agent.py @@ -108,7 +108,7 @@ class AgentRuntime(BaseModel): class PlaygroundWithHistory(Component): def __init__(self): super().__init__() - self.query_rewrite = QueryRewrite(model="ERNIE Speed-AppBuilder") + self.query_rewrite = QueryRewrite(model="Qianfan-Appbuilder-Speed-8k") self.play = Playground( prompt_template="{query}", model="eb-4" diff --git a/appbuilder/core/components/gbi/nl2sql/README.md b/appbuilder/core/components/gbi/nl2sql/README.md index 8b55f38ae..1ae778a87 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, ERNIE-Bot-turbo, ERNIE Speed-AppBuilder +- model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, Qianfan-Appbuilder-Speed-8k - table_schemas: 表的 schema,例如: ``` diff --git a/appbuilder/core/components/gbi/nl2sql/component.py b/appbuilder/core/components/gbi/nl2sql/component.py index 40abe709b..2b6f9b7fa 100644 --- a/appbuilder/core/components/gbi/nl2sql/component.py +++ b/appbuilder/core/components/gbi/nl2sql/component.py @@ -38,7 +38,7 @@ def __init__(self, model_name: str, table_schemas: List[str], knowledge: Dict = 创建 gbi nl2sql 对象 Args: - model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, ERNIE Speed-AppBuilder + model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, Qianfan-Appbuilder-Speed-8k 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 b8999ed8c..bc7ce9176 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, ERNIE-Bot-turbo, ERNIE Speed-AppBuilder +- model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, Qianfan-Appbuilder-Speed-8k - 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 7558316ad..f0d7511d8 100644 --- a/appbuilder/core/components/gbi/select_table/component.py +++ b/appbuilder/core/components/gbi/select_table/component.py @@ -36,7 +36,7 @@ def __init__(self, model_name: str, table_descriptions: Dict[str, str], 创建 GBI 选表对象 Args: - model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, ERNIE Speed-AppBuilder + model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, Qianfan-Appbuilder-Speed-8k 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 f7d12fff2..05a9eb786 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("ERNIE Speed-AppBuilder") +dialog_summary = appbuilder.DialogSummary("Qianfan-Appbuilder-Speed-8k") 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 bb81a0c46..9da11d2d9 100644 --- a/appbuilder/core/components/llms/dialog_summary/component.py +++ b/appbuilder/core/components/llms/dialog_summary/component.py @@ -32,7 +32,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("ERNIE Speed-AppBuilder") + dialog_summary = appbuilder.DialogSummary("Qianfan-Appbuilder-Speed-8k") text = "用户:喂我想查一下我的话费\n坐席:好的女士您话费余的话还有87.49元钱\n用户:好的知道了谢谢\n坐席:嗯不客气祝您生活愉快再见" answer = dialog_summary(appbuilder.Message(text)) print(answer) diff --git a/appbuilder/core/components/llms/hallucination_detection/README.md b/appbuilder/core/components/llms/hallucination_detection/README.md index 95b4dd196..66bf8b206 100644 --- a/appbuilder/core/components/llms/hallucination_detection/README.md +++ b/appbuilder/core/components/llms/hallucination_detection/README.md @@ -37,8 +37,8 @@ context = \ 很多怕胖的女生看到猪皮就怕怕,但其实猪皮含有大量胶原蛋白,营养价值很高呢!这里红通通的猪皮还经过韩国秘制酱汁处理过,会有一点点辣味。烤猪皮的时候也需特别注意火侯,这样吃起来才会有外脆内Q的口感!''' answer = '澳门新麻蒲烤肉店并不是每天开门。' -#! 该组件推荐使用ERNIE Speed-AppBuilder模型。 -hallucination_detection = appbuilder.HallucinationDetection('ERNIE Speed-AppBuilder') +#! 该组件推荐使用Qianfan-Appbuilder-Speed-8k模型。 +hallucination_detection = appbuilder.HallucinationDetection('Qianfan-Appbuilder-Speed-8k') inputs = {'query': query, 'context': context, 'answer': answer} msg = appbuilder.Message(inputs) result = hallucination_detection.run(msg) @@ -58,7 +58,7 @@ os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" ### 初始化参数 | 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 | | ------- | ------- | -------- | -------- | -------- | -| `model` | str | 是 | 模型名称,用于指定要使用的千帆模型。推荐使用ERNIE Speed-AppBuilder模型。 | ERNIE Speed-AppBuilder | +| `model` | str | 是 | 模型名称,用于指定要使用的千帆模型。推荐使用Qianfan-Appbuilder-Speed-8k模型。 | Qianfan-Appbuilder-Speed-8k | | `secret_key` | str | 否 | 用户鉴权token,默认从环境变量中获取: `os.getenv("APPBUILDER_TOKEN", "")` | bce-v3/XXX | | `gateway` | str | 否 | 后端网关服务地址,默认从环境变量中获取: `os.getenv("GATEWAY_URL", "")` | https://appbuilder.baidu.com | | `lazy_certification` | bool | 否 | 延迟认证,为True时在第一次运行时认证。默认为False。 | False | diff --git a/appbuilder/core/components/llms/hallucination_detection/component.py b/appbuilder/core/components/llms/hallucination_detection/component.py index 4e8298917..48fc83dfd 100644 --- a/appbuilder/core/components/llms/hallucination_detection/component.py +++ b/appbuilder/core/components/llms/hallucination_detection/component.py @@ -26,7 +26,7 @@ class HallucinationDetection(CompletionBaseComponent): """ 幻觉检测。输入,判断answer中是否存在幻觉。 - *注:该组件推荐使用ERNIE Speed-AppBuilder模型。* + *注:该组件推荐使用Qianfan-Appbuilder-Speed-8k模型。* Examples: @@ -103,7 +103,7 @@ def __init__( """初始化幻觉检测组件。 Args: - model (str|None): 模型名称,用于指定要使用的千帆模型。推荐使用ERNIE Speed-AppBuilder模型。 + model (str|None): 模型名称,用于指定要使用的千帆模型。推荐使用Qianfan-Appbuilder-Speed-8k模型。 secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv("APPBUILDER_TOKEN", ""). gateway (str, 可选): 后端网关服务地址,默认从环境变量中获取: os.getenv("GATEWAY_URL", "") lazy_certification (bool, 可选): 延迟认证,为True时在第一次运行时认证. Defaults to False. diff --git a/appbuilder/core/components/llms/is_complex_query/README.md b/appbuilder/core/components/llms/is_complex_query/README.md index b38fd6eac..b5f70f0f7 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="ERNIE Speed-AppBuilder") +is_complex_query = appbuilder.IsComplexQuery(model="Qianfan-Appbuilder-Speed-8k") msg = "吸塑包装盒在工业化生产和物流运输中分别有什么重要性?" msg = appbuilder.Message(msg) @@ -42,7 +42,7 @@ os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" ### 初始化参数 |参数名称 |参数类型 |是否必须 |描述 |示例值| |--------|--------|--------|----|------| -|model |str |是 |模型名称,用于指定要使用的千帆模型|ERNIE Speed-AppBuilder| +|model |str |是 |模型名称,用于指定要使用的千帆模型|Qianfan-Appbuilder-Speed-8k| ### 调用参数 |参数名称 |参数类型 |是否必须 |描述 |示例值| diff --git a/appbuilder/core/components/llms/is_complex_query/component.py b/appbuilder/core/components/llms/is_complex_query/component.py index 5379c0388..662d4f01a 100644 --- a/appbuilder/core/components/llms/is_complex_query/component.py +++ b/appbuilder/core/components/llms/is_complex_query/component.py @@ -38,7 +38,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="ERNIE Speed-AppBuilder") + is_complex_query = appbuilder.IsComplexQuery(model="Qianfan-Appbuilder-Speed-8k") msg = "吸塑包装盒在工业化生产和物流运输中分别有什么重要性?" msg = appbuilder.Message(msg) diff --git a/appbuilder/core/components/llms/mrc/README.md b/appbuilder/core/components/llms/mrc/README.md index 75f2c6a6f..ff1ad9fd0 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、ERNIE Speed-AppBuilder等,每个版本都针对特定的应用场景进行了优化。 用户可以根据自己的需求选择最适合的模型版本,以获得最佳的性能。 + - 1.多版本模型支持:我们的MRC模块包括不同版本的文新一言大模型,Erniebot 4.0、Qianfan-Appbuilder-Speed-8k等,每个版本都针对特定的应用场景进行了优化。 用户可以根据自己的需求选择最适合的模型版本,以获得最佳的性能。 - 2.答案格式的多样性: - 拒答功能:当问题超出模型知识范围或不具体时,模型可以选择不回答,避免提供误导性信息。 - 澄清功能:对于模棱两可或含糊的问题,模型可以请求更多信息或对问题进行澄清,以确保答案的准确性。 @@ -41,7 +41,7 @@ import os os.environ["APPBUILDER_TOKEN"] = "..." # 创建MRC对象 -mrc_component = appbuilder.MRC(model="ERNIE Speed-AppBuilder") +mrc_component = appbuilder.MRC(model="Qianfan-Appbuilder-Speed-8k") # 初始化参数 msg = "残疾人怎么办相关证件" @@ -119,7 +119,7 @@ import os os.environ["APPBUILDER_TOKEN"] = '...' # 创建MRC对象 -mrc_component = appbuilder.MRC(model="ERNIE Speed-AppBuilder") +mrc_component = appbuilder.MRC(model="Qianfan-Appbuilder-Speed-8k") # 初始化参数 msg = "残疾人怎么办相关证件" diff --git a/appbuilder/core/components/llms/nl2pandas/README.md b/appbuilder/core/components/llms/nl2pandas/README.md index 2c5190631..81f1210c8 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="ERNIE Speed-AppBuilder") +nl2pandas = appbuilder.Nl2pandasComponent(model="Qianfan-Appbuilder-Speed-8k") 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 d9e5b0a40..eb13e5bcf 100644 --- a/appbuilder/core/components/llms/nl2pandas/component.py +++ b/appbuilder/core/components/llms/nl2pandas/component.py @@ -38,7 +38,7 @@ class Nl2pandasComponent(CompletionBaseComponent): query = "海淀区有哪些学校" query = appbuilder.Message(query) - nl2pandas = appbuilder.Nl2pandasComponent(model="ERNIE Speed-AppBuilder") + nl2pandas = appbuilder.Nl2pandasComponent(model="Qianfan-Appbuilder-Speed-8k") 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 c82b50381..4e700d3e8 100644 --- a/appbuilder/core/components/llms/oral_query_generation/README.md +++ b/appbuilder/core/components/llms/oral_query_generation/README.md @@ -28,8 +28,8 @@ text = ('文档标题:在OPPO Reno5上使用视频超级防抖\n' '防抖后手机屏幕将出现超级防抖Pro开关,点击即可开启或关闭。 除此之外,前置视频同样加持防抖算法,边走边拍也能稳定聚焦脸部' ',实时视频分享您的生活。') -#! 该组件推荐使用ERNIE Speed-AppBuilder模型。 -oral_query_generation = appbuilder.OralQueryGeneration(model='ERNIE Speed-AppBuilder') +#! 该组件推荐使用Qianfan-Appbuilder-Speed-8k模型。 +oral_query_generation = appbuilder.OralQueryGeneration(model='Qianfan-Appbuilder-Speed-8k') result = oral_query_generation(appbuilder.Message(text), query_type='全部', output_format='str') print(result) @@ -47,7 +47,7 @@ os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" | 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 | | ------- | ------- | -------- | -------- | -------- | -| `model` | str | 是 | 模型名称,用于指定要使用的千帆模型。推荐使用ERNIE Speed-AppBuilder模型。 | ERNIE Speed-AppBuilder | +| `model` | str | 是 | 模型名称,用于指定要使用的千帆模型。推荐使用Qianfan-Appbuilder-Speed-8k模型。 | Qianfan-Appbuilder-Speed-8k | | `secret_key` | str | 否 | 用户鉴权token,默认从环境变量中获取: `os.getenv("APPBUILDER_TOKEN", "")` | bce-v3/XXX | | `gateway` | str | 否 | 后端网关服务地址,默认从环境变量中获取: `os.getenv("GATEWAY_URL", "")` | https://appbuilder.baidu.com | | `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 a4ff0d465..5f2a28aa2 100644 --- a/appbuilder/core/components/llms/oral_query_generation/component.py +++ b/appbuilder/core/components/llms/oral_query_generation/component.py @@ -27,7 +27,7 @@ class OralQueryGeneration(CompletionBaseComponent): r""" 口语化Query生成,可用于问答场景下对文档增强索引。 - *注:该组件推荐使用ERNIE Speed-AppBuilder模型。* + *注:该组件推荐使用Qianfan-Appbuilder-Speed-8k模型。* Examples: @@ -43,7 +43,7 @@ class OralQueryGeneration(CompletionBaseComponent): '防抖 开启路径:打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能,开启超级' '防抖后手机屏幕将出现超级防抖Pro开关,点击即可开启或关闭。 除此之外,前置视频同样加持防抖算法,边走边拍也能稳定聚焦脸部' ',实时视频分享您的生活。') - oral_query_generation = appbuilder.OralQueryGeneration(model='ERNIE Speed-AppBuilder') + oral_query_generation = appbuilder.OralQueryGeneration(model='Qianfan-Appbuilder-Speed-8k') answer = oral_query_generation(appbuilder.Message(text), query_type='全部', output_format='str') print(answer.content) """ @@ -88,7 +88,7 @@ def __init__( """初始化口语化Query生成模型。 Args: - model (str|None): 模型名称,用于指定要使用的千帆模型。推荐使用ERNIE Speed-AppBuilder模型。 + model (str|None): 模型名称,用于指定要使用的千帆模型。推荐使用Qianfan-Appbuilder-Speed-8k模型。 secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv("APPBUILDER_TOKEN", ""). gateway (str, 可选): 后端网关服务地址,默认从环境变量中获取: os.getenv("GATEWAY_URL", "") lazy_certification (bool, 可选): 延迟认证,为True时在第一次运行时认证. Defaults to False. diff --git a/appbuilder/core/components/llms/playground/README.md b/appbuilder/core/components/llms/playground/README.md index 7c162b1cb..38ac161c8 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="ERNIE Speed-AppBuilder" + model="Qianfan-Appbuilder-Speed-8k" ) 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 f24924258..28020d2cf 100644 --- a/appbuilder/core/components/llms/playground/component.py +++ b/appbuilder/core/components/llms/playground/component.py @@ -31,7 +31,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="ERNIE Speed-AppBuilder") + play = appbuilder.Playground(prompt_template="你好,{name},我是{bot_name},{bot_name}是一个{bot_type},我可以{bot_function},你可以问我{bot_question}。", model="Qianfan-Appbuilder-Speed-8k") 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 03f9025dc..5dc650605 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="ERNIE Speed-AppBuilder") +qa_mining = appbuilder.QAPairMining(model="Qianfan-Appbuilder-Speed-8k") # 输入文本(对此文本挖掘问答对) msg = '2017年,工商银行根据外部宏观环境变化,及时调整业务策略,优化资产负债结构,' + \ '保持存贷款业务协调发展,提升资产负债配置效率。' + \ @@ -110,7 +110,7 @@ split_result = splitter(parse_result) # 每个段落抽取问答对,并返回结果 for doc_segment in split_result.content["paragraphs"]: - qa_mining = QAPairMining(model="ERNIE Speed-AppBuilder") + qa_mining = QAPairMining(model="Qianfan-Appbuilder-Speed-8k") 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 9be6df4d6..495cae874 100644 --- a/appbuilder/core/components/llms/qa_pair_mining/component.py +++ b/appbuilder/core/components/llms/qa_pair_mining/component.py @@ -33,7 +33,7 @@ class QAPairMining(CompletionBaseComponent): os.environ["APPBUILDER_TOKEN"] = "..." - qa_mining = appbuilder.QAPairMining(model="ERNIE Speed-AppBuilder") + qa_mining = appbuilder.QAPairMining(model="Qianfan-Appbuilder-Speed-8k") # 输入文本(对此文本挖掘问答对) msg = '2017年,工商银行根据外部宏观环境变化,及时调整业务策略,优化资产负债结构,' + \ '保持存贷款业务协调发展,提升资产负债配置效率。' + \ diff --git a/appbuilder/core/components/llms/query_decomposition/README.md b/appbuilder/core/components/llms/query_decomposition/README.md index de2a7e20b..bfd249c49 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="ERNIE Speed-AppBuilder") +query_decomposition = appbuilder.QueryDecomposition(model="Qianfan-Appbuilder-Speed-8k") msg = "吸塑包装盒在工业化生产和物流运输中分别有什么重要性?" msg = appbuilder.Message(msg) @@ -42,7 +42,7 @@ os.environ["APPBUILDER_TOKEN"] = "bce-YOURTOKEN" ### 初始化参数 |参数名称 |参数类型 |是否必须 |描述 |示例值| |--------|--------|--------|----|------| -|model |str |是 |模型名称,用于指定要使用的千帆模型|ERNIE Speed-AppBuilder| +|model |str |是 |模型名称,用于指定要使用的千帆模型|Qianfan-Appbuilder-Speed-8k| ### 调用参数 |参数名称 |参数类型 |是否必须 |描述 |示例值| diff --git a/appbuilder/core/components/llms/query_decomposition/component.py b/appbuilder/core/components/llms/query_decomposition/component.py index febf95e4b..46f15196e 100644 --- a/appbuilder/core/components/llms/query_decomposition/component.py +++ b/appbuilder/core/components/llms/query_decomposition/component.py @@ -33,7 +33,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="ERNIE Speed-AppBuilder") + query_decomposition = appbuilder.QueryDecomposition(model="Qianfan-Appbuilder-Speed-8k") 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 2887685d9..608e44514 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="ERNIE Speed-AppBuilder") +query_rewrite = appbuilder.QueryRewrite(model="Qianfan-Appbuilder-Speed-8k") 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 852066566..48e727936 100644 --- a/appbuilder/core/components/llms/query_rewrite/component.py +++ b/appbuilder/core/components/llms/query_rewrite/component.py @@ -31,7 +31,7 @@ class QueryRewrite(CompletionBaseComponent): import appbuilder os.environ["APPBUILDER_TOKEN"] = '...' - query_rewrite = appbuilder.QueryRewrite(model="ERNIE Speed-AppBuilder") + query_rewrite = appbuilder.QueryRewrite(model="Qianfan-Appbuilder-Speed-8k") 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 d57e57772..4cd75df4d 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="ERNIE Speed-AppBuilder") +similar_question = appbuilder.SimilarQuestion(model="Qianfan-Appbuilder-Speed-8k") 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 7a669f2ad..e95dbe3f0 100644 --- a/appbuilder/core/components/llms/similar_question/component.py +++ b/appbuilder/core/components/llms/similar_question/component.py @@ -35,7 +35,7 @@ class SimilarQuestion(CompletionBaseComponent): os.environ["APPBUILDER_TOKEN"] = "..." - qa_mining = appbuilder.SimilarQuestion(model="ERNIE Speed-AppBuilder") + qa_mining = appbuilder.SimilarQuestion(model="Qianfan-Appbuilder-Speed-8k") 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 46607cfdc..f79650110 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="ERNIE Speed-AppBuilder") +style_rewrite = appbuilder.StyleRewrite(model="Qianfan-Appbuilder-Speed-8k") 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 d2fefc239..c37dd6557 100644 --- a/appbuilder/core/components/llms/style_rewrite/component.py +++ b/appbuilder/core/components/llms/style_rewrite/component.py @@ -31,7 +31,7 @@ class StyleRewrite(CompletionBaseComponent): import appbuilder os.environ["APPBUILDER_TOKEN"] = '...' - style_rewrite = appbuilder.StyleRewrite(model="ERNIE Speed-AppBuilder") + style_rewrite = appbuilder.StyleRewrite(model="Qianfan-Appbuilder-Speed-8k") 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 3d8f71cf0..40d8f140f 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 = "ERNIE Speed-AppBuilder" +model = "Qianfan-Appbuilder-Speed-8k" 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 461a73b14..7379899dd 100644 --- a/appbuilder/core/components/llms/style_writing/component.py +++ b/appbuilder/core/components/llms/style_writing/component.py @@ -55,7 +55,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="ERNIE Speed-AppBuilder") + style_writing = appbuilder.StyleWriting(model="Qianfan-Appbuilder-Speed-8k") 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 b8ac08b91..e5ea6410a 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="ERNIE Speed-AppBuilder") +tag_extraction = appbuilder.TagExtraction(model="Qianfan-Appbuilder-Speed-8k") 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 222f23801..fd6d5c56f 100644 --- a/appbuilder/core/components/llms/tag_extraction/component.py +++ b/appbuilder/core/components/llms/tag_extraction/component.py @@ -29,7 +29,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="ERNIE Speed-AppBuilder") + tag_extraction = appbuilder.TagExtraction(model="Qianfan-Appbuilder-Speed-8k") 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 e3ba32df7..fc44a554b 100644 --- a/appbuilder/core/components/rag_with_baidu_search/README.md +++ b/appbuilder/core/components/rag_with_baidu_search/README.md @@ -38,7 +38,7 @@ import os os.environ["APPBUILDER_TOKEN"] = '...' # 创建rag_with_baidusearch对象 -rag_with_baidusearch_component = appbuilder.RAGWithBaiduSearch(model="ERNIE Speed-AppBuilder") +rag_with_baidusearch_component = appbuilder.RAGWithBaiduSearch(model="Qianfan-Appbuilder-Speed-8k") # 运行rag_with_baidusearch基本组件 msg = appbuilder.Message("残疾人怎么办相关证件") @@ -111,7 +111,7 @@ os.environ["APPBUILDER_TOKEN"] = '...' # 创建rag_with_baidusearch对象, 并初始化人设指令 rag_with_baidusearch_component = appbuilder.RAGWithBaiduSearch( - model="ERNIE Speed-AppBuilder", + model="Qianfan-Appbuilder-Speed-8k", instruction=appbuilder.Message("你是问答助手,在回答问题前需要加上: 很高兴为您解答")) diff --git a/appbuilder/core/components/rag_with_baidu_search_pro/README.md b/appbuilder/core/components/rag_with_baidu_search_pro/README.md index be19a4b1f..ec699c7e2 100644 --- a/appbuilder/core/components/rag_with_baidu_search_pro/README.md +++ b/appbuilder/core/components/rag_with_baidu_search_pro/README.md @@ -26,7 +26,7 @@ import os os.environ["APPBUILDER_TOKEN"] = '...' # 创建rag_with_baidusearch_pro对象 -rag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model="ERNIE Speed-AppBuilder") +rag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model="Qianfan-Appbuilder-Speed-8k") # 运行rag_with_baidusearch基本组件 msg = appbuilder.Message("残疾人怎么办相关证件") @@ -88,7 +88,7 @@ os.environ["APPBUILDER_TOKEN"] = '...' # 创建rag_with_baidusearch对象, 并初始化人设指令 rag_with_baidusearch_pro = appbuilder.RagWithBaiduSearchPro( - model="ERNIE Speed-AppBuilder", + model="Qianfan-Appbuilder-Speed-8k", instruction=appbuilder.Message("你是问答助手,在回答问题前需要加上: 很高兴为您解答")) diff --git a/appbuilder/tests/test_appbuilder_components_trace.py b/appbuilder/tests/test_appbuilder_components_trace.py index c346bb7b9..009a1eb8c 100644 --- a/appbuilder/tests/test_appbuilder_components_trace.py +++ b/appbuilder/tests/test_appbuilder_components_trace.py @@ -55,7 +55,7 @@ def setUp(self): "%2Fa6c4d2ca8a3f0259f4cae8ae3fa98a9f75afde1a063eaec04847c99ab7d1e411" self.asr = appbuilder.ASR() self.play = appbuilder.Playground(prompt_template="你好,{name},我是{bot_name},{bot_name}是一个{bot_type},我可以{bot_function},你可以问我{bot_question}。", model='eb-4') - model_name = 'ERNIE Speed-AppBuilder' + model_name = 'Qianfan-Appbuilder-Speed-8k' secret_key = os.getenv('SECRET_KEY', None) self.hallucination_detection = appbuilder.HallucinationDetection(model=model_name, secret_key=secret_key) diff --git a/appbuilder/tests/test_dialog_summary.py b/appbuilder/tests/test_dialog_summary.py index 67116e86a..40aa2cc98 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 = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" self.node = appbuilder.DialogSummary(model=self.model_name) def test_run_with_default_params(self): diff --git a/appbuilder/tests/test_hallucination_detection.py b/appbuilder/tests/test_hallucination_detection.py index d626a44a1..6a4e29565 100644 --- a/appbuilder/tests/test_hallucination_detection.py +++ b/appbuilder/tests/test_hallucination_detection.py @@ -51,7 +51,7 @@ def setUp(self): 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = 'ERNIE Speed-AppBuilder' + self.model_name = 'Qianfan-Appbuilder-Speed-8k' secret_key = os.getenv('SECRET_KEY', None) self.hallucination_detection = appbuilder.HallucinationDetection(model=self.model_name, secret_key=secret_key) diff --git a/appbuilder/tests/test_is_complex_query.py b/appbuilder/tests/test_is_complex_query.py index b47ca9549..54c28f1ab 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 = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" 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 cfb141311..2794d95f1 100644 --- a/appbuilder/tests/test_mrc.py +++ b/appbuilder/tests/test_mrc.py @@ -23,7 +23,7 @@ def setUp(self): return mrc class ''' # 设置环境变量和初始化TestMRCComponent实例 - self.model_name = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" self.mrc = appbuilder.MRC(model=self.model_name) def test_mrc_with_custom_context_list(self): diff --git a/appbuilder/tests/test_nl2pandas.py b/appbuilder/tests/test_nl2pandas.py index 1cdeaa680..2e4c293e2 100644 --- a/appbuilder/tests/test_nl2pandas.py +++ b/appbuilder/tests/test_nl2pandas.py @@ -25,7 +25,7 @@ def setUp(self): """ 设置环境变量及必要数据。 """ - self.model_name = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" 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 0af7787a9..82deafe14 100644 --- a/appbuilder/tests/test_oral_query_generation.py +++ b/appbuilder/tests/test_oral_query_generation.py @@ -36,7 +36,7 @@ def setUp(self): 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = 'ERNIE Speed-AppBuilder' + self.model_name = 'Qianfan-Appbuilder-Speed-8k' secret_key = os.getenv('SECRET_KEY', None) self.query_generation = appbuilder.OralQueryGeneration(model=self.model_name, secret_key=secret_key) diff --git a/appbuilder/tests/test_qa_pair_mining.py b/appbuilder/tests/test_qa_pair_mining.py index 43994967d..e3c54e926 100644 --- a/appbuilder/tests/test_qa_pair_mining.py +++ b/appbuilder/tests/test_qa_pair_mining.py @@ -31,7 +31,7 @@ def setUp(self): Returns: 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" 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 b57e133b7..b83b41996 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 = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" 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 d76dad76a..c6e9165c9 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 = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" 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("ERNIE Speed-AppBuilder") + node = appbuilder.QueryRewrite("Qianfan-Appbuilder-Speed-8k") 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 180c159f7..a8ffe00eb 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 = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" 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 ad5e8be48..b47f877ec 100644 --- a/appbuilder/tests/test_similar_question.py +++ b/appbuilder/tests/test_similar_question.py @@ -28,7 +28,7 @@ def setUp(self): Returns: 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" 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 e03bfc38c..3087fe43c 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 = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" self.node = appbuilder.StyleRewrite(model=self.model_name) self.sc=StyleChoices.YINGXIAO diff --git a/appbuilder/tests/test_style_writing.py b/appbuilder/tests/test_style_writing.py index 411553f41..836f15104 100644 --- a/appbuilder/tests/test_style_writing.py +++ b/appbuilder/tests/test_style_writing.py @@ -32,7 +32,7 @@ def setUp(self): Returns: 无返回值,方法中执行了环境变量的赋值操作。 """ - self.model_name = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" self.node = appbuilder.StyleWriting(model=self.model_name) self.sqc=StyleQueryChoices.BILIBILI self.lc=LengthChoices.SHORT diff --git a/appbuilder/tests/test_tag_extraction.py b/appbuilder/tests/test_tag_extraction.py index 113434b01..85fb24d41 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 = "ERNIE Speed-AppBuilder" + self.model_name = "Qianfan-Appbuilder-Speed-8k" 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 2b0c83113..c77c27221 100644 --- a/appbuilder/utils/model_util.py +++ b/appbuilder/utils/model_util.py @@ -30,7 +30,7 @@ ("ERNIE-Bot-turbo", "eb-turbo"), ("EB-turbo-AppBuilder专用版", "eb-turbo-appbuilder"), ("EB-turbo-AppBuilder专用版", "ernie_speed_appbuilder"), - ("EB-turbo-AppBuilder专用版", "ERNIE Speed-AppBuilder"), + ("EB-turbo-AppBuilder专用版", "Qianfan-Appbuilder-Speed-8k"), ] class RemoteModel(object): @@ -62,7 +62,7 @@ def get_remote_name_by_short_name(self, short_name: str) -> Optional[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 [Qianfan-Appbuilder-Speed-8k]") if short_name in self.short_names: return self.remote_name diff --git a/cookbooks/components/agent_runtime.ipynb b/cookbooks/components/agent_runtime.ipynb index 38cc288e9..6fb095f17 100644 --- a/cookbooks/components/agent_runtime.ipynb +++ b/cookbooks/components/agent_runtime.ipynb @@ -426,7 +426,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=\"Qianfan-Appbuilder-Speed-8k\")\n", " self.playground = Playground(\n", " prompt_template=\"{query}\",\n", " model=\"ERNIE-Bot\"\n", diff --git a/cookbooks/components/rag_with_baidusearch.ipynb b/cookbooks/components/rag_with_baidusearch.ipynb index 2870c9e2c..677ff07bf 100644 --- a/cookbooks/components/rag_with_baidusearch.ipynb +++ b/cookbooks/components/rag_with_baidusearch.ipynb @@ -82,8 +82,8 @@ "friendly = False # 友好度提升\n", "cite = True # 溯源\n", "\n", - "# 使用 ERNIE Speed-AppBuilderder 模型\n", - "component = appbuilder.RAGWithBaiduSearch(model=\"ERNIE Speed-AppBuilder\")\n", + "# 使用 Qianfan-Appbuilder-Speed-8kder 模型\n", + "component = appbuilder.RAGWithBaiduSearch(model=\"Qianfan-Appbuilder-Speed-8k\")\n", "query = appbuilder.Message(\"海淀区的面积是多少\")\n", "\n", "answer = component.run(\n", diff --git a/cookbooks/components/text_generation.ipynb b/cookbooks/components/text_generation.ipynb index f9dd3d5f1..65683fbc9 100644 --- a/cookbooks/components/text_generation.ipynb +++ b/cookbooks/components/text_generation.ipynb @@ -101,7 +101,7 @@ "商品信息:\n", "'''\n", "# 创建商品信息生成组件\n", - "product_information_generation = Playground(prompt_template=prompt_template, model='ERNIE Speed-AppBuilder')\n", + "product_information_generation = Playground(prompt_template=prompt_template, model='Qianfan-Appbuilder-Speed-8k')\n", "\n", "# 获取商品信息\n", "# 填充prompt_template参数的参数映射表,需要与prompt_template对应\n", @@ -152,7 +152,7 @@ "from appbuilder import QAPairMining\n", "\n", "# 初始化问答对生成组件\n", - "qa_pair_mining = QAPairMining(model='ERNIE Speed-AppBuilder')\n", + "qa_pair_mining = QAPairMining(model='Qianfan-Appbuilder-Speed-8k')\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='ERNIE Speed-AppBuilder')\n", + "style_writing = StyleWriting(model='Qianfan-Appbuilder-Speed-8k')\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='ERNIE Speed-AppBuilder')\n", + "tag_extraction = TagExtraction(model='Qianfan-Appbuilder-Speed-8k')\n", "\n", "# 获取标签\n", "response = tag_extraction(Message(copywriting), stream=False, temperature=1e-10)\n", diff --git a/cookbooks/end2end_application/agent/tool_choice.ipynb b/cookbooks/end2end_application/agent/tool_choice.ipynb index c9c64527b..092658e1b 100644 --- a/cookbooks/end2end_application/agent/tool_choice.ipynb +++ b/cookbooks/end2end_application/agent/tool_choice.ipynb @@ -169,7 +169,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "answer='' events=[Event(code=0, message='', status='done', event_type='function_call', content_type='function_call', detail={'text': {'arguments': {'city': '北京'}, 'component_code': 'WeatherQuery', 'component_name': '天气查询'}}, usage=Usage(prompt_tokens=513, completion_tokens=37, total_tokens=550, name='ERNIE Speed-AppBuilder'), tool_calls=None)]\n" + "answer='' events=[Event(code=0, message='', status='done', event_type='function_call', content_type='function_call', detail={'text': {'arguments': {'city': '北京'}, 'component_code': 'WeatherQuery', 'component_name': '天气查询'}}, usage=Usage(prompt_tokens=513, completion_tokens=37, total_tokens=550, name='Qianfan-Appbuilder-Speed-8k'), tool_calls=None)]\n" ] } ], @@ -270,10 +270,10 @@ "answer='' events=[Event(code=0, message='', status='success', event_type='WeatherQuery', content_type='status', detail={}, usage=None, tool_calls=None)]\n", "answer='' events=[Event(code=0, message='', status='done', event_type='function_call', content_type='function_call', detail={'text': {'arguments': {'origin_query': '北京今天的天气'}, 'component_code': 'ChatAgent', 'component_name': '聊天助手'}}, usage=None, tool_calls=None)]\n", "answer='' events=[Event(code=0, message='', status='preparing', event_type='ChatAgent', content_type='status', detail={}, usage=None, tool_calls=None)]\n", - "answer='北京今天的天气情况如下' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '北京今天的天气情况如下'}, usage=Usage(prompt_tokens=1105, completion_tokens=0, total_tokens=1105, name='ERNIE Speed-AppBuilder'), tool_calls=None)]\n", - "answer=':\\n\\n- **日期**:2024年9月23日(星期一)\\n- **天气**:晴\\n- **温度**:最高温度24℃,' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': ':\\n\\n- **日期**:2024年9月23日(星期一)\\n- **天气**:晴\\n- **温度**:最高温度24℃,'}, usage=Usage(prompt_tokens=1105, completion_tokens=0, total_tokens=1105, name='ERNIE Speed-AppBuilder'), tool_calls=None)]\n", - "answer='最低温度12℃\\n- **风向**:东北风1级\\n- **湿度**:74%\\n- **未来2小时**:不会下雨\\n- **今天云量**:逐渐增多\\n- **明天天气**:明夜有小雨\\n\\n如果您需要更多详细信息或未来几天的天气预报,请告诉我!' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '最低温度12℃\\n- **风向**:东北风1级\\n- **湿度**:74%\\n- **未来2小时**:不会下雨\\n- **今天云量**:逐渐增多\\n- **明天天气**:明夜有小雨\\n\\n如果您需要更多详细信息或未来几天的天气预报,请告诉我!'}, usage=Usage(prompt_tokens=1105, completion_tokens=0, total_tokens=1105, name='ERNIE Speed-AppBuilder'), tool_calls=None)]\n", - "answer='' events=[Event(code=0, message='', status='done', event_type='ChatAgent', content_type='text', detail={'text': ''}, usage=Usage(prompt_tokens=1105, completion_tokens=114, total_tokens=1219, name='ERNIE Speed-AppBuilder'), tool_calls=None)]\n", + "answer='北京今天的天气情况如下' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '北京今天的天气情况如下'}, usage=Usage(prompt_tokens=1105, completion_tokens=0, total_tokens=1105, name='Qianfan-Appbuilder-Speed-8k'), tool_calls=None)]\n", + "answer=':\\n\\n- **日期**:2024年9月23日(星期一)\\n- **天气**:晴\\n- **温度**:最高温度24℃,' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': ':\\n\\n- **日期**:2024年9月23日(星期一)\\n- **天气**:晴\\n- **温度**:最高温度24℃,'}, usage=Usage(prompt_tokens=1105, completion_tokens=0, total_tokens=1105, name='Qianfan-Appbuilder-Speed-8k'), tool_calls=None)]\n", + "answer='最低温度12℃\\n- **风向**:东北风1级\\n- **湿度**:74%\\n- **未来2小时**:不会下雨\\n- **今天云量**:逐渐增多\\n- **明天天气**:明夜有小雨\\n\\n如果您需要更多详细信息或未来几天的天气预报,请告诉我!' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '最低温度12℃\\n- **风向**:东北风1级\\n- **湿度**:74%\\n- **未来2小时**:不会下雨\\n- **今天云量**:逐渐增多\\n- **明天天气**:明夜有小雨\\n\\n如果您需要更多详细信息或未来几天的天气预报,请告诉我!'}, usage=Usage(prompt_tokens=1105, completion_tokens=0, total_tokens=1105, name='Qianfan-Appbuilder-Speed-8k'), tool_calls=None)]\n", + "answer='' events=[Event(code=0, message='', status='done', event_type='ChatAgent', content_type='text', detail={'text': ''}, usage=Usage(prompt_tokens=1105, completion_tokens=114, total_tokens=1219, name='Qianfan-Appbuilder-Speed-8k'), tool_calls=None)]\n", "answer='' events=[Event(code=0, message='', status='success', event_type='ChatAgent', content_type='status', detail={}, usage=None, tool_calls=None)]\n", "answer='' events=[]\n" ] diff --git a/cookbooks/end2end_application/rag/rag.ipynb b/cookbooks/end2end_application/rag/rag.ipynb index 07d5cb378..5a1d39c27 100644 --- a/cookbooks/end2end_application/rag/rag.ipynb +++ b/cookbooks/end2end_application/rag/rag.ipynb @@ -171,7 +171,7 @@ "具备团队协作精神,能够与团队成员有效沟通,共同推进项目进展。'''\n", "\n", "# 标签抽取的组件\n", - "tagger = appbuilder.TagExtraction(model=\"ERNIE Speed-AppBuilder\")\n", + "tagger = appbuilder.TagExtraction(model=\"Qianfan-Appbuilder-Speed-8k\")\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=\"ERNIE Speed-AppBuilder\"\n", + " model=\"Qianfan-Appbuilder-Speed-8k\"\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/docs/README_en.md b/docs/README_en.md index ab39adfe9..fc3b076e4 100644 --- a/docs/README_en.md +++ b/docs/README_en.md @@ -82,7 +82,7 @@ template_str = "你扮演{role}, 请回答我的问题。\n\n问题:{question} # 定义输入,调用playground组件 input = appbuilder.Message({"role": "java工程师", "question": "请简要回答java语言的内存回收机制是什么,要求100字以内"}) -playground = appbuilder.Playground(prompt_template=template_str, model="ERNIE Speed-AppBuilder") +playground = appbuilder.Playground(prompt_template=template_str, model="Qianfan-Appbuilder-Speed-8k") # 以打字机的方式,流式展示大模型回答内容 output = playground(input, stream=True, temperature=1e-10) @@ -128,7 +128,7 @@ import os # 设置环境中的TOKEN,以下TOKEN为访问和QPS受限的试用TOKEN,正式使用请替换为您的个人TOKEN os.environ["APPBUILDER_TOKEN"] = "bce-v3/ALTAK-n5AYUIUJMarF7F7iFXVeK/1bf65eed7c8c7efef9b11388524fa1087f90ea58" -rag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model="ERNIE Speed-AppBuilder") +rag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model="Qianfan-Appbuilder-Speed-8k") input = appbuilder.Message("9.11和9.8哪个大") result = rag_with_baidu_search_pro.run( diff --git a/docs/README_ja.md b/docs/README_ja.md index 782abbf4d..e8aa39aa4 100644 --- a/docs/README_ja.md +++ b/docs/README_ja.md @@ -79,7 +79,7 @@ template_str = "あなたは{role}の役割を果たします。私の質問に # 入力を定義し、playgroundコンポーネントを呼び出します。 input = appbuilder.Message({"role": "Javaエンジニア", "question": "Java言語のメモリ回収メカニズムについて簡単に説明してください。100文字以内でお願いします。"}) -playground = appbuilder.Playground(prompt_template=template_str, model="ERNIE Speed-AppBuilder") +playground = appbuilder.Playground(prompt_template=template_str, model="Qianfan-Appbuilder-Speed-8k") # タイプライターのように、ストリーム形式で大規模モデルの回答内容を表示します。 output = playground(input, stream=True, temperature=1e-10) @@ -124,7 +124,7 @@ import os # 環境変数にTOKENを設定します。以下のTOKENはアクセスとQPSが制限された試用TOKENです。正式な使用には個人のTOKENに置き換えてください。 os.environ["APPBUILDER_TOKEN"] = "bce-v3/ALTAK-n5AYUIUJMarF7F7iFXVeK/1bf65eed7c8c7efef9b11388524fa1087f90ea58" -rag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model="ERNIE Speed-AppBuilder") +rag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model="Qianfan-Appbuilder-Speed-8k") input = appbuilder.Message("9.11と9.8のどちらが大きいですか?") result = rag_with_baidu_search_pro.run( diff --git a/docs/basic_module/README.md b/docs/basic_module/README.md index 84d9e721b..0724d56f3 100644 --- a/docs/basic_module/README.md +++ b/docs/basic_module/README.md @@ -52,7 +52,7 @@ ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-3.5-4K-0205, ERNIE-3.5-8K-0205, ERNIE-3.5-8K-122 | ERNIE-Bot | eb | | ERNIE-Bot-turbo | eb-turbo | | EB-turbo-AppBuilder专用版 | ernie_speed_appbuilder | -| ERNIE Speed-AppBuilder | ernie_speed_appbuilder | +| Qianfan-Appbuilder-Speed-8k | ernie_speed_appbuilder | @@ -66,7 +66,7 @@ os.environ["APPBUILDER_TOKEN"] = "bce-v3/ALTAK-n5AYUIUJMarF7F7iFXVeK/1bf65eed7c8 # 空模版组件 template_str = "你扮演{role}, 请回答我的问题。\n\n问题:{question}。\n\n回答:" -playground = appbuilder.Playground(prompt_template=template_str, model="ERNIE Speed-AppBuilder") +playground = appbuilder.Playground(prompt_template=template_str, model="Qianfan-Appbuilder-Speed-8k") # 定义输入,调用空模版组件 input = appbuilder.Message({"role": "java工程师", "question": "java语言的内存回收机制是什么"}) @@ -83,7 +83,7 @@ import os os.environ["APPBUILDER_TOKEN"] = "bce-v3/ALTAK-n5AYUIUJMarF7F7iFXVeK/1bf65eed7c8c7efef9b11388524fa1087f90ea58" # 相似问生成组件 -similar_q = appbuilder.SimilarQuestion(model="ERNIE Speed-AppBuilder") +similar_q = appbuilder.SimilarQuestion(model="Qianfan-Appbuilder-Speed-8k") # 定义输入,调用相似问生成 input = appbuilder.Message("我想吃冰淇淋,哪里的冰淇淋比较好吃?") @@ -128,7 +128,7 @@ import appbuilder # 空模版组件 playground = appbuilder.Playground( prompt_template="{query}", - model="ERNIE Speed-AppBuilder" + model="Qianfan-Appbuilder-Speed-8k" ) # 使用 AgentRuntime 来服务化playground组件 diff --git a/docs/basic_module/agentruntime.md b/docs/basic_module/agentruntime.md index c8f3fc0ad..d4a4e080c 100644 --- a/docs/basic_module/agentruntime.md +++ b/docs/basic_module/agentruntime.md @@ -120,7 +120,7 @@ os.environ["APPBUILDER_TOKEN"] = 'YOUR_APPBUILDER_TOKEN' class PlaygroundWithHistory(Component): def __init__(self): super().__init__() - self.query_rewrite = QueryRewrite(model="ERNIE Speed-AppBuilder") + self.query_rewrite = QueryRewrite(model="Qianfan-Appbuilder-Speed-8k") self.play = Playground( prompt_template="{query}", model="eb-4" diff --git a/docs/develop_guide/README.md b/docs/develop_guide/README.md index 914053c9f..560f5596d 100644 --- a/docs/develop_guide/README.md +++ b/docs/develop_guide/README.md @@ -43,7 +43,7 @@ class SimilarQuestion(CompletionBaseComponent): os.environ["APPBUILDER_TOKEN"] = "..." - qa_mining = appbuilder.SimilarQuestion(model="ERNIE Speed-AppBuilder") + qa_mining = appbuilder.SimilarQuestion(model="Qianfan-Appbuilder-Speed-8k") msg = "我想吃冰淇淋,哪里的冰淇淋比较好吃?" msg = appbuilder.Message(msg) diff --git a/docs/quick_start/README.md b/docs/quick_start/README.md index 92fe22556..8f56fde9b 100644 --- a/docs/quick_start/README.md +++ b/docs/quick_start/README.md @@ -42,7 +42,7 @@ ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-3.5-4K-0205, ERNIE-3.5-8K-0205, ERNIE-3.5-8K-122 | ERNIE-Bot | eb | | ERNIE-Bot-turbo | eb-turbo | | EB-turbo-AppBuilder专用版 | ernie_speed_appbuilder | -| ERNIE Speed-AppBuilder | ernie_speed_appbuilder | +| Qianfan-Appbuilder-Speed-8k | ernie_speed_appbuilder | @@ -56,7 +56,7 @@ os.environ["APPBUILDER_TOKEN"] = "bce-v3/ALTAK-n5AYUIUJMarF7F7iFXVeK/1bf65eed7c8 # 空模版组件 template_str = "你扮演{role}, 请回答我的问题。\n\n问题:{question}。\n\n回答:" -playground = appbuilder.Playground(prompt_template=template_str, model="ERNIE Speed-AppBuilder") +playground = appbuilder.Playground(prompt_template=template_str, model="Qianfan-Appbuilder-Speed-8k") # 定义输入,调用空模版组件 input = appbuilder.Message({"role": "java工程师", "question": "java语言的内存回收机制是什么"}) @@ -73,7 +73,7 @@ import os os.environ["APPBUILDER_TOKEN"] = "bce-v3/ALTAK-n5AYUIUJMarF7F7iFXVeK/1bf65eed7c8c7efef9b11388524fa1087f90ea58" # 相似问生成组件 -similar_q = appbuilder.SimilarQuestion(model="ERNIE Speed-AppBuilder") +similar_q = appbuilder.SimilarQuestion(model="Qianfan-Appbuilder-Speed-8k") # 定义输入,调用相似问生成 input = appbuilder.Message("我想吃冰淇淋,哪里的冰淇淋比较好吃?") @@ -118,7 +118,7 @@ import appbuilder # 空模版组件 playground = appbuilder.Playground( prompt_template="{query}", - model="ERNIE Speed-AppBuilder" + model="Qianfan-Appbuilder-Speed-8k" ) # 使用 AgentRuntime 来服务化playground组件 diff --git a/docs/sphinx_md/appbuilder.core.components.llms.dialog_summary.md b/docs/sphinx_md/appbuilder.core.components.llms.dialog_summary.md index 36e6f1a52..79fc5f997 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.dialog_summary.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.dialog_summary.md @@ -19,7 +19,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"] = '...' -dialog_summary = appbuilder.DialogSummary("ERNIE Speed-AppBuilder") +dialog_summary = appbuilder.DialogSummary("Qianfan-Appbuilder-Speed-8k") text = "用户:喂我想查一下我的话费\n坐席:好的女士您话费余的话还有87.49元钱\n用户:好的知道了谢谢\n坐席:嗯不客气祝您生活愉快再见" answer = dialog_summary(appbuilder.Message(text)) print(answer) diff --git a/docs/sphinx_md/appbuilder.core.components.llms.hallucination_detection.md b/docs/sphinx_md/appbuilder.core.components.llms.hallucination_detection.md index 007a39fc1..712456eb7 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.hallucination_detection.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.hallucination_detection.md @@ -9,7 +9,7 @@ 基类:`CompletionBaseComponent` 幻觉检测。输入,判断answer中是否存在幻觉。 - *注:该组件推荐使用ERNIE Speed-AppBuilder模型。* + *注:该组件推荐使用Qianfan-Appbuilder-Speed-8k模型。* Examples: diff --git a/docs/sphinx_md/appbuilder.core.components.llms.is_complex_query.md b/docs/sphinx_md/appbuilder.core.components.llms.is_complex_query.md index c5259a75c..ed83b24b5 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.is_complex_query.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.is_complex_query.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="ERNIE Speed-AppBuilder") +is_complex_query = appbuilder.IsComplexQuery(model="Qianfan-Appbuilder-Speed-8k") msg = "吸塑包装盒在工业化生产和物流运输中分别有什么重要性?" msg = appbuilder.Message(msg) diff --git a/docs/sphinx_md/appbuilder.core.components.llms.nl2pandas.md b/docs/sphinx_md/appbuilder.core.components.llms.nl2pandas.md index 46a9982e3..10972ad85 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.nl2pandas.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.nl2pandas.md @@ -27,7 +27,7 @@ table_info = '''表格列信息如下: query = "海淀区有哪些学校" query = appbuilder.Message(query) -nl2pandas = appbuilder.Nl2pandasComponent(model="ERNIE Speed-AppBuilder") +nl2pandas = appbuilder.Nl2pandasComponent(model="Qianfan-Appbuilder-Speed-8k") answer = nl2pandas(query, table_info = table_info) ``` diff --git a/docs/sphinx_md/appbuilder.core.components.llms.oral_query_generation.md b/docs/sphinx_md/appbuilder.core.components.llms.oral_query_generation.md index 131c7a027..b9a13d412 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.oral_query_generation.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.oral_query_generation.md @@ -9,7 +9,7 @@ 基类:`CompletionBaseComponent` 口语化Query生成,可用于问答场景下对文档增强索引。 - *注:该组件推荐使用ERNIE Speed-AppBuilder模型。* + *注:该组件推荐使用Qianfan-Appbuilder-Speed-8k模型。* Examples: @@ -24,7 +24,7 @@ text = ('文档标题:在OPPO Reno5上使用视频超级防抖\n' '防抖 开启路径:打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能,开启超级' '防抖后手机屏幕将出现超级防抖Pro开关,点击即可开启或关闭。 除此之外,前置视频同样加持防抖算法,边走边拍也能稳定聚焦脸部' ',实时视频分享您的生活。') -oral_query_generation = appbuilder.OralQueryGeneration(model='ERNIE Speed-AppBuilder') +oral_query_generation = appbuilder.OralQueryGeneration(model='Qianfan-Appbuilder-Speed-8k') answer = oral_query_generation(appbuilder.Message(text), query_type='全部', output_format='str') print(answer.content) ``` diff --git a/docs/sphinx_md/appbuilder.core.components.llms.playground.md b/docs/sphinx_md/appbuilder.core.components.llms.playground.md index 6a1c7dd2c..233718b3a 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.playground.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.playground.md @@ -17,7 +17,7 @@ import os import appbuilder os.environ["APPBUILDER_TOKEN"] = "..." -play = appbuilder.Playground(prompt_template="你好,{name},我是{bot_name},{bot_name}是一个{bot_type},我可以{bot_function},你可以问我{bot_question}。", model="ERNIE Speed-AppBuilder") +play = appbuilder.Playground(prompt_template="你好,{name},我是{bot_name},{bot_name}是一个{bot_type},我可以{bot_function},你可以问我{bot_question}。", model="Qianfan-Appbuilder-Speed-8k") play(appbuilder.Message({"name": "小明", "bot_name": "小红", "bot_type": "聊天机器人", "bot_function": "聊天", "bot_question": "你好吗?"}), stream=False) ``` diff --git a/docs/sphinx_md/appbuilder.core.components.llms.query_decomposition.md b/docs/sphinx_md/appbuilder.core.components.llms.query_decomposition.md index 31d0bab95..089db8d46 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.query_decomposition.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.query_decomposition.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="ERNIE Speed-AppBuilder") +query_decomposition = appbuilder.QueryDecomposition(model="Qianfan-Appbuilder-Speed-8k") msg = "吸塑包装盒在工业化生产和物流运输中分别有什么重要性?" msg = appbuilder.Message(msg) diff --git a/docs/sphinx_md/appbuilder.core.components.llms.query_rewrite.md b/docs/sphinx_md/appbuilder.core.components.llms.query_rewrite.md index d66a1430f..b706e12f5 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.query_rewrite.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.query_rewrite.md @@ -18,7 +18,7 @@ Examples: import appbuilder os.environ["APPBUILDER_TOKEN"] = '...' -query_rewrite = appbuilder.QueryRewrite(model="ERNIE Speed-AppBuilder") +query_rewrite = appbuilder.QueryRewrite(model="Qianfan-Appbuilder-Speed-8k") answer = query_rewrite(appbuilder.Message(['我应该怎么办理护照?', '您可以查询官网或人工咨询', '我需要准备哪些材料?', diff --git a/docs/sphinx_md/appbuilder.core.components.llms.similar_question.md b/docs/sphinx_md/appbuilder.core.components.llms.similar_question.md index 176458356..393311eeb 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.similar_question.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.similar_question.md @@ -20,7 +20,7 @@ import appbuilder os.environ["APPBUILDER_TOKEN"] = "..." -qa_mining = appbuilder.SimilarQuestion(model="ERNIE Speed-AppBuilder") +qa_mining = appbuilder.SimilarQuestion(model="Qianfan-Appbuilder-Speed-8k") msg = "我想吃冰淇淋,哪里的冰淇淋比较好吃?" msg = appbuilder.Message(msg) diff --git a/docs/sphinx_md/appbuilder.core.components.llms.style_rewrite.md b/docs/sphinx_md/appbuilder.core.components.llms.style_rewrite.md index 551b1b574..6f8239ba6 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.style_rewrite.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.style_rewrite.md @@ -17,7 +17,7 @@ import os import appbuilder os.environ["APPBUILDER_TOKEN"] = '...' -style_rewrite = appbuilder.StyleRewrite(model="ERNIE Speed-AppBuilder") +style_rewrite = appbuilder.StyleRewrite(model="Qianfan-Appbuilder-Speed-8k") answer = style_rewrite(appbuilder.Message("文心大模型发布新版本"), style="激励话术") ``` diff --git a/docs/sphinx_md/appbuilder.core.components.llms.style_writing.md b/docs/sphinx_md/appbuilder.core.components.llms.style_writing.md index 32bf12f34..e525936a3 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.style_writing.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.style_writing.md @@ -18,7 +18,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"] = '...' -style_writing = appbuilder.StyleWriting(model="ERNIE Speed-AppBuilder") +style_writing = appbuilder.StyleWriting(model="Qianfan-Appbuilder-Speed-8k") answer = style_writing(appbuilder.Message("帮我写一篇关于人体工学椅的文案"), style_query="小红书", length=100) ``` diff --git a/docs/sphinx_md/appbuilder.core.components.llms.tag_extraction.md b/docs/sphinx_md/appbuilder.core.components.llms.tag_extraction.md index 9b8a93dcc..79fa7c357 100644 --- a/docs/sphinx_md/appbuilder.core.components.llms.tag_extraction.md +++ b/docs/sphinx_md/appbuilder.core.components.llms.tag_extraction.md @@ -17,7 +17,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="ERNIE Speed-AppBuilder") +tag_extraction = appbuilder.TagExtraction(model="Qianfan-Appbuilder-Speed-8k") answer = tag_extraction(appbuilder.Message("从这段文本中抽取关键标签")) ``` diff --git a/docs/sphinx_md/appbuilder.core.md b/docs/sphinx_md/appbuilder.core.md index 393a02038..c53ac75cd 100644 --- a/docs/sphinx_md/appbuilder.core.md +++ b/docs/sphinx_md/appbuilder.core.md @@ -91,7 +91,7 @@ os.environ["APPBUILDER_TOKEN"] = '...' class PlaygroundWithHistory(Component): def __init__(self): super().__init__() - self.query_rewrite = QueryRewrite(model="ERNIE Speed-AppBuilder") + self.query_rewrite = QueryRewrite(model="Qianfan-Appbuilder-Speed-8k") self.play = Playground( prompt_template="{query}", model="eb-4"