Skip to content
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

Python: Error executing dynamic code with semantic kernel #10693

Open
swapnilgvartak opened this issue Feb 26, 2025 · 2 comments
Open

Python: Error executing dynamic code with semantic kernel #10693

swapnilgvartak opened this issue Feb 26, 2025 · 2 comments
Assignees
Labels
agents python Pull requests for the Python Semantic Kernel

Comments

@swapnilgvartak
Copy link

  1. While using azure code interpreter session pool through semantic kernel, how can we get session id detail of code interpreter session used, so that we can fetch the session files.
  2. Azure AI assistant agent not working. we are getting co routine error while implementing Azure AI assistant. please find error details

Image

  1. How can we use azure container session pool as a code interpreter in agent group chat of Semantic Kernel.
@sphenry
Copy link
Member

sphenry commented Feb 26, 2025

Hi @swapnilgvartak
For #2, I can't see all of the code, but the way you're invoking main() doesn't look right. Take a look at the sample here: https://github.com/microsoft/semantic-kernel/blob/main/python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_file_manipulation.py

For #3, please take a look at the sample here: https://github.com/microsoft/semantic-kernel/blob/main/python/samples/concepts/plugins/azure_python_code_interpreter.py

@moonbox3 moonbox3 added python Pull requests for the Python Semantic Kernel agents and removed triage labels Feb 26, 2025
@github-actions github-actions bot changed the title Error executing dynamic code with semantic kernel Python: Error executing dynamic code with semantic kernel Feb 26, 2025
@moonbox3
Copy link
Contributor

Hi @swapnilgvartak, to @sphenry's point, please follow the samples. main() should be async def main() and you thus need to call it with asyncio.run(main()).

For #1, have you gone through our README for the Sessions plugin tool? https://github.com/microsoft/semantic-kernel/tree/main/python/semantic_kernel/core_plugins/sessions_python_tool It is run just as any other plugin is, with auto function calling enabled, the model will send the arguments to the plugin to execute code or upload files. At the bottom of the README are some samples showing this in a script.

For #3, Shawn pointed to a good sample. Per my comment above, you hook up the plugin to an agent, like a ChatCompletionAgent, and that agent, with function calling enabled, can execute code.

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

No branches or pull requests

4 participants