Skip to content

Commit

Permalink
Add 2_plot_stock_charts.py
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyoshika committed May 31, 2024
1 parent bd9f6d2 commit 31cffc2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions 2_plot_stock_charts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://github.com/microsoft/autogen/blob/main/test/twoagent.py

import os
from dotenv import load_dotenv
# For 'import autogen' to work, had to 'pip install packaging'
from autogen import AssistantAgent, UserProxyAgent

load_dotenv()

llm_config = {
'model': 'gpt-4o',
'api_key': os.getenv('OPENAI_API_KEY'),
'base_url': os.getenv('OPENAI_BASE_URL') if os.getenv('OPENAI_BASE_URL') else None,
}

assistant = AssistantAgent("assistant", llm_config=llm_config)

user_proxy = UserProxyAgent(
"user_proxy", code_execution_config={"work_dir": "coding", "use_docker": True}
)

user_proxy.initiate_chat(
assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")

0 comments on commit 31cffc2

Please sign in to comment.