Skip to content

.Net: Use type to represent python code execution result #11931

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

Conversation

SergeyMenshykh
Copy link
Member

Motivation, Context and Description

This PR introduces a new type, SessionsPythonCodeExecutionResult, to represent the Python code execution result and refactors the SessionsPythonPlugin.ExecuteCodeAsync method to return this type instead of a string. This should allow access to the result in a structured way for scenarios where the result needs to be processed further, for example, in the auto function invocation filters. At the same time, the type overloads the ToString() method to be used in scenarios where the result needs to be a string, for example when the function is invoked as part of rendering a prompt template.

Contributes to: #10070

@SergeyMenshykh SergeyMenshykh self-assigned this May 7, 2025
@SergeyMenshykh SergeyMenshykh requested a review from a team as a code owner May 7, 2025 12:47
@SergeyMenshykh SergeyMenshykh added the .NET Issue or Pull requests regarding .NET code label May 7, 2025
@markwallace-microsoft markwallace-microsoft added the kernel Issues or pull requests impacting the core kernel label May 7, 2025
@SergeyMenshykh SergeyMenshykh moved this to Sprint: In Review in Semantic Kernel May 7, 2025
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue May 7, 2025
Merged via the queue into microsoft:main with commit fa2d52f May 7, 2025
20 checks passed
@SergeyMenshykh SergeyMenshykh deleted the use-type-for-code-execution-function branch May 7, 2025 21:40
@github-project-automation github-project-automation bot moved this from Sprint: In Review to Sprint: Done in Semantic Kernel May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
Status: Sprint: Done
Development

Successfully merging this pull request may close these issues.

3 participants