From 58fdf176af81bce22183fd45aa967153da4a51cf Mon Sep 17 00:00:00 2001 From: zhangxin Date: Wed, 12 Nov 2025 11:52:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=92=8C=E6=B5=8B=E8=AF=95=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../async_appbuilder_client.py | 2 +- ...async_appbuilder_client_custom_metadata.py | 54 ++++++++++--------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/python/core/console/appbuilder_client/async_appbuilder_client.py b/python/core/console/appbuilder_client/async_appbuilder_client.py index 26874994..ad84e551 100644 --- a/python/core/console/appbuilder_client/async_appbuilder_client.py +++ b/python/core/console/appbuilder_client/async_appbuilder_client.py @@ -133,7 +133,7 @@ async def run( action=action, mcp_authorization=mcp_authorization, parameters=parameters, - conversation=custom_metadata, + custom_metadata=custom_metadata, ) headers = self.http_client.auth_header_v2(mcp_context=self._mcp_context) diff --git a/python/tests/test_async_appbuilder_client_custom_metadata.py b/python/tests/test_async_appbuilder_client_custom_metadata.py index 26b367f0..8dc715ea 100644 --- a/python/tests/test_async_appbuilder_client_custom_metadata.py +++ b/python/tests/test_async_appbuilder_client_custom_metadata.py @@ -53,19 +53,21 @@ async def agent_handle(): builder = appbuilder.AsyncAppBuilderClient(self.app_id) conversation_id = await builder.create_conversation() msg = await builder.run(conversation_id, "我要回老家相亲", stream=False, custom_metadata=CustomMetadata( - override_role_instruction= "# 角色任务\n" + - "作为高情商大师,你的主要任务是根据提问,做出最佳的建议。\n" + - "\n" + - "# 工具能力\n" + - "\n" + - "无工具集提供\n" + - "\n" + - "# 要求与限制\n" + - "\n" + - "1. 输出内容的风格为幽默\n" + - "2.输出的字数限制为100字以内", + override_role_instruction="# 角色任务\n" + + "作为高情商大师,你的主要任务是根据提问,做出最佳的建议。\n" + + "\n" + + "# 工具能力\n" + + "\n" + + "无工具集提供\n" + + "\n" + + "# 要求与限制\n" + + "\n" + + "1. 输出内容的风格为幽默\n" + + "2.输出的字数限制为100字以内\n" + + "3. 在每次回复开头都声明今天的天气情况\n" + + "4. 在每次回复结尾都声明现在的btc价格", )) - print(msg.content.answer) + print(msg) await builder.http_client.session.close() asyncio.run(agent_handle()) @@ -90,21 +92,23 @@ async def agent_handle(): builder = appbuilder.AsyncAppBuilderClient(self.app_id) conversation_id = await builder.create_conversation() msg = await builder.run(conversation_id, "我要回老家相亲", stream=True, custom_metadata=CustomMetadata( - override_role_instruction= "# 角色任务\n" + - "作为高情商大师,你的主要任务是根据提问,做出最佳的建议。\n" + - "\n" + - "# 工具能力\n" + - "\n" + - "无工具集提供\n" + - "\n" + - "# 要求与限制\n" + - "\n" + - "1. 输出内容的风格为幽默\n" + - "2.输出的字数限制为100字以内", - )) + override_role_instruction="# 角色任务\n" + + "作为高情商大师,你的主要任务是根据提问,做出最佳的建议。\n" + + "\n" + + "# 工具能力\n" + + "\n" + + "无工具集提供\n" + + "\n" + + "# 要求与限制\n" + + "\n" + + "1. 输出内容的风格为幽默\n" + + "2.输出的字数限制为100字以内\n" + + "3. 在每次回复开头都声明今天的天气情况\n" + + "4. 在每次回复结尾都声明现在的btc价格", + )) async for content in msg.content: - print(content.answer) + print(content) await builder.http_client.session.close() asyncio.run(agent_handle()) From 43f227c5d6ebd3989b224e60e7c855caf3315448 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Wed, 12 Nov 2025 13:21:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=92=8C=E6=B5=8B=E8=AF=95=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/__init__.py b/python/__init__.py index f3143143..030c1ade 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -13,7 +13,7 @@ # limitations under the License. -__version__ = '1.1.2' +__version__ = '1.1.3' import os import sys diff --git a/setup.py b/setup.py index 9fae532e..d2b4bc7b 100755 --- a/setup.py +++ b/setup.py @@ -55,7 +55,7 @@ setup( name="appbuilder-sdk", # NOTE(chengmo): 修改此版本号时,请注意同时修改 __init__.py 中的 __version__ - version="1.1.2", + version="1.1.3", author="dongdaxiang", author_email="dongdaxiang@baidu.com", packages=packages,