Streamlit appication that runs a market wizard Q&A bot using Groq for hosted inference, 'llama3-70b-8192' as the LLM, and Yahoo Finance as the source of financial data.
The application has a few functions that the model uses to perform calculations and to respond to common queries that a user might ask.
- Python 3.9
- Docker (for deployment)
-
Clone the repository:
git clone https://github.com/sidmohan0/yahoofinancewizard.git cd yahoofinancewizard
-
Install required Python packages:
pip install -r requirements.txt
-
Set up environment variables:
- Create a
.env
file in the project root. - Add your Groq API key:
GROQ_API_KEY=your_groq_api_key_here
- Create a
-
Run the application:
streamlit run app.py
-
Ask about current stock prices:
- Example: "What's the current price of Meta stock?"
-
Request historical stock prices:
- Example: "Show me the historical prices of Apple vs Microsoft stock over the past 6 months."
-
Build the Docker image:
docker build -t yahoofinancewizard:latest -f app/Dockerfile .
-
Run the Docker container:
docker run -d -p 8501:8501 yahoofinancewizard:latest
-
Access the application:
- Open your browser and go to
http://localhost:8501
.
- Open your browser and go to
-
get_stock_info(symbol, key)
:- Retrieves specific information about a stock based on the provided key.
-
get_historical_price(symbol, start_date, end_date)
:- Fetches historical stock prices for the given date range.
-
plot_price_over_time(historical_price_dfs)
:- Plots the historical prices for comparison using Plotly.
-
call_functions(llm_with_tools, user_prompt)
:- Handles user prompts, invokes relevant tools, and generates responses.
This project is licensed under the MIT License. See the LICENSE file for details.
For any issues or contributions, please feel free to create a pull request or open an issue in the repository.