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: Auto function calling doesn't gracefully handle errors #6260

Closed
matthewbolanos opened this issue May 14, 2024 · 0 comments · Fixed by #6268
Closed

Python: Auto function calling doesn't gracefully handle errors #6260

matthewbolanos opened this issue May 14, 2024 · 0 comments · Fixed by #6268
Labels
python Pull requests for the Python Semantic Kernel triage

Comments

@matthewbolanos
Copy link
Member

I am giving the LLM a function that allows it to make requests to turn on a light. If the AI performs the operation wrong, the function will return an error which will raise an exception that ends the auto function calling. Instead, the exception should be caught so the auto function calling loop can continue

@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel triage labels May 14, 2024
github-merge-queue bot pushed a commit that referenced this issue May 15, 2024
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
When a function that was called using tool calling fails, it shouldn't
drop the whole flow, this fixes that.

Fix #6260 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Creates a function result content item with the failing function and the
error message, allowing the model to figure out if it wants to recall
with different params.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
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 triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants