@@ -60,14 +60,13 @@ const session = await client.createSession({
6060<summary ><strong >Python</strong ></summary >
6161
6262``` python
63- from copilot import CopilotClient
64- from copilot.session import PermissionRequestResult
63+ from copilot import CopilotClient, PermissionDecisionApproveOnce
6564
6665client = CopilotClient()
6766await client.start()
6867
6968session = await client.create_session(
70- on_permission_request = lambda req , inv : PermissionRequestResult( kind = " approve-once " ),
69+ on_permission_request = lambda req , inv : PermissionDecisionApproveOnce( ),
7170 hooks = {
7271 " on_session_start" : on_session_start,
7372 " on_pre_tool_use" : on_pre_tool_use,
@@ -262,7 +261,7 @@ const session = await client.createSession({
262261<summary ><strong >Python</strong ></summary >
263262
264263``` python
265- from copilot.session import PermissionRequestResult
264+ from copilot import PermissionDecisionApproveOnce
266265
267266READ_ONLY_TOOLS = [" read_file" , " glob" , " grep" , " view" ]
268267
@@ -276,7 +275,7 @@ async def on_pre_tool_use(input_data, invocation):
276275 return {" permissionDecision" : " allow" }
277276
278277session = await client.create_session(
279- on_permission_request = lambda req , inv : PermissionRequestResult( kind = " approve-once " ),
278+ on_permission_request = lambda req , inv : PermissionDecisionApproveOnce( ),
280279 hooks = {" on_pre_tool_use" : on_pre_tool_use},
281280)
282281```
@@ -578,7 +577,7 @@ const session = await client.createSession({
578577<!-- docs-validate: skip -->
579578``` python
580579import json, aiofiles
581- from copilot.session import PermissionRequestResult
580+ from copilot import PermissionDecisionApproveOnce
582581
583582audit_log = []
584583
@@ -630,7 +629,7 @@ async def on_session_end(input_data, invocation):
630629 return None
631630
632631session = await client.create_session(
633- on_permission_request = lambda req , inv : PermissionRequestResult( kind = " approve-once " ),
632+ on_permission_request = lambda req , inv : PermissionDecisionApproveOnce( ),
634633 hooks = {
635634 " on_session_start" : on_session_start,
636635 " on_user_prompt_submitted" : on_user_prompt_submitted,
@@ -709,7 +708,7 @@ const session = await client.createSession({
709708
710709``` python
711710import subprocess
712- from copilot.session import PermissionRequestResult
711+ from copilot import PermissionDecisionApproveOnce
713712
714713async def on_session_end (input_data , invocation ):
715714 sid = invocation[" session_id" ][:8 ]
@@ -728,7 +727,7 @@ async def on_error_occurred(input_data, invocation):
728727 return None
729728
730729session = await client.create_session(
731- on_permission_request = lambda req , inv : PermissionRequestResult( kind = " approve-once " ),
730+ on_permission_request = lambda req , inv : PermissionDecisionApproveOnce( ),
732731 hooks = {
733732 " on_session_end" : on_session_end,
734733 " on_error_occurred" : on_error_occurred,
@@ -932,7 +931,7 @@ const session = await client.createSession({
932931<summary ><strong >Python</strong ></summary >
933932
934933``` python
935- from copilot.session import PermissionRequestResult
934+ from copilot import PermissionDecisionApproveOnce
936935
937936session_metrics = {}
938937
@@ -963,7 +962,7 @@ async def on_session_end(input_data, invocation):
963962 return None
964963
965964session = await client.create_session(
966- on_permission_request = lambda req , inv : PermissionRequestResult( kind = " approve-once " ),
965+ on_permission_request = lambda req , inv : PermissionDecisionApproveOnce( ),
967966 hooks = {
968967 " on_session_start" : on_session_start,
969968 " on_user_prompt_submitted" : on_user_prompt_submitted,
0 commit comments