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/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()) 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,