Skip to content

This is the model will take the input is the query related to the financial field specificly for stock to answer about the based knowledge question or analysis the specific stocks using 1 year historical data prices with 1 year news related to the stock symbol

License

Notifications You must be signed in to change notification settings

NolanMM/Capstone_Financial_Assistant_Server

Repository files navigation

Finance RAG Pipeline

This is the model will take the input is the query related to the financial field specificly for stock to answer about the based knowledge question or analysis the specific stocks using 1 year historical data prices with 1 year news related to the stock symbol


I. Sample Output

A. Ticker Analysis Services

Input Query: What is the current price of Nvidia?

Ticker Analysis Output
B. General Knowledge Services

Input Query: What is a P/E ratio?

General Knowledge Output
C. Financial Advice Services

Input Query: Should I invest in an IPO?

Financial Advice Output

II. Prerequisites

A. Install the Requirements Dependencies

Method 1: Install using pip (Manual)
  • Make sure you have Python installed on your system.
  • Open a terminal or command prompt.
  • Navigate to the project directory where the requirements.txt file is located.
  • Run the following command to install the required packages:
pip install -r requirements.txt
Method 2: Install using Script (Automatically)
  • Double-click the Install.bat file to automatically install the required packages (Windows only).

B. Update the API Keys inside the assistant/.env file

  • Open the .env file located in the root directory.

  • Replace the placeholder values with your actual API keys for OpenAI, Finnhub, and Financial Modeling Prep.

  • Save the changes to the .env file.

    OPENAI_API_KEY=your_openai_api_key
    FINNHUB_API_KEY=your_finnhub_api_key
    FMP_API_KEY=your_financial_modeling_prep_api_key
    

    image

C. Run the Script

Method 1: Run the code in terminal (Manual)
  • Step 1: Update the sqlite Database
python manage.py migrate
  • Step 2: Run the Django Server
python manage.py runserver
Method 2: Run the code using Script (Automatically)
  • Double-click the Analysis_Server.bat file to automatically run the server (Windows only).

D. Deploying with Ngrok (Server Running Locally - Optional)

  • Step 1: Install and Configure ngrok

    • Go to the ngrok website to sign up and download the client (ngrok)
    • Find your authtoken on the ngrok dashboard.
    • Connect your account using the command below.
      ngrok config add-authtoken YOUR_AUTHTOKEN
      
  • Step 2: Run Django Server and ngrok

    • Terminal 1: Start Django
      python manage.py runserver
      
    • Terminal 2: Start ngrok
      ngrok http 8000
      
  • Step 3: Access Your Public URL

    • Ngrok will provide a public URL that forwards to your local server. Look for the "Forwarding" line in the ngrok terminal.
      Forwarding https://random-string.ngrok-free.app -> http://localhost:8000
      

About

This is the model will take the input is the query related to the financial field specificly for stock to answer about the based knowledge question or analysis the specific stocks using 1 year historical data prices with 1 year news related to the stock symbol

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages