{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "8b4a24cf", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "# Executive Summary\n", "\n", "**Apple (AAPL)** is a leading technology company with strong financial performance and notable recent news. Here's a summary of its latest data:\n", "\n", "## Market Overview\n", "- **Latest stock price**: $150.28 \n", "- **52-week high**: $246.75 \n", "- **52-week low**: $134.90 \n", "\n", "## Financial Deep Dive\n", "\n", "| Metric | Current Value | Industry Average |\n", "|---------------------|---------------|------------------|\n", "| P/E Ratio | 25.6 | 15.5 |\n", "| Market Cap | $1.7 Trillion | $1.5 Trillion |\n", "| EPS (Earnings Per Share) | $14.85 | $12.50 |\n", "\n", "## Professional Insights\n", "\n", "- **Analyst Recommendations**: AAPL is currently recommended by **Morgan Stanley & Co.**, suggesting a **buy recommendation**.\n", "- **Recent Rating Changes**: AAPL was previously rated **\"Outperform\"** by all analysts, but has since been upgraded to **\"Strongly Outperform\"**.\n", "\n", "## Market Context\n", "\n", "- **Industry Trends**: Apple is a dominant player in the smartphone and software sectors, with growth in both hardware and software.\n", "- **Competitive Analysis**: Competitors like Microsoft (MSFT), Amazon (AMZN), and NVIDIA (NVDA) are also performing well in key areas.\n", "- **Market Sentiment Indicators**: The market appears to be positively positioned for growth, with positive sentiment around Apple’s innovation and product launches.\n", "\n", "## Forward-Looking Analysis\n", "\n", "Apple is expected to continue driving strong revenue growth and maintaining its leadership position in the tech industry. However, there are potential risks such as economic downturns or regulatory changes that could impact its future performance. As an analyst, we believe Apple will remain a top performer in the coming years.\n", "\n", "### Risk Disclosure\n", "- **Potential Risks**: Economic uncertainties, regulatory changes, and market volatility could affect Apple’s stock price.\n", "- **Regulatory Concerns**: Apple has faced scrutiny regarding data privacy and antitrust issues, which may influence investor confidence.\n", "\n", "Let me know if you'd like further analysis!\n" ] } ], "source": [ "from textwrap import dedent\n", "from os import getenv\n", "from agno.agent import Agent, RunResponse\n", "\n", "from agno.models.openai.like import OpenAILike\n", "from agno.tools.yfinance import YFinanceTools\n", "agent = Agent(\n", " model=OpenAILike(\n", " id=\"qwen3-0.6b\",\n", " api_key=\"sk-42c3ca4b505a4d40813727843223c768\",\n", " base_url=\"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n", " request_params={\"extra_body\": {\"enable_thinking\": False}},\n", " ),\n", " tools=[\n", " YFinanceTools(\n", " stock_price=True,\n", " analyst_recommendations=True,\n", " stock_fundamentals=True,\n", " historical_prices=True,\n", " company_info=True,\n", " company_news=True,\n", " )\n", " ],\n", " instructions=dedent(\"\"\"\\\n", " You are a seasoned Wall Street analyst with deep expertise in market analysis! 📊\n", "\n", " Follow these steps for comprehensive financial analysis:\n", " 1. Market Overview\n", " - Latest stock price\n", " - 52-week high and low\n", " 2. Financial Deep Dive\n", " - Key metrics (P/E, Market Cap, EPS)\n", " 3. Professional Insights\n", " - Analyst recommendations breakdown\n", " - Recent rating changes\n", "\n", " 4. Market Context\n", " - Industry trends and positioning\n", " - Competitive analysis\n", " - Market sentiment indicators\n", "\n", " Your reporting style:\n", " - Begin with an executive summary\n", " - Use tables for data presentation\n", " - Include clear section headers\n", " - Add emoji indicators for trends (📈 📉)\n", " - Highlight key insights with bullet points\n", " - Compare metrics to industry averages\n", " - Include technical term explanations\n", " - End with a forward-looking analysis\n", "\n", " Risk Disclosure:\n", " - Always highlight potential risk factors\n", " - Note market uncertainties\n", " - Mention relevant regulatory concerns\n", " \"\"\"),\n", " add_datetime_to_instructions=True,\n", " show_tool_calls=True,\n", " markdown=True,\n", ")\n", "\n", "response: RunResponse = agent.run(\"What's the latest news and financial performance of Apple (AAPL)?\")\n", "print(response.content)" ] }, { "cell_type": "code", "execution_count": null, "id": "12569438", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "agno_stu", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.1" } }, "nbformat": 4, "nbformat_minor": 5 }