diff --git a/un-spaghettified/core/coding/stock_price_chart.py b/un-spaghettified/core/coding/stock_price_chart.py new file mode 100644 index 00000000..b6a0239b --- /dev/null +++ b/un-spaghettified/core/coding/stock_price_chart.py @@ -0,0 +1,18 @@ +# filename: stock_price_chart.py +import yfinance as yf +import matplotlib.pyplot as plt + +# Define the ticker symbols for NVDA and TESLA +tickers = ['NVDA', 'TSLA'] + +# Fetch the historical stock price data for YTD +data = yf.download(tickers, start='2021-01-01', end='2021-12-31') + +# Extract the 'Close' price column for each ticker +close_prices = data['Close'] + +# Plot the stock price change YTD +close_prices.plot(title='Stock Price Change YTD', ylabel='Price (USD)') + +# Display the chart +plt.show() \ No newline at end of file diff --git a/un-spaghettified/core/stock_price_chart.py b/un-spaghettified/core/stock_price_chart.py new file mode 100644 index 00000000..6c29f071 --- /dev/null +++ b/un-spaghettified/core/stock_price_chart.py @@ -0,0 +1,19 @@ + +# filename: stock_price_chart.py +import yfinance as yf +import matplotlib.pyplot as plt + +# Define the ticker symbols for NVDA and TESLA +tickers = ['NVDA', 'TSLA'] + +# Fetch the historical stock price data for YTD +data = yf.download(tickers, start='2021-01-01', end='2021-12-31') + +# Extract the 'Close' price column for each ticker +close_prices = data['Close'] + +# Plot the stock price change YTD +close_prices.plot(title='Stock Price Change YTD', ylabel='Price (USD)') + +# Display the chart +plt.show() \ No newline at end of file diff --git a/un-spaghettified/core/test.py b/un-spaghettified/core/test.py new file mode 100644 index 00000000..ae398610 --- /dev/null +++ b/un-spaghettified/core/test.py @@ -0,0 +1,38 @@ +import sys +from autogen import AssistantAgent, UserProxyAgent +from dotenv import load_dotenv +import os + +# Load the .env info +load_dotenv() +api_key = os.getenv('OPENAI_API_KEY') + +print(sys.path) +print("pyautogen imported successfully") + +config_list = [ + { + "model": "gpt-3.5-turbo", + "api_key": api_key + } + # Add more configurations if needed +] + +# Create AssistantAgent with the llm_config +assistant = AssistantAgent( + name="assistant", + llm_config={ + "seed": 42, + "config_list": config_list, + "temperature": 0, + } +) + +# Create a UserProxyAgent with configuration for code execution +user_proxy = UserProxyAgent( + name="user_proxy", + code_execution_config={"work_dir": "coding", "use_docker": False} # Set to True to run code in docker +) + +# Initiate a chat between the two agents to perform a task +user_proxy.initiate_chat(assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")