Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 days 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 (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-16T19:20:50.000Z (4 months ago)
- Last Synced: 2024-11-21T16:14:23.384Z (2 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 integrationThese tests validate the core functionality of the chat assistant, including exact matching, semantic matching, and LLM fallback for handling various types of user inputs.