Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.


__version__ = '1.1.2'
__version__ = '1.1.3'

import os
import sys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
54 changes: 29 additions & 25 deletions python/tests/test_async_appbuilder_client_custom_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading