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: Aligning the SK agent HTTP stack behavior with the SK one #4569

Merged

Conversation

SergeyMenshykh
Copy link
Member

@SergeyMenshykh SergeyMenshykh commented Jan 10, 2024

Motivation and Context

Aligning the SK agent HTTP stack behavior with the SK one, where HttpClientException and RequestFailedException (thrown by AzureSDK) are translated into HttpOperationException. Doing so hides SK/Agent internal implementation details (whether requests are sent via vanilla HttpClient or third-party client library) from SK/Agent consumer code without losing original exception details. Additionally, this will future-proof the SK/Agent consumer code, as it will require only one catch block - catch(HttpOperationException ex), which once added, will work regardless of the connector (currently, only OpenAI) used to access LLM.

ADR for similar changes in SK - https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0004-error-handling.md

…ClaimrException and RequestFailedException (thrown by AzureSDK) are translated into HttpOperationException. Doing so conceals SK/Agent internal implementation details (whether requests are sent via vanilla HttpClient or third-party client library) from SK/Agent consumer code. Additionally, this will future-proof SK/Agent consumer code, as it will require only one catch block - catch(HttpOperationException ex), which once added, will work regardless of the connector (currently, only OpenAI) used to access LLM.
@SergeyMenshykh SergeyMenshykh requested a review from a team as a code owner January 10, 2024 21:40
@shawncal shawncal added the .NET Issue or Pull requests regarding .NET code label Jan 10, 2024
@SergeyMenshykh SergeyMenshykh added PR: ready for review All feedback addressed, ready for reviews agents labels Jan 10, 2024
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Jan 16, 2024
Merged via the queue into microsoft:main with commit b9c1adc Jan 16, 2024
18 checks passed
@SergeyMenshykh SergeyMenshykh deleted the agent-http-stack-alignment branch January 16, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants