Skip to content

ThinkMachina/ChatGPT-Functions-Calling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT-Functions

Experimenting with ChatGPT Function Calling

Python script that accepts a stock ticker symbol as a command-line argument. It fetches the stock's price, 5-day Simple Moving Average (SMA), and 200-day SMA from the Alpha Vantage API, and then asks the AI to analyze the trend based on this data.

Setup Environment

Python dependencies

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

API keys

Alpha Vantage: Export as ALPHA_VANTAGE_API_KEY environment variable.

OpenAI: Export as OPENAI_API_KEY environment variable.

Execute program

$ python main.py {TICKER}
$ python main.py VTI 

The trend of VTI stock is currently showing a slight downward movement. The current price is $218.18, which is slightly lower than the 5-day Simple Moving Average (SMA) of $218.48. However, it is still higher than the 200-day SMA of $197.93, indicating a long-term upward trend.

About

Experimenting with ChatGPT Functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages