Skip to content

Python: Add UserSecurityContext to SK python #11752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

slreznit
Copy link
Contributor

Motivation and Context

Expose UserSecurityContext in SK python via ExtraBody as this is available in Azure only.
https://learn.microsoft.com/en-us/dotnet/api/azure.ai.openai.usersecuritycontext

Description

Contribution Checklist

@slreznit slreznit requested a review from a team as a code owner April 26, 2025 18:19
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Apr 26, 2025
@github-actions github-actions bot changed the title Add UserSecurityContext to SK python Python: Add UserSecurityContext to SK python Apr 26, 2025
@markwallace-microsoft
Copy link
Member

Python Unit Test Overview

Tests Skipped Failures Errors Time
3439 5 💤 0 ❌ 0 🔥 1m 44s ⏱️

@@ -159,6 +159,7 @@ class ExtraBody(KernelBaseModel):
data_sources: list[DataSource] | None = None
input_language: Annotated[str | None, Field(serialization_alias="inputLanguage")] = None
output_language: Annotated[str | None, Field(serialization_alias="outputLanguage")] = None
user_security_context: Annotated[str | None, Field()] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

If we don't need any special serialization alias handling for this attribute, we can remove the need for the empty Field().

Suggested change
user_security_context: Annotated[str | None, Field()] = None
user_security_context: str | None = None

@@ -159,6 +159,7 @@ class ExtraBody(KernelBaseModel):
data_sources: list[DataSource] | None = None
input_language: Annotated[str | None, Field(serialization_alias="inputLanguage")] = None
output_language: Annotated[str | None, Field(serialization_alias="outputLanguage")] = None
user_security_context: Annotated[str | None, Field()] = None
Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants