https://github.com/emms21/thoughtful_ai
Technical Screening: an agent that responds to semantically similar questions with pre-defined answers, falling back to generic LLM responses otherwise
https://github.com/emms21/thoughtful_ai
openai python scikit-learn streamlit
Last synced: 8 months ago
JSON representation
Technical Screening: an agent that responds to semantically similar questions with pre-defined answers, falling back to generic LLM responses otherwise
- Host: GitHub
- URL: https://github.com/emms21/thoughtful_ai
- Owner: EmmS21
- Created: 2024-09-16T18:48:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-16T19:20:50.000Z (about 1 year ago)
- Last Synced: 2025-01-22T08:37:22.579Z (9 months ago)
- Topics: openai, python, scikit-learn, streamlit
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Thoughtful AI Chat Assistant
## Setup
1. Add your OpenAI API key to the `.env.test` file:
```
OPENAI_API_KEY=your_api_key_here
```
## Running the App
1. Install dependencies:
```
pip install -r requirements.txt
```
2. Run the CLI version:
```
python src/app.py
```
3. Run the Streamlit version:
```
streamlit run src/app.py
```
## Running Tests
Execute tests using pytest:
pytest tests/test_app.py
## Test Details
The tests in `test_app.py` cover:
1. **Predefined Questions**: Checks if exact matches for predefined questions return the correct answers.
2. **Semantically Similar Questions**: Tests if slightly modified versions of predefined questions still return the expected answers using semantic matching.
3. **Other Questions**: Ensures that unrelated questions:
- Don't match any predefined or semantic answers
- Get a non-empty response from the LLM integration
These tests validate the core functionality of the chat assistant, including exact matching, semantic matching, and LLM fallback for handling various types of user inputs.