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
254 stars 132 forks source link

Feat: Use dependency injection to make components composable #180

Closed shibbas closed 9 months ago

shibbas commented 9 months ago

Purpose

Refactors the chat components to be injected using InversifyJS. Separates out feature functionality from being an element in the component. Each injected feature is then responsible for determining how it is to be added to the component, what elements it should render and other resources. Chat-component is not aware of any feature components on it's own. A shared state is managed as a chat-context that is passed down and is shared across the injected features.

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] 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
run playwright tests

What to Check

Verify that the following are valid

Other Information