Skip to content

Commit d21685b

Browse files
author
jasonstrimpel
committed
Update with llama interface
1 parent 9e6ed48 commit d21685b

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

112_LlamaIndexFinancialStatement.ipynb

+25-25
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"metadata": {},
1616
"outputs": [],
1717
"source": [
18-
"from langchain_openai import ChatOpenAI"
18+
"from llama_index.llms.openai import OpenAI"
1919
]
2020
},
2121
{
@@ -84,17 +84,17 @@
8484
},
8585
{
8686
"cell_type": "code",
87-
"execution_count": 5,
87+
"execution_count": 6,
8888
"id": "30c58e66",
8989
"metadata": {},
9090
"outputs": [],
9191
"source": [
92-
"llm = ChatOpenAI(temperature=0, model_name=\"gpt-4o\", max_tokens=-1)"
92+
"llm = OpenAI(temperature=0, model_name=\"gpt-4o\")"
9393
]
9494
},
9595
{
9696
"cell_type": "code",
97-
"execution_count": 6,
97+
"execution_count": 7,
9898
"id": "d92fcf7f",
9999
"metadata": {},
100100
"outputs": [
@@ -137,7 +137,7 @@
137137
},
138138
{
139139
"cell_type": "code",
140-
"execution_count": 7,
140+
"execution_count": 8,
141141
"id": "22eff79d",
142142
"metadata": {},
143143
"outputs": [],
@@ -147,7 +147,7 @@
147147
},
148148
{
149149
"cell_type": "code",
150-
"execution_count": 8,
150+
"execution_count": 9,
151151
"id": "4651c1a9",
152152
"metadata": {},
153153
"outputs": [],
@@ -181,15 +181,15 @@
181181
},
182182
{
183183
"cell_type": "code",
184-
"execution_count": 9,
184+
"execution_count": 10,
185185
"id": "a0ff7054",
186186
"metadata": {},
187187
"outputs": [
188188
{
189189
"name": "stdout",
190190
"output_type": "stream",
191191
"text": [
192-
"The revenue of NVIDIA in the last period reported was $30,040 million for the three months ended Jul 28, 2024, as shown on page 3 of the document.\n"
192+
"The revenue of NVIDIA in the last period reported was $30,040 million for the three months ended July 28, 2024, as shown on page 3 of the document.\n"
193193
]
194194
}
195195
],
@@ -200,7 +200,7 @@
200200
},
201201
{
202202
"cell_type": "code",
203-
"execution_count": 10,
203+
"execution_count": 11,
204204
"id": "4c70926e",
205205
"metadata": {},
206206
"outputs": [
@@ -243,7 +243,7 @@
243243
},
244244
{
245245
"cell_type": "code",
246-
"execution_count": 11,
246+
"execution_count": 12,
247247
"id": "c880739e",
248248
"metadata": {},
249249
"outputs": [],
@@ -258,7 +258,7 @@
258258
},
259259
{
260260
"cell_type": "code",
261-
"execution_count": 12,
261+
"execution_count": 13,
262262
"id": "99229480",
263263
"metadata": {},
264264
"outputs": [],
@@ -292,7 +292,7 @@
292292
},
293293
{
294294
"cell_type": "code",
295-
"execution_count": 13,
295+
"execution_count": 14,
296296
"id": "194b22a8",
297297
"metadata": {},
298298
"outputs": [
@@ -301,11 +301,11 @@
301301
"output_type": "stream",
302302
"text": [
303303
"Generated 2 sub questions.\n",
304-
"\u001b[1;3;38;2;237;90;200m[nvda_10k] Q: What were the fastest growing customer segments in terms of revenue?\n",
304+
"\u001b[1;3;38;2;237;90;200m[nvda_10k] Q: What are the customer segments that grew the fastest in terms of revenue in 2024?\n",
305305
"\u001b[0m\u001b[1;3;38;2;90;149;237m[nvda_10k] Q: Which geographies showed the highest growth in revenue for NVDA in 2024?\n",
306-
"\u001b[0m\u001b[1;3;38;2;237;90;200m[nvda_10k] A: Automotive revenue was the fastest growing customer segment in terms of revenue, with a 37% increase from a year ago and a 5% increase sequentially.\n",
307-
"\u001b[0m\u001b[1;3;38;2;90;149;237m[nvda_10k] A: Data Center revenue for NVDA showed the highest growth in revenue in 2024.\n",
308-
"\u001b[0mAutomotive revenue experienced the fastest growth among customer segments, with a 37% increase from a year ago and a 5% increase sequentially. On the other hand, Data Center revenue for NVDA exhibited the highest growth in revenue in 2024.\n"
306+
"\u001b[0m\u001b[1;3;38;2;237;90;200m[nvda_10k] A: Networking revenue grew the fastest in terms of revenue in 2024.\n",
307+
"\u001b[0m\u001b[1;3;38;2;90;149;237m[nvda_10k] A: Data Center revenue showed the highest growth in revenue for NVDA in 2024.\n",
308+
"\u001b[0mNetworking revenue grew the fastest in terms of revenue in 2024, while Data Center revenue showed the highest growth in revenue for NVDA in the same year.\n"
309309
]
310310
}
311311
],
@@ -316,7 +316,7 @@
316316
},
317317
{
318318
"cell_type": "code",
319-
"execution_count": 14,
319+
"execution_count": 15,
320320
"id": "56bc8833",
321321
"metadata": {},
322322
"outputs": [
@@ -326,8 +326,8 @@
326326
"text": [
327327
"Generated 1 sub questions.\n",
328328
"\u001b[1;3;38;2;237;90;200m[nvda_10k] Q: What risks are highlighted in NVDA's 10-K document for the year 2024?\n",
329-
"\u001b[0m\u001b[1;3;38;2;237;90;200m[nvda_10k] A: The risks highlighted in NVDA's 10-K document for the year 2024 include long manufacturing lead times, uncertain supply and component availability, inaccuracies in estimating customer demand, mismatches between supply and demand, product shortages, excess inventory, variability in supply deliveries and production, challenges in securing sufficient commitments for capacity, impeded sales due to unavailable components, extended lead times, increased product costs, and the impact of various factors on estimating customer demand and revenue timing and volume.\n",
330-
"\u001b[0mThe risks highlighted in the document for NVDA's business include long manufacturing lead times, uncertain supply and component availability, inaccuracies in estimating customer demand, mismatches between supply and demand, product shortages, excess inventory, variability in supply deliveries and production, challenges in securing sufficient commitments for capacity, impeded sales due to unavailable components, extended lead times, increased product costs, and the impact of various factors on estimating customer demand and revenue timing and volume.\n"
329+
"\u001b[0m\u001b[1;3;38;2;237;90;200m[nvda_10k] A: Long manufacturing lead times, uncertain supply and component availability, failure to estimate customer demand accurately, mismatches between supply and demand, product shortages, excess inventory, and the impact of changes in product development cycles, competing technologies, business and economic conditions, government lockdowns, technology advancements, and other factors on revenue and supply levels.\n",
330+
"\u001b[0mThe risks highlighted in the document for NVIDIA's business include long manufacturing lead times, uncertain supply and component availability, failure to estimate customer demand accurately, mismatches between supply and demand, product shortages, excess inventory, and the impact of changes in product development cycles, competing technologies, business and economic conditions, government lockdowns, technology advancements, and other factors on revenue and supply levels.\n"
331331
]
332332
}
333333
],
@@ -338,7 +338,7 @@
338338
},
339339
{
340340
"cell_type": "code",
341-
"execution_count": 15,
341+
"execution_count": 16,
342342
"id": "2c0c2b4e",
343343
"metadata": {},
344344
"outputs": [
@@ -347,11 +347,11 @@
347347
"output_type": "stream",
348348
"text": [
349349
"Generated 2 sub questions.\n",
350-
"\u001b[1;3;38;2;237;90;200m[nvda_10k] Q: What risks are highlighted in the NVDA 10K document?\n",
351-
"\u001b[0m\u001b[1;3;38;2;90;149;237m[nvda_10k] Q: How does NVDA assess the impact of the highlighted risks on financial performance?\n",
352-
"\u001b[0m\u001b[1;3;38;2;237;90;200m[nvda_10k] A: The risks highlighted in the NVDA 10K document include risks related to manufacturing lead times, uncertain supply and component availability, inaccurately estimating customer demand, mismatches between supply and demand, product shortages, excess inventory, long-term supply agreements, capacity commitments, extended lead times, increased product costs, inability to secure sufficient capacity, and factors causing underestimation or overestimation of customer demand.\n",
353-
"\u001b[0m\u001b[1;3;38;2;90;149;237m[nvda_10k] A: NVDA assesses the impact of the highlighted risks on financial performance by considering various factors such as inflation, interest rate changes, capital market volatility, global supply chain constraints, global economic and geopolitical developments, and the impact of geopolitical conflicts on operations. Additionally, NVDA evaluates the potential impact of macroeconomic factors on demand for its products, supply chain and manufacturing costs, employee wages, costs for capital equipment, and the value of investments. NVDA also monitors the impact of global sustainability regulations, compliance costs, and climate-related business trends on its results of operations.\n",
354-
"\u001b[0mNVDIA sees the risks highlighted in the document impacting financial performance through considerations of various factors such as inflation, interest rate changes, capital market volatility, global supply chain constraints, global economic and geopolitical developments, and the impact of geopolitical conflicts on operations. Additionally, NVDIA evaluates the potential impact of macroeconomic factors on demand for its products, supply chain and manufacturing costs, employee wages, costs for capital equipment, and the value of investments. NVDIA also monitors the impact of global sustainability regulations, compliance costs, and climate-related business trends on its results of operations.\n"
350+
"\u001b[1;3;38;2;237;90;200m[nvda_10k] Q: What are the key risks highlighted in the NVDA 10K document?\n",
351+
"\u001b[0m\u001b[1;3;38;2;90;149;237m[nvda_10k] Q: How does NVDA plan to mitigate the risks mentioned in the 10K document?\n",
352+
"\u001b[0m\u001b[1;3;38;2;237;90;200m[nvda_10k] A: The key risks highlighted in the NVDA 10K document include potential challenges related to manufacturing lead times, uncertain supply and component availability, inaccurate estimation of customer demand leading to mismatches between supply and demand, product shortages or excess inventory, inability to secure sufficient commitments for capacity, impeded ability to sell products if necessary components are unavailable, extended lead times on orders, increased product costs due to securing future supply, and the impact of various factors on underestimating or overestimating customer demand.\n",
353+
"\u001b[0m\u001b[1;3;38;2;90;149;237m[nvda_10k] A: NVDA plans to mitigate the risks mentioned in the 10K document by increasing supply and capacity purchases with existing and new suppliers to support their demand projections. Additionally, they aim to accurately estimate customer demand to avoid mismatches between supply and demand, which have previously harmed their financial results. They may enter into long-term supply agreements and capacity commitments to address their business needs and secure sufficient commitments for capacity. Furthermore, they acknowledge the potential impact of factors such as changes in product development cycles, competitor actions, economic conditions, and technology advancements on their revenue and strive to manage these uncertainties effectively.\n",
354+
"\u001b[0mNVDIA sees the risks highlighted in the document impacting financial performance through potential challenges related to manufacturing lead times, uncertain supply and component availability, inaccurate estimation of customer demand leading to mismatches between supply and demand, product shortages or excess inventory, inability to secure sufficient commitments for capacity, impeded ability to sell products if necessary components are unavailable, extended lead times on orders, increased product costs due to securing future supply, and the impact of various factors on underestimating or overestimating customer demand. These risks could lead to financial implications such as decreased revenue, increased costs, reduced profitability, and potential negative effects on overall financial results.\n"
355355
]
356356
}
357357
],

0 commit comments

Comments
 (0)