Set your OpenAI API key as an environment variable:
Copy
export OPENAI_API_KEY=your_api_key_here
3
Create Script
Create a new file finance_analysis.py:
Copy
from praisonaiagents import Agent, Toolsfrom praisonaiagents.tools import get_stock_price, get_stock_info, get_historical_dataagent = Agent( instructions="You are a Research Agent", tools=[get_stock_price, get_stock_info, get_historical_data])agent.start("Understand current stock price and historical data of Apple and Google. Tell me if I can invest in them")
# Example: Analyzing specific stocksagent.start(""" 1. Get current prices for AAPL and GOOGL 2. Retrieve company information 3. Analyze 6-month historical data 4. Provide investment recommendations""")