microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
22.12k stars 3.3k forks source link

.Net Agents - Protect against null-reference for Assistant file-search result when streaming #9742

Closed crickman closed 1 week ago

crickman commented 1 week ago

Motivation and Context

Fixes: https://github.com/microsoft/semantic-kernel/issues/9723

Must distinguish between file-search result and function-call result for assistant streaming without triggering NullReferenceException

Description

A file-search result provide any streaming result; rather, it results in an annotation on the assistant message. Still it must be distinguished from a function-call result.

Since RunStepDetailsUpdate.FunctionName property throws a NullReferenceException when being evaluated, using RunStepDetailsUpdate.FunctionResult property.

Merged fix to Open AI SDK: https://github.com/openai/openai-dotnet/pull/293

Contribution Checklist