Azure-Samples / azure-search-openai-javascript

A TypeScript sample app for the Retrieval Augmented Generation pattern running on Azure, using Azure AI Search for retrieval and Azure OpenAI and LangChain large language models (LLMs) to power ChatGPT-style and Q&A experiences.
MIT License
237 stars 121 forks source link

Fix error with undefined choices in new conversations #202

Closed tebayoso closed 4 months ago

tebayoso commented 4 months ago

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

Purpose

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

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

What to Check

Verify that the following are valid

Other Information

sinedied commented 4 months ago

Thank you!