Skip to content

Assistant - Fix null-reference exception when accessing RunStepDetailsUpdate.FunctionName - #293

Merged
joseharriaga merged 1 commit into
openai:mainfrom
crickman:fix-assistant-rundetailsupdate-functionname-nullref
Nov 18, 2024
Merged

joseharriaga merged 1 commit into
openai:mainfrom
crickman:fix-assistant-rundetailsupdate-functionname-nullref

Conversation

@crickman

Copy link
Copy Markdown
Contributor

The propertis for RunStepDetailsUpdate all fall-through for null internal definitions, except for FunctionName...which results in a NullReferenceException. This is inconsistent with the expected behavior.

This complicates inspection when file-search and functions are both enabled.

@crickman crickman changed the title Assistant - Fix null-reference exception when referencing RunStepDetailsUpdate.FunctionName Assistant - Fix null-reference exception when accessing RunStepDetailsUpdate.FunctionName Nov 18, 2024
@joseharriaga
joseharriaga merged commit 448181b into openai:main Nov 18, 2024
@joseharriaga

Copy link
Copy Markdown
Collaborator

Thank you for your contribution, @crickman !

github-merge-queue Bot pushed a commit to microsoft/semantic-kernel that referenced this pull request Nov 19, 2024
…h result when streaming (#9742)

### 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.
-->

Fixes: #9723

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

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

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:
openai/openai-dotnet#293


### 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants