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: handle failing tool call gracefully #6268

Merged

Conversation

eavanvalkenburg
Copy link
Member

Motivation and Context

When a function that was called using tool calling fails, it shouldn't drop the whole flow, this fixes that.

Fix #6260

Description

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

@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner May 15, 2024 13:37
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label May 15, 2024
@markwallace-microsoft
Copy link
Member

Py3.10 Test Coverage

Python 3.10 Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/connectors/ai/open_ai/services
   open_ai_chat_completion_base.py1827957%128, 139–147, 164, 167–178, 194–197, 207–210, 221–251, 260–268, 284–291, 312, 320, 326–332, 344–350, 373, 410, 426–428
TOTAL572389684% 

Python 3.10 Unit Test Overview

Tests Skipped Failures Errors Time
1320 1 💤 0 ❌ 0 🔥 15.515s ⏱️

@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue May 15, 2024
Merged via the queue into microsoft:main with commit ce87f91 May 15, 2024
26 checks passed
@eavanvalkenburg eavanvalkenburg deleted the handle_failing_tool_call branch May 15, 2024 17:52
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.

Python: Auto function calling doesn't gracefully handle errors
4 participants