Skip to content

Commit 96dafcc

Browse files
committed
Add an example agent for stock marker mini tracker.
1 parent 0859cdc commit 96dafcc

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

examples/agents/stock_market_mini_tracker.ipynb

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Stock Market Tracker - Minimal Agent Demo\n",
7+
"# Stock Market Tracker - Multi-step Agent in a single prompt\n",
88
"\n",
9-
"This notebook shows how **easy** it is to build an autonomous agent with aisuite + MCP tools.\n",
9+
"This notebook shows how **easy** it is to build a multi-step agent using a single prompt with aisuite + MCP tools.\n",
1010
"\n",
11-
"**What it does**: Fetches latest stock market data and creates an HTML dashboard - all autonomously!\n",
11+
"**What it does**: 1. Fetches latest stock market data, 2. Analyzes content and 3. Creates an HTML dashboard.\n",
1212
"\n",
13-
"**Requirements**: `ANTHROPIC_API_KEY` in your `.env` file"
13+
"**Requirements**: `OPENAI_API_KEY` in your `.env` file"
1414
]
1515
},
1616
{
@@ -56,7 +56,7 @@
5656
"cell_type": "markdown",
5757
"metadata": {},
5858
"source": [
59-
"## Craft instructions, and run Agent."
59+
"## Craft instructions"
6060
]
6161
},
6262
{
@@ -112,6 +112,13 @@
112112
"print(\"✓ Agent instructions defined\")"
113113
]
114114
},
115+
{
116+
"cell_type": "markdown",
117+
"metadata": {},
118+
"source": [
119+
"## Run Agent with MCP tools."
120+
]
121+
},
115122
{
116123
"cell_type": "code",
117124
"execution_count": 3,
@@ -126,13 +133,13 @@
126133
"✓ DASHBOARD CREATED!\n",
127134
"============================================================\n",
128135
"\n",
129-
"Summary:\n",
130-
"- File created: stock_dashboard.html with a professional responsive dashboard.\n",
131-
"- Number of stocks: 5\n",
132-
"- Top 3 gainers (by % change): \n",
133-
" 1) GLTO +248.49%\n",
134-
" 2) COGT +119.03%\n",
135-
" 3) NVTS +22.45%\n"
136+
"The stock market dashboard for November 11, 2025, has been successfully created and saved as 'stock_dashboard.html'. It displays the top 5 stock gainers with a professional layout. Here are the top 3 gainers:\n",
137+
"\n",
138+
"1. **Cogent Biosciences, Inc. (COGT)** - +119.03%\n",
139+
"2. **Navitas Semiconductor Corporation (NVTS)** - +22.45%\n",
140+
"3. **Opendoor Technologies Inc. (OPEN)** - +21.77%\n",
141+
"\n",
142+
"The dashboard includes modern typography, responsive design, and highlights positive percentage changes in green.\n"
136143
]
137144
}
138145
],
@@ -142,7 +149,7 @@
142149
"tools = fetch_mcp.get_callable_tools() + filesystem_mcp.get_callable_tools()\n",
143150
"\n",
144151
"response = client.chat.completions.create(\n",
145-
" model=\"openai:gpt-5\",\n",
152+
" model=\"openai:gpt-4o\",\n",
146153
" messages=[{\"role\": \"user\", \"content\": prompt}],\n",
147154
" tools=tools,\n",
148155
" max_turns=20\n",
@@ -181,7 +188,7 @@
181188
" "
182189
],
183190
"text/plain": [
184-
"<IPython.lib.display.IFrame at 0x10b617b60>"
191+
"<IPython.lib.display.IFrame at 0x114517b60>"
185192
]
186193
},
187194
"metadata": {},
@@ -232,17 +239,20 @@
232239
"\n",
233240
"## That's It!\n",
234241
"\n",
235-
"In just **~30 lines of code**, you built an autonomous agent that:\n",
242+
"In just **few lines of code**, you built an autonomous agent that:\n",
236243
"- ✅ Fetches live stock data from the web\n",
237244
"- ✅ Creates a beautiful HTML dashboard\n",
238245
"- ✅ Saves it to disk\n",
239-
"- ✅ All without manual tool execution!\n",
240246
"\n",
241247
"**Try it yourself**:\n",
242-
"- Modify the prompt to fetch different data\n",
243-
"- Change the output format (JSON, CSV, etc.)\n",
248+
"- Modify the prompt to fetch TOP losers and gainers.\n",
249+
"- Modify to fetch data across multiple days.\n",
250+
"- Modify to fetch headlines from any Finance News website to explain why stocks rose or fell. (NOTE: Many websites do not like automated calls - be mindful of their policies.)\n",
251+
"- Try asking Agent to plot a graph with the data in the HTML page.\n",
244252
"- Add more MCP tools (memory, search, etc.)\n",
245253
"\n",
254+
"Remember to **increase max_turns** to a higher number if you increase the complexity of the tasks.\n",
255+
"\n",
246256
"**Learn more**: Check out other notebooks in `examples/agents/`"
247257
]
248258
}

0 commit comments

Comments
 (0)