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

.Net: Exception handling consistency for FunctionCallContent class. #8640

Merged

Conversation

SergeyMenshykh
Copy link
Member

Motivation and Context

The FunctionCallContent.InvokeAsync method throws exceptions in two cases: if the function invocation fails or the function is not found. However, it does not throw exceptions captured in the Exception property that might occur while mapping the function call represented by the AI connector-specific function call model to the connector-agnostic FunctionCallContent model class.

This introduces inconsistency in the way exceptions are handled by the FunctionCallContent.InvokeAsync method and may lead to intermittent failures in the calling code that are difficult to troubleshoot and identify the root cause of.

Description

This PR throws the function call mapping exception captured by the Exception property.

Contribution Checklist

@SergeyMenshykh SergeyMenshykh self-assigned this Sep 9, 2024
@SergeyMenshykh SergeyMenshykh requested a review from a team as a code owner September 9, 2024 21:20
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Sep 9, 2024
@SergeyMenshykh SergeyMenshykh marked this pull request as draft September 10, 2024 08:41
@SergeyMenshykh SergeyMenshykh marked this pull request as ready for review September 12, 2024 17:24
Copy link
Member

@RogerBarreto RogerBarreto left a comment

Choose a reason for hiding this comment

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

This might have a big consequence for all, as much of the failing scenarios were silent before and now may throw on the caller code.

@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Sep 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 13, 2024
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Sep 13, 2024
Merged via the queue into microsoft:main with commit 82ef22c Sep 13, 2024
15 checks passed
@SergeyMenshykh SergeyMenshykh deleted the fix-function-call-content-invoke branch September 13, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
function_calling kernel.core kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants