Skip to content

fix: update Python examples to work OOTB#784

Merged
SteveSandersonMS merged 5 commits intogithub:mainfrom
stefansedich:patch-1
Mar 13, 2026
Merged

fix: update Python examples to work OOTB#784
SteveSandersonMS merged 5 commits intogithub:mainfrom
stefansedich:patch-1

Conversation

@stefansedich
Copy link
Contributor

The Python examples were not working OOTB giving the following error:

ValueError: An on_permission_request handler is required when creating a session. For example, to allow all permissions, use {"on_permission_request": PermissionHandler.approve_all}.

However upon adding the on_permission_request they work as expected.

@stefansedich stefansedich requested a review from a team as a code owner March 10, 2026 21:05
Copilot AI review requested due to automatic review settings March 10, 2026 21:05
@stefansedich stefansedich changed the title fix: update Python example to work OOTB fix: update Python examples to work OOTB Mar 10, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Python code samples in the Getting Started guide to work out-of-the-box by including the required on_permission_request handler when creating sessions, aligning the docs with current Python SDK behavior.

Changes:

  • Import PermissionHandler in multiple Python snippets.
  • Add "on_permission_request": PermissionHandler.approve_all to create_session(...) example configs (basic, streaming, tools, and weather assistant examples).

stefansedich and others added 3 commits March 10, 2026 14:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@SteveSandersonMS SteveSandersonMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @stefansedich!

@SteveSandersonMS SteveSandersonMS added this pull request to the merge queue Mar 13, 2026
Merged via the queue into github:main with commit 38603f2 Mar 13, 2026
4 checks passed
@stomde
Copy link

stomde commented Mar 13, 2026

Pleasure all mine/**$STOMA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants