Skip to content

Commit 3321896

Browse files
Fix Python E2E test to use keyword args for create_session
The create_session() method was refactored to keyword-only params. Update the customized systemMessage test to use keyword arguments instead of a positional dict, and fix send_and_wait() call to pass prompt as a positional string. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 95333dc commit 3321896

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

python/e2e/test_session.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,18 @@ async def test_should_create_a_session_with_customized_systemMessage_config(
8888
custom_tone = "Respond in a warm, professional tone. Be thorough in explanations."
8989
appended_content = "Always mention quarterly earnings."
9090
session = await ctx.client.create_session(
91-
{
92-
"system_message": {
93-
"mode": "customize",
94-
"sections": {
95-
"tone": {"action": "replace", "content": custom_tone},
96-
"code_change_rules": {"action": "remove"},
97-
},
98-
"content": appended_content,
91+
on_permission_request=PermissionHandler.approve_all,
92+
system_message={
93+
"mode": "customize",
94+
"sections": {
95+
"tone": {"action": "replace", "content": custom_tone},
96+
"code_change_rules": {"action": "remove"},
9997
},
100-
"on_permission_request": PermissionHandler.approve_all,
101-
}
98+
"content": appended_content,
99+
},
102100
)
103101

104-
assistant_message = await session.send_and_wait({"prompt": "Who are you?"})
102+
assistant_message = await session.send_and_wait("Who are you?")
105103
assert assistant_message is not None
106104

107105
# Validate the system message sent to the model

0 commit comments

Comments
 (0)