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

Fix error with undefined choices in new conversations #202

Merged

Conversation

tebayoso
Copy link
Contributor

-Added safe navigation to an object that might be undefined on an empty conversation. -Fixes #201

Purpose

  • Prevents an error in new projects where empty choices are returned because of the lack of context history.

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code
Spin up a new project
Validate that the console displays no errors

What to Check

Verify that the following are valid

  • A new conversation without prior context should have no error when retrieving the choices.

Other Information

-Added safe navigation to an object that might be undefined on an empty conversation.
-Fixes Azure-Samples#201
@sinedied
Copy link
Contributor

Thank you!

@sinedied sinedied merged commit 582a011 into Azure-Samples:main May 16, 2024
6 checks passed
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.

Choices might be undefined when the project just started.
2 participants