Skip to content

Commit 73ba6e1

Browse files
authored
Merge pull request #913 from zhangairku/python-support-parameters-metadata
更改参数和测试案例
2 parents 464f9e2 + 43f227c commit 73ba6e1

File tree

4 files changed

+32
-28
lines changed

4 files changed

+32
-28
lines changed

python/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515

16-
__version__ = '1.1.2'
16+
__version__ = '1.1.3'
1717

1818
import os
1919
import sys

python/core/console/appbuilder_client/async_appbuilder_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ async def run(
133133
action=action,
134134
mcp_authorization=mcp_authorization,
135135
parameters=parameters,
136-
conversation=custom_metadata,
136+
custom_metadata=custom_metadata,
137137
)
138138

139139
headers = self.http_client.auth_header_v2(mcp_context=self._mcp_context)

python/tests/test_async_appbuilder_client_custom_metadata.py

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,21 @@ async def agent_handle():
5353
builder = appbuilder.AsyncAppBuilderClient(self.app_id)
5454
conversation_id = await builder.create_conversation()
5555
msg = await builder.run(conversation_id, "我要回老家相亲", stream=False, custom_metadata=CustomMetadata(
56-
override_role_instruction= "# 角色任务\n" +
57-
"作为高情商大师,你的主要任务是根据提问,做出最佳的建议。\n" +
58-
"\n" +
59-
"# 工具能力\n" +
60-
"\n" +
61-
"无工具集提供\n" +
62-
"\n" +
63-
"# 要求与限制\n" +
64-
"\n" +
65-
"1. 输出内容的风格为幽默\n" +
66-
"2.输出的字数限制为100字以内",
56+
override_role_instruction="# 角色任务\n" +
57+
"作为高情商大师,你的主要任务是根据提问,做出最佳的建议。\n" +
58+
"\n" +
59+
"# 工具能力\n" +
60+
"\n" +
61+
"无工具集提供\n" +
62+
"\n" +
63+
"# 要求与限制\n" +
64+
"\n" +
65+
"1. 输出内容的风格为幽默\n" +
66+
"2.输出的字数限制为100字以内\n" +
67+
"3. 在每次回复开头都声明今天的天气情况\n" +
68+
"4. 在每次回复结尾都声明现在的btc价格",
6769
))
68-
print(msg.content.answer)
70+
print(msg)
6971
await builder.http_client.session.close()
7072

7173
asyncio.run(agent_handle())
@@ -90,21 +92,23 @@ async def agent_handle():
9092
builder = appbuilder.AsyncAppBuilderClient(self.app_id)
9193
conversation_id = await builder.create_conversation()
9294
msg = await builder.run(conversation_id, "我要回老家相亲", stream=True, custom_metadata=CustomMetadata(
93-
override_role_instruction= "# 角色任务\n" +
94-
"作为高情商大师,你的主要任务是根据提问,做出最佳的建议。\n" +
95-
"\n" +
96-
"# 工具能力\n" +
97-
"\n" +
98-
"无工具集提供\n" +
99-
"\n" +
100-
"# 要求与限制\n" +
101-
"\n" +
102-
"1. 输出内容的风格为幽默\n" +
103-
"2.输出的字数限制为100字以内",
104-
))
95+
override_role_instruction="# 角色任务\n" +
96+
"作为高情商大师,你的主要任务是根据提问,做出最佳的建议。\n" +
97+
"\n" +
98+
"# 工具能力\n" +
99+
"\n" +
100+
"无工具集提供\n" +
101+
"\n" +
102+
"# 要求与限制\n" +
103+
"\n" +
104+
"1. 输出内容的风格为幽默\n" +
105+
"2.输出的字数限制为100字以内\n" +
106+
"3. 在每次回复开头都声明今天的天气情况\n" +
107+
"4. 在每次回复结尾都声明现在的btc价格",
108+
))
105109

106110
async for content in msg.content:
107-
print(content.answer)
111+
print(content)
108112
await builder.http_client.session.close()
109113

110114
asyncio.run(agent_handle())

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
setup(
5656
name="appbuilder-sdk",
5757
# NOTE(chengmo): 修改此版本号时,请注意同时修改 __init__.py 中的 __version__
58-
version="1.1.2",
58+
version="1.1.3",
5959
author="dongdaxiang",
6060
author_email="[email protected]",
6161
packages=packages,

0 commit comments

Comments
 (0)