Full Year 2024 Diageo PLC Earnings Call - Pre-Recorded
Impacts with inflation and a cautious consumer environment persisting following the extraordinary growth through COVID-19, and the related waves of value chain disruption.
I believe these challenges are temporary and the consumer environment will recover over time Antioch Shiao. We're focused on what we can control, we've navigated volatility before and we will do it again and.
And we manage this business with a long term view, we will continue to invest in our fantastic portfolio of brands and diversified footprint to maintain our position as an industry leader in total beverage alcohol, which continues to be an attractive sector with a long runway for growth.
We're focused on driving operational excellence with our amazing brands to ensure the ico is resilient and well positioned to grow when the consumer environment recovers.
Today, I will share the details of our fiscal 'twenty for performance and the deliberate actions we are taking to improve our near term execution. There were five actions I want to highlight.
First we have met our commitment announced at our interim results to improve the inventory position and lag by the end of this fiscal.
In addition, we have validated the robustness of our systems across all markets and are confident that inventories are at appropriate levels for the current consumer environment and our other four regions.
Second we are strengthening our consumer insights by the end of this calendar year, we will have completed the rollout of our proprietary consumer choice framework across markets covering a significant portion of our net sales deepening our understanding of consumer motivations and occasions, we are realigning our marketing organization.
Into agile brand communities to quickly action against these insights to drive quality growth third.
We are redeploying our resources to the best growth opportunities through our market growth framework.
Fourth we have stepped up our route to market across several key markets, including our most significant transformation and at least a decade in our U S spirits organization and I will discuss this in detail later.
Finally, we delivered a record year of productivity savings from supply chain activities and marketing with more to come as we increasingly benefit from savings from our supply agility program.
We've taken these actions while continuing to invest in the business for the long term.
lobbing: Following my prepared remarks, lobbing, who will discuss our financial results in more detail I will then discuss our outlook for fiscal 'twenty five and address the medium term and will close by reminding you of our strategic priorities that I believe will drive sustainable quality growth.
lobbing: After three years of extraordinary topline growth growing at a 14.5% CAGR from fiscal 'twenty, one to fiscal 'twenty three group organic net sales declined 0.6% in fiscal 'twenty for.
Speaker Change: The main driver was materially weaker performance and lack our Latin America, and Caribbean region, which makes up 8% of D. Icos organic net sales.
Speaker Change: Organic net sales in our largest region North America or Nam also declined reflecting a cautious consumer environment compounded by the impact of lapping inventory replenishment in the prior year.
Speaker Change: Group organic volume declined by three 5% driven by lack Destocking Africa beer and Nam.
Speaker Change: Because many of these impacts for supply chain related these volume results do not reflect the underlying consumer dynamics, nor the runway that we see for future growth loving you will discuss this further.
Speaker Change: And despite the volatile operating environment across our regions throughout the year, we focused on operational excellence and delivered $700 million in productivity savings a record year of savings that drove gross margin improvement in the second half.
Speaker Change: Additionally, I am pleased that we delivered $2 $6 billion in free cash flow driven by strong working capital management, while we continue to invest in future growth.
Speaker Change: We increased our recommended full year dividend by 5%, which reflects our continued confidence in the long term potential of our business and our commitment to a progressive dividend policy.
Speaker Change: Moving onto market share, which is a critical metric in the current operating environment. You may recall that in the first half of fiscal 'twenty four we held or grew share in 30% of our net sales in measured markets. We drove a material improvement in market share in the second half, which demonstrates the underlying consumer strength of our brands.
Speaker Change: Much of this improvement in the second half of fiscal 'twenty four it was driven by our U S. TBA share performance more on this shortly.
Speaker Change: In fiscal 'twenty, four we held or grew share in over 75% of net sales value and measured markets.
Speaker Change: I'm also pleased we're holding or gaining share in almost all of our measured billion dollar brands globally. My goal is to continue to drive towards our 20, 36% TBA value share ambition.
Speaker Change: Moving onto regional performance I'll start with brief highlights of the three of our five regions that grew organic net sales in fiscal 'twenty for Europe, APAC and Africa before I cover lack in Nam in more detail.
Speaker Change: Europe delivered resilient performance growth and share gains in a challenging environment strong growth and Guinness was a key driver, which I will discuss in more detail later.
Speaker Change: In APAC growth was driven by Chinese white spirits and strong performance in India with continued premium as Asian Tequila also continues to gain momentum.
Speaker Change: And Africa beer was the key driver of performance. Despite a tough macroeconomic backdrop, we benefited from price increases and delivered double digit growth on Guinness and multi Guinness.
Speaker Change: I often talk about the strength of our diverse geographical footprint. These regional highlights demonstrate the advantage of a business with a broad footprint and it provides resilience, particularly in uncertain times.
Speaker Change: In Lac since I last updated you in January we have worked with our wholesaler and customer partners to manage inventories and ended fiscal 'twenty four with levels more appropriate for the current consumer environment. We've also implemented the five key action areas, we identified to expand inventory visibility and lack or.
Speaker Change: Full year organic net sales and lacked declined 21, 1% year over year in fiscal 'twenty four.
Speaker Change: In Brazil, our largest market in the region the category improved in the second half of the year compared to the first half and we gained market share inventory.
Speaker Change: Levels have dramatically reduced to more appropriate levels in Mexico, our second largest lack market. However, this market continues to face persistent challenges with highly competitive environment and consumer down trading in tequila and Scotch. Consequently, we've initiated a comprehensive review of this market to return to share growth and I will update you in due course.
Speaker Change: Going forward, we know the importance of staying vigilant and we continue to work diligently to keep improving our visibility into the distribution channels across lack with the aim to deliver better insights earlier and I believe we have the necessary processes data leadership incentives and sellout culture across the region.
Speaker Change: To more closely align future performance with consumer demand.
Speaker Change: Moving onto Nam as mentioned earlier in fiscal 'twenty, four we held U S share of TBA with improving consumption momentum and share gains in the second half of the fiscal year. However, this did not translate into shipment momentum.
Speaker Change: In the last year, we've discussed the challenging environment in the U S. As we navigated through the post COVID-19, normalization and we lap supply chain restocking at.
Speaker Change: At the end of fiscal 'twenty, four we will have largely completed that lap. However.
Speaker Change: However, consumers remain cautious with wallets under pressure and with higher interest rates retailers remain cautious as well.
Speaker Change: Over the past 12 months industry trends have been quite variable month to month and quarter to quarter. So I want to spend some time unpacking that for you. So let's start with consumer data in tracked channels using Nielsen NAPCO, which represents approximately 40% of purchases in the U S and you can see on the industry chart on the far left.
Speaker Change: As inflation has persisted throughout the year and consumer space 30 year high food basket prices you can see how that has impacted the industry, which continued to deteriorate in the second half of fiscal 'twenty four.
Speaker Change: On the left hand chart the Ping the Azure bars show, how we picked up momentum in the last six months. Despite this cautious consumer environment, leading to our share improvements.
Speaker Change: The chart on the right breaks down the icos full year performance across the three tier system and you can note several dynamics here.
Speaker Change: First while the icos consumer consumption growth in Nielsen naphtha data was soft our depletions and shipments were lower.
Speaker Change: <unk> Depletions have also lagged Nielsen NAPCO consumer purchases, particularly in the second half of the fiscal year. This was largely driven by retailer stock reductions, which we saw most prominently in west coast retail chains.
Speaker Change: This retailer inventory adjustment is likely driven by persistently higher interest rates and retailers not wanting to anticipate recovery in this cautious consumer environment.
Speaker Change: At the end of fiscal 'twenty for the difference in shipments and Depletions has narrowed compared to fiscal 'twenty three.
Speaker Change: The difference in fiscal 'twenty, four was driven primarily by the impact of lapping Tequila restocking and we expect these value chain dynamics to be temporary and while we foresee this environment persisting into fiscal 'twenty five to the extent that interest rates decline and the consumer environment recovers, we would expect shipments.
Speaker Change: To more closely align to consumption.
Speaker Change: Importantly, as we manage this business for the long term the underlying consumer trends remain the most critical movement to watch.
Speaker Change: Going forward our focus in Nam remains on controlling what we can control operational excellence against our priorities and gaining quality sustainable market share in the second half of the fiscal we picked up momentum with the consumer in fact, we finished the year, winning or maintaining U S TBA market share and brand.
Speaker Change: Covering 90% of our U S net sales.
Speaker Change: A few of our consumer highlights.
Speaker Change: In whiskey, our crown Royal share performance improved significantly in the second half of fiscal 'twenty four finishing the year holding share not only of TBA, but also of U S spirits, driven by the launch of Crown Royal Blackberry.
Speaker Change: Early read show one in five of those purchasing Blackberry are new to whiskey consistent with our track record of sustainable expansion and recruitment into the crown Royal trademark.
Speaker Change: In Tequila, our portfolio again gained U S spirits share driven by Don Julio which increased momentum in the second half growing 15 times faster than the total U S spirits industry. The growth was led by Don Julio grip of Saddam we expanded our participation in the convenience occasion this year through strong innovation with our cocktail collection.
Speaker Change: <unk> outperforming the category, gaining 32 basis points, and finally, notably Guinness outperformed the industry and was the fastest growing imported beer in the U S. On trade in the last 12 months bolstered by the newly launched the Lovely day campaign with longtime brand fan Jason Moa.
Speaker Change: But look while we made good progress in driving share improvement. We also know we have more to do and opportunity left to fully leverage the power of our amazing diversified portfolio costs Amigos. As one example, after four years of extraordinary growth with a CAGR of over 70% from fiscal 19 to fiscal 'twenty three.
Speaker Change: [noise] Amigos organic net sales declined 22% in fiscal 'twenty for this decline was partly caused by the impact of lapping restocking following supply shortages as depletions were down half of that at minus 9%.
Speaker Change: In fiscal 'twenty five we are fully integrating costs amigos into our dedicated transformed distribution network costs. Amigos has now reached a scale where it will benefit from the full power of <unk> resources, and we can take our tequila portfolio category leadership to the next level.
Speaker Change: This is important as the brand remains resilient in the on premise where brands in this industry get built on premise momentum continues with volume up 5% more feet on the street will no doubt help this effort.
Speaker Change: Speaking of our U S distributor network and our route to market as we see changes in growth opportunities. We are optimizing our route to market across our footprint.
Speaker Change: As we discussed briefly at our capital markets event I'm excited to share than in the U S, where we have a track record of pioneering in shaping the route to market, we are making significant changes.
Speaker Change: Jointly with our two largest distributors in the U S. We are investing to better align our teams and capabilities against what we believe will be the best growth opportunities for the next decade by category and brand down to the ZIP code level, specifically we are.
Speaker Change: Leveraging our proprietary outlet and ZIP code level data to identify the highest future growth potential communities and channels for our biggest growth categories, bringing us closer to our consumers and customers at the local level.
Speaker Change: This includes scaling our people and locations to go after categories with high growth potential such as whiskey and tequila, while increasing focus on our core brands.
Speaker Change: We're also building a new academy of beverage leadership to cultivate the next generation of industry expertise within our and our distributor partners teams.
Speaker Change: Finally, we have transformed our internal commercial organization to deliver unmatched execution, and activations and stores bars stadiums and event spaces.
Speaker Change: I am confident this transformation strengthens our position as the largest U S spirits supplier and leader across key categories.
Speaker Change: And we are extending this commercial focus to the rest of the ico to a few highlights last week, we announced that we will be bringing in house the distribution of all our brands currently distributed by the joint venture Moet Hennessy <unk> in France. This follows our previous update in March 2024, where we outlined our fee.
Speaker Change: <unk> approach to transforming our distribution model in France by creating our own end market company.
Speaker Change: We are also expanding our organizational structure and Dubai to solidify our leadership in the premium spirits market in Middle East North Africa.
Speaker Change: We have created a new asset light model for the Guinness route to market in Nigeria by partnering with a local distribution specialist. This model works alongside our new West Africa spirits focused organization.
Speaker Change: Moving onto our largest categories performance, starting with the largest scotch while our Scotch organic net sales performance was heavily impacted by lack of inventory reductions momentum with consumers continued in fiscal 'twenty four.
Speaker Change: We gained category share of Scotch in nine out of 10 of our largest measured Scotch markets, including the U S. An improvement from the seven out of 10 in the first half of the fiscal.
Speaker Change: Within the Scotch category, we are seeing consumers being somewhat more choice full but still staying within international aspirational brand for example in China Johnnie Walker in the last six months has seen better performance in Black label XR 15 in 'twenty one than in Blue label in India, Our Scotch portfolio provides consumers.
Speaker Change: Abreast of price ladder offerings as they continue to premium is from a lower base Johnny.
Speaker Change: Johnnie Walker led our share growth driving over half of our Scotch organic net sales. This iconic brand had a proven growth model that brings together luxury innovation amazing quality liquid and a clear mantra to keep walking that is executed at scale around the world and it's working Johnnie Walker continues to be the new.
Speaker Change: Number one international spirits brand in value in the calendar year 'twenty twenty-three as measured by IW S. R.
Speaker Change: It recently won a prestigious Grand Prix award at the Cannes Lions Festival for our campaign in Brazil.
Speaker Change: And in the on trade. It is now the top trending top selling Scotch and the worlds top 100 bars.
Speaker Change: Our focus for fiscal 'twenty five is to continue to build on Johnnie Walker success and share gains while building on our opportunity in single malt, where we are underdeveloped led by the Singleton is our number one priority malt brand.
Speaker Change: In Tequila the global rollout has continued at pace through fiscal 'twenty four we drove almost 12% organic net sales growth in markets outside Nam and lack leading to substantial market share gains across Europe, India Africa and global travel.
Don Julio was the number one selling tequila at London Heathrow throughout most of the last 12 months and it's now in nearly 60 countries.
Scott's Amigo: Scott's Amigo says in 30 countries with double digit sales growth in Europe.
Scott's Amigo: Increased investment to these brands to support the global rollout is amplified by our excellent marketing and brand building at scale for example, Don Julio at the Oscars and Super Bowl, which if you haven't already seen the videos I highly recommend I also continue to be excited about the ongoing potential for tequila in the U S and across the rest of our.
Scott's Amigo: [noise] footprint, because tequila remains the fastest growing scale spirits category.
Scott's Amigo: And the Ico continues to maintain its global tequila leadership by value.
Speaker Change: Genis delivered another year of very strong performance in fiscal 'twenty four.
Speaker Change: Plus 15% organic net sales growth a testament to its continuing broad appeal.
Speaker Change: We held or grew share in our top three markets for Dennis you asked Great Britain and Ireland.
Speaker Change: And the momentum that we have with Guinness continues to recruit and expand our consumer base.
Speaker Change: In Great Britain consumption, among women rose by 27% from fiscal 'twenty two to fiscal 'twenty three.
Speaker Change: One significant way, we recruited Morgan as consumers in Great Britain was tapping into consumer passion for the brand inviting them to partner with us to co create content and shape the brand through our community first marketing model you can see an example of this in the social media on the slide.
Speaker Change: Looking ahead, we are expanding Guinness further through our global football partnership with the Premier League, we have a proven model for activating at scale with Guinness in sports through our successful six nations rugby relationship and see a tremendous opportunity worldwide.
Speaker Change: We've also recently made significant commitments to ensure future supply are 100 million Euro investment to Decarbonize, Our historic St. James escaped site will accelerate progress toward our net zero carbon goals and transform energy and water consumption with the aim of making the site one of the most efficient brewery.
Speaker Change: He's in the world by 2030.
Speaker Change: In addition, Genesee rosy ROE doubled and net sales in fiscal 'twenty four in Europe, with GB and Ireland accounting for around 70% of Genesee Rosy row global sales we.
Speaker Change: We are investing to increase our capacity to supply Genesee Rosy wrote in response to the consumer trends of moderation and duality consumers, who want to drink less and consumers who want to drink alcohol on some occasions, but choose not to on others.
Speaker Change: In fiscal 'twenty, four I set up a review of our ESG strategy and as a result, we have simplified and prioritize the goals that form our spirit of progress plan.
Speaker Change: This is allowed us to prioritize the areas that are most material to the business, including reducing the harmful use of alcohol combating water stress and the impact of climate change.
This means we will be accelerating our work advocating for responsible alcohol consumption and water replenishment activities in the communities in which we operate.
Speaker Change: These are not only the right things to do for our people consumers and communities, but also critical for our business.
Speaker Change: With this simplified and prioritized focus we are partnering with governments and institutions and key geographies on our de Carbonization journey and have secured significant direct government funding to progress. This in the U S. For example, the department of energy selected the Ico for a grant to support the installation of heat batteries and.
Speaker Change: Solar energy generation at two of our sites. The goal is to build a model that can be replicated across our supply operations in the U S and make our business more efficient resilient and sustainable for the future I'll now hand over to Lavina, who will go over financials in more detail before I return to discuss our outlook.
Lavina: Thank you Deborah and good morning, everyone in fiscal 'twenty four organic net sales were down 0.6% with positive price mix performance, mostly mitigating a decline in volume.
Excluding lack the business grew organic net sales by 1.8%.
Lavina: Organic operating margin declined by 130 basis points, primarily driven by luck.
Speaker Change: Excluding black organic operating margin was down 56 basis points, driven mostly by investments in digital capabilities and as Deborah mentioned in further strengthening our route to market capabilities, primarily in the U S.
Speaker Change: We generated free cash flow of $2.6 billion, which was set at $400 million more than a year ago.
Speaker Change: Strong working capital management, and lower tax payments more than offset the combined impact of the decline in operating profit higher interest payments and increased investment in capex.
Speaker Change: Pre exceptional earnings per share declined mainly due to a lower operating profit and higher finance charges and exceptional items.
Speaker Change: This was partially offset by lower tax and the impact of share buybacks.
Speaker Change: We believe our growth algorithm continues to support sustainable long term growth our focus continues to be on driving growth through winning quality market share.
Speaker Change: We continue to premium is a portfolio and benefit from improved price mix and drive productivity all of which enables us to continue to invest smartly back into the business.
Speaker Change: Price mix contributed 2.9 percentage points to topline growth.
Speaker Change: Price contribution to organic net sales growth was in the low single digits.
Speaker Change: Organic volume was down three and half percent driven primarily by more than a 15% decline of volumes and block.
Speaker Change: More on that shortly we accelerated productivity initiatives across cost of goods marketing and overheads in fiscal 'twenty four.
Speaker Change: This enabled us to unlock almost $700 million of productivity cost savings and the physical and comfortably exceed our three year, one and a half billion dollar productivity savings target.
Speaker Change: Marketing productivity and smart investment choices allowed us to invest A&P on key growth opportunities and hold out overall E&P investment levels flat for the year.
Speaker Change: In line with the market growth framework, we increased A&P investment and Guinness across all regions Tequila as a part of a global rollout added North America, and Chinese white spirits in India and on Johnnie Walker in most regions.
Now to look further that volume.
Speaker Change: Our volume declined by $8 3 million equivalent units in fiscal 'twenty for the.
Speaker Change: The decline was driven by specific challenges and lack raw Smackdown in Africa, with otherwise stable volume and dressed of wood.
Speaker Change: Almost half of the volume decrease is related to the actions taken to normalize inventory levels more appropriate for the consumer environment in Lac <unk>.
Speaker Change: In North America volume declined by $2 3 million equaling to units.
Speaker Change: The volume decline was mainly driven by the cautious consumer environment in the U S.
Speaker Change: With the rest from retailer Destocking and lapping the supply chain normalization in the prior year.
Speaker Change: These headwinds more than offset the gains from improving market share performance over recent months.
Speaker Change: And as you can see price mix has returned to pre COVID-19 levels.
Speaker Change: In Africa in light of significant devaluation, we protected margins with strategic price increases.
Speaker Change: The volume decline here was the result of these pricing actions.
Speaker Change: In Europe, just over 75% of the volume decline was due to the lapping of final sale of inventories in Russia.
Speaker Change: Excluding this Europe volume was marginally down versus last year due to softness in spirits.
Speaker Change: APAC volume grew with strong growth in India, and Chinese white spirits, partially offset by South East Asia and Australia.
Speaker Change: All of this gives us confidence that volume will recover when the consumer environment improves.
Shockley: I'll go into more details on the drivers of price mix Shockley.
Speaker Change: And now looking at our results at a category level or.
Speaker Change: Our beer business delivered 14% organic net sales growth with 5% volume growth.
Speaker Change: Our organic net sales growth was primarily driven by continued momentum in Guinness, which grew 15% and strong double digit growth in Malta and Senator in Africa.
Chinese white spirits organic net sales grew 27% lapping a 14% decline due to COVID-19 restrictions in the prior year.
Speaker Change: Other whisky delivered strong organic net sales growth fueled by bullet like Dallas number one raw challenge and the successful launch of Buchanan Pineapple and North America.
Speaker Change: Our Scotch Tequila performance was significantly impacted by the weak performance in Black Scott organic net sales growth was also negatively impacted by North America and the lapping of the final sale of inventories in Russia in fiscal 'twenty three.
Speaker Change: <unk> grew 11% in India with strong growth of black and White and Johnnie Walker.
Speaker Change: Tequila organic net sales were down 7% driven by lack and the lapping of inventory that punishment in North America, partially offset by the benefit from the global rollout of the category.
Speaker Change: We are confident that premium amortization continues to be a tailwind for this but it's category. Although this may not be immediately operate from dashes numbers I saw super premium plus price tiers showed weaker performance in fiscal 'twenty for.
Speaker Change: I'll touch on this shortly.
The breadth of price points across our portfolio provides resilience and the ability to capture consumer demand. Despite these economic pressures.
Speaker Change: With the exception of Super premium plus each of all price tiers grew organic net sales in fiscal 'twenty for the.
Speaker Change: The value tier salt, particularly high growth driven by the strong performance of beer in Africa, and other whisky in India.
Speaker Change: The premium tier growth was impacted by lack excluding lack this tier grew 3.7% we can see that the decline in Super premium plus was also driven predominantly by Lockheed by not better than that decline in shipments reflects the impact of lapping the replenishment of U S spirits adventurer.
Speaker Change: Levels in fiscal 'twenty three.
Speaker Change: However, when we look at the consumer purchasing data as shown on the right. We can see that consumption of Super premium spirits is ahead of the azure shipments in the U S.
Speaker Change: Nielsen and NAPCO data shows that more than 100% of course, but it's category growth in the industry came from Super premium plus pivots in the fiscal.
Speaker Change: In rest of World are Super premium plus organic net sales growth was 2.9% reinforcing the continuing premium amortization in other markets.
Speaker Change: We continued to strengthen our revenue growth management capabilities, which are key in driving sustainable growth across volume price and mix.
Speaker Change: We made surgical small price increases supported by choice fully E&P investments across brands.
Speaker Change: Let me share two examples of this.
Speaker Change: In Great Britain, we increased our marketing investment for Guinness by 14% smartly manage pricing corridors and drove volume growth of 18%.
Speaker Change: In Southern Europe, Johnnie Walker volume increased by 5%, whilst organic net sales grew by 7%.
Speaker Change: Importantly, each of these examples we drove our G M. While also gaining share for these brands.
Speaker Change: With a culture of everyday efficiency, we have delivered strong productivity benefits year after year.
Speaker Change: Fiscal 'twenty four was the third consecutive year, when productivity and price combined offset the absolute impact of cost of goods inflation.
Speaker Change: In fiscal 'twenty, four we delivered productivity savings of $695 million across cost of goods marketing and overhead spend buckets.
Speaker Change: The productivity on cost of goods was across the end to end supply chain.
Speaker Change: The renegotiated contracts on key materials, such as glass labels and grain neutral spirits.
Speaker Change: And drove savings in logistics by renegotiating key ocean freight contracts.
Speaker Change: Across our manufacturing sites, we reduced waste and drove savings via labor optimization and automation. In addition, we started to see the benefits from our five year supply chain agility program announced at the end of fiscal 'twenty two.
Speaker Change: Marketing and overheads also drove a material contribution to productivity.
Speaker Change: Over the three year period of fiscal 'twenty two to fiscal 'twenty, four we delivered $1 $7 billion of productivity savings exceeding our target of one $5 billion.
Speaker Change: Looking ahead, we have committed to significantly step up our productivity target to $2 billion over the next three years fiscal 'twenty five through fiscal 'twenty seven.
Speaker Change: This will be enabled by the acceleration in annual savings across Cogs, marketing and overheads and from a supply chain agility program.
Speaker Change: Organic operating margin declined year on year by 130 basis points predominantly driven by luck.
Speaker Change: Operating margin declined significantly driven by negative mix increased trade investment and lower operating leverage.
Speaker Change: Excluding black operating margin was down by 56 basis points, reflecting continued investment in the business through overheads and E&P, partially offset by positive gross margin.
Speaker Change: Gross margin was up 17 basis points with benefits from productivity and price offsetting the impact of cost of goods inflation.
Speaker Change: Cost of goods inflation moderated from the double digit inflation, we saw in fiscal 'twenty, three but persisted in the high single digits for fiscal 'twenty four.
Speaker Change: This was a positive contributor to margins, but significantly less than in prior years.
Speaker Change: Recollect, we drove high single digit price increases in fiscal 'twenty three.
Speaker Change: In fiscal 'twenty four price contribution to net sales was in the low single digits.
Speaker Change: Our robust gross margin performance was mostly driven by supply productivity.
Speaker Change: As I indicated in our interim results at N P. The investment rate moderated as we lapped the prior year's increase and elevated marketing spend efficiencies, especially in the U S through the second half.
Speaker Change: We use a disciplined approach to deploy A&P investment to target opportunities for long term sustainable growth and strong Ottawa.
Speaker Change: Through fiscal 'twenty, four we focused investments on tequila, both in the U S and globally.
Speaker Change: I don't get it.
Speaker Change: Chinese white spirits and India.
Speaker Change: We continue to be disciplined in our approach to managing overheads.
Speaker Change: Even in a tough year, we are committed to invest for long term sustainable growth.
Speaker Change: In fiscal 'twenty for our investments have included investing in our strategic capabilities, including digital and strengthening our route to market primarily in the U S.
Speaker Change: Basic earnings per share before exceptional items declined eight 6% from $196 five to 179 six cents.
Speaker Change: I'm really driven by weaker operating profit performance compared to fiscal 'twenty, three partially offset by a lower tax charge.
Speaker Change: Interest charges also negatively impacted EPS.
Speaker Change: Got it higher interest rates impact our overall effective interest rate in two ways.
Speaker Change: First they directly impact our floating debt portfolio.
Speaker Change: Interest rates on new debt issuances are higher relative to the maturing debt they replace which was issued at lower historical rates.
Speaker Change: Free cash flow increased despite lower operating profits and higher interest payments.
Speaker Change: This growth was primarily driven by our strong working capital management almost entirely driven by inventory reductions.
Speaker Change: In recent years, we increased inventory by over 20% to navigate COVID-19 related supply disruptions.
Speaker Change: Through fiscal 'twenty four we actively reduced this back to fiscal 19 levels.
Speaker Change: That improvement was enabled by recently implemented data analytic solutions and improved stock management processes.
Speaker Change: We also benefited from lapping one off tax payments made in fiscal 'twenty three.
And remember we continued to invest in maturing stock and capex to support future business growth.
Capex spend increased in line with our long term investment strategy.
Speaker Change: And in line with guidance for the year.
Speaker Change: Moving on to foreign exchange.
Speaker Change: The impacts of foreign exchange movements was slightly negative on operating profit and significantly more adverse on net sales.
Speaker Change: Translation exchange negatively impacted both net sales and operating profit.
Speaker Change: The exchange loss was driven by emerging market currencies, mainly the Nigerian neither the Turkish leader and the Kenyan Chile, partially offset by gains on the British pound and the euro.
Speaker Change: The transaction benefit was mostly due to favorable hedge rates on the British pound and the Mexican peso most.
Speaker Change: Mostly offset by the Nigerian naira.
Speaker Change: We hedge our transactional foreign exchange on a rolling basis for our major currency exposures.
Speaker Change: This strategy results in foreign exchange rates that reflect the average of our hedging positions built overtime in our interim results. We shared a view on the potential full year foreign exchange impact for fiscal 'twenty four based on hedge rates and other exposures as you mean the spot rates on 30 <unk> December 2023.
Speaker Change: Range rate changes of the Nigerian neither the Turkish leader and the Ghanaian CD drove the difference from our expectations and not interims results to the fiscal year close.
Speaker Change: We completed the fiscal year with a leverage ratio of three times in line with our target range of two and half to three times.
Speaker Change: Selecting higher debt lower year on year profit and strong working capital management.
Speaker Change: Our net finance charges increased by $173 million year on year, reflecting the higher interest rate environment.
Speaker Change: Our effective interest rate at four 3% is in line with the guidance we shared in January looking.
Speaker Change: Looking ahead to fiscal 'twenty five I expect our effective interest rate to be broadly flat year on year, given current market conditions.
Speaker Change: We remain committed to our target leverage range.
Speaker Change: And I'm conscious that we have reported our leverage ratio at the top of the range.
Speaker Change: We will make the right decisions to support the long term growth of the business.
Speaker Change: Turning to our long standing track record of maintaining a disciplined approach to capital allocation and our target leverage range.
Speaker Change: So our consistent and disciplined approach to capital allocation is unchanged I just talked about how we manage our balance sheet guided by our leverage ratio policy and.
Speaker Change: And we will always make decisions to support the long term growth of the business.
Speaker Change: Our first priority is to invest in sustainable organic growth through capex marketing spend overhead supporting strategic initiatives and investment in maturing stock.
Speaker Change: Next we have a progressive dividend policy and we have increased our dividend for 25 years.
Speaker Change: Today, we announced a recommended final dividend of 62.98 cents per share.
Speaker Change: This is a 5% increase on a final dividend in fiscal 'twenty three recast to U S dollars.
Speaker Change: Our dividend cover at one seven times is slightly below the lower end of our target range of one eight to 2.2 times, but.
Speaker Change: But our dividend payment reflects the confidence we have in our business.
Speaker Change: Finally, when we have excess cash and the main metric that guides us here is the leverage ratio, we will return it to shareholders as you have seen us do consistently over the past years.
Speaker Change: Our disciplined and strategic portfolio management will continue to be an integral part of our capital allocation strategy.
Speaker Change: In the past two years, we have acquired fast growing brands, such as Dawn Papa ROM Balchunas distilling and Mr. Black and acquired the full ownership interest in day, one and the repatriation of Gordon's license in South Africa.
Speaker Change: Importantly, we have been disciplined and moved at pace to dispose of brands that did not fit within our portfolio and we have restructured our presence in Cameroon and announced a similar transaction in Nigeria to move to a flexible asset light beer operating model.
Speaker Change: We expect this will improve the profitability of our business, while accelerating the growth of Guinness in these markets.
Speaker Change: Additionally, we have recently announced the disposal of apparel and Safari, which we expect to complete early in fiscal 'twenty five.
Speaker Change: We believe this disciplined portfolio management will help us to accelerate growth.
Speaker Change: And increased focus to drive operational excellence.
Speaker Change: Before I hand back over to Deborah I would like to thank all my colleagues for making <unk> the best place to work and celebrate life every day.
Deborah: I have every confidence that Deborah and the team will achieve our ambition of dasher being the most respected and best performing consumer products company in the world.
Deborah: Thank you Bob in your for your kind words.
Deborah: Before I conclude I will discuss our outlook.
Deborah: The consumer environment continues to be challenging with conditions, we saw towards the end of fiscal 'twenty four persisting into fiscal 'twenty five.
Deborah: <unk> remained cautious and interest rates are high therefore retailers are likely to remain cautious too we.
Deborah: We expect the negative pressure on organic operating margin that we saw in the second half of fiscal 'twenty four to persist into fiscal 'twenty five.
Deborah: That said, we will focus on strengthening the resilience of our business and winning with the consumer.
Deborah: We are focused on driving productivity and mitigating cost inflation, while investing smartly in strategic initiatives to drive long term sustainable growth.
Deborah: And we are confident that when the consumer environment improves the actions we are taking will return us to growth.
Deborah: As for medium term expectations recall that after three years of extraordinary topline growth with 14, 5% CAGR from fiscal 'twenty, one to fiscal 'twenty three the ico and our industry are experiencing a period of normalization following the COVID-19 Super cycle.
Speaker Change: And we also continue to feel the impact of macroeconomic challenges geopolitical uncertainty and a cautious consumer environment the consumer facing companies are navigating.
Speaker Change: But we remain confident in the long term fundamentals of TBA and our position within it we believe demographic trends rising incomes in the developing world spirits, gaining share from beer and wine and long term premium position will drive attractive underlying growth in our industry.
Speaker Change: The Ico has an advantaged portfolio across categories price points and regions and we continue to be confident in our ability to grow ahead of TBA and game quality market share enabled by superior operating excellence and disciplined investment.
Speaker Change: We are confident that when the consumer environment improves the actions we are taking will return us to growth.
Speaker Change: And we are focused on getting back into our medium term guidance range for organic net sales growth and we expect organic operating profit growth broadly in line with organic net sales growth as we continue to invest in the business.
Longer term, we expect to deliver organic operating profit growth ahead of organic net sales growth.
Speaker Change: Finally, I will end by summarizing our growth ambition that we previewed at our capital markets event in November.
Speaker Change: Our growth ambition is to build towards the next decade of sustainable growth by achieving quality TBA share of 6% by 2030.
Speaker Change: Our strategy to unleash the power of our brands and portfolio includes.
Speaker Change: Sustaining the momentum in our global brands of Gannett, Johnnie Walker, and Don Julio while driving regional growth opportunities like crown Royal in Nam and accelerating malts in APAC.
Speaker Change: Leading in shaping key consumer trends, including tapping into the convenience moderation and with food occasions with a pipeline of innovation launches planned across multiple markets to recruit new consumers into new occasions at scale.
And finally, continuing to focus on operational excellence. In addition to the route to market improvements I discussed earlier, we are evolving our approach to A&P efficiency to maximize consumer facing dollars, while driving accelerated productivity and allocating resources with discipline.
Speaker Change: I remain excited about our opportunities for fiscal 'twenty, five and beyond because I believe the D. Ico, we have the best portfolio in our industry. The most diverse geographic footprint.
Speaker Change: And the insights and tools, we need and the very best team set up to outperform over the next decade.
Speaker Change: I would like to take this opportunity to thank my 30000 D. Ico colleagues for their hard work and dedication.
Speaker Change: Q.
Speaker Change: I also want to say a few words as this will be leaving his last results presentation.
Speaker Change: I am grateful to lavina for her leadership over the last six years and her contribution as DRG have successfully expanded our business through a global pandemic and delivered major productivity savings.
Speaker Change: I want to thank her for being a trusted colleague and partner to me. Both when we worked together in North America and more recently as I took on the role of CEO.
Speaker Change: Robin you seen us through fiscal year in 'twenty, four while ensuring a seamless transition to our incoming CFO, Nick John Kiani on the first of September on.
Speaker Change: On behalf of all of the Ico colleagues I wish her much future success as she returns to the U S. I also want to take this opportunity to welcome Nick into the <unk> family.
Speaker Change: Thank you.
Speaker Change: Activating <unk>.
Speaker Change: 321.
Speaker Change: Got it.
Speaker Change: Hi.
Speaker Change: No.
Speaker Change: That is it.
Speaker Change: Sure.
Speaker Change: Okay.
Speaker Change: Thank you chip.
No.
Speaker Change: Thank you.
Speaker Change: You do use Quickbooks Star Trek business income and expense savings 30 hours each month, Intuit Quickbooks, Belgium, 70% off for three months.
Speaker Change: Demand has never been higher for these racks and racks of powerful servers feeding the internet insatiable appetite for computing in the cloud and the reality is that the cloud is not up there somewhere it's right here, we are and if youre in the middle of the cloud as we speak and data centers like this can't ever stop Dreaming, social media photo storage and more recently.
Speaker Change: And requiring much more data training and running chat bots like opening eyes chat GPT, Google's, Gemini and Microsoft Copilot, and you can feel the heat coming off of these things.
Speaker Change: Thanks to the generative AI data centers like this are springing up as quickly as companies like vantage can build them and that means demand for power to run them into them is through the roof. Q. If we don't start thinking about this power problem differently now we're never going to see this dream rehash, where the potential we have this amaze.
Speaker Change: <unk> technology can I can truly change our lives one child G. P. T query take nearly 10 times as much energy as a typical Google search and as much energy as keeping a five watt led bulb on for an hour generating.
Speaker Change: Generating an AI image can use as much power as charging your smartphone hyper scalar is building data centers to accommodate AI has seen a mission skyrocket and his problem isn't new estimates way back in 2019 found training one large language model produced as much D O two as the entire lifetime of five gas powered cars and even if we can generate.
Speaker Change: <unk> power, our aging grid is increasingly unable to handle the load. If you look at the peak female during the summertime.
Speaker Change: The data center demand and reduce their load there could be a blackout.
Speaker Change: With the looming question of whether we will have enough power for the widespread adoption of generative AI CNBC visited a data center in Silicon Valley to see those massive compute loads firsthand and talk to those at the center of the problem to find out what can be done.
Speaker Change: Okay.
Speaker Change: Okay.
Speaker Change: Yeah.
Speaker Change: Yeah.
Speaker Change: There are more than 8000, datacenters globally with the highest concentration in the U S. But it's not enough, but we suspect that the amount of demand that we'll see from AI specific applications will be as much or more than we've seen historically from cloud computing. The AI frenzy has datacenter demand rising 15% to 20% every year through 2030.
Speaker Change: And as companies like vantage build more and more getting enough power is key data centers could reach a whopping 16% of total U S power consumption by 2030. According to one report up from just 2.5% before chop GPT hit the scene in 2022, that's the equivalent of about two thirds of the total homes in the U S natural gas is.
Speaker Change: To fuel the majority of this and utilities will need to invest some 50 billion to support the growth data centers are probably around 64 megawatts for the building itself and many of those are being taken up by single customers. They will have the entirety of the space leased to them and as we think about AI applications those numbers going.
Grow quite significantly beyond that into hundreds of megawatts 64 megawatts 100 megawatts, how many foundries.
Speaker Change: On average.
Speaker Change: Tens of thousands of homes per data center workloads powered me.
Speaker Change: Any big Tech companies contract with companies like vantage to house their servers, but the needs of some have grown so much that many have been building their own data centers.
Speaker Change: For Google and Microsoft This is directly translated to soaring emissions Google's latest environmental report says greenhouse gas emissions rose nearly 50% from 2019 to 2023 in part because of datacenter energy consumption. Although it adds its data centers are 1.8 times as energy efficient as a typical data center.
Speaker Change: Microsoft emissions rose nearly 30% from 'twenty to 'twenty to 'twenty 'twenty four due to data centers designed and optimized to support AI workloads Pollo needs are so high that some plans to close coal fired power plants are being put on hold like in Kansas City, where meta is building an AI focused data center. So you can never really stopped.
Speaker Change: Great.
Speaker Change: So.
Speaker Change: We'll do whatever they can to get the power capacity.
Speaker Change: One approach building data centers, where power is more plentiful. The industry itself is looking for places where there is either approximate access to renewables or the wind or solar and other infrastructure that can be leveraged whether it would be part of an incentive program to convert what would have been a coal fired plants and gas are increasingly looking at.
Speaker Change: Ways in which to off take power from nuclear shows Santa Clara, where we visited vantage has long been one of the nation's hotspot for clusters of data centers mirror data hungry clients in videos headquarters with visible from the roof. Now vintage is building in places like Columbus, Ohio, and Atlanta, Georgia in Northern California, We're seeing.
Speaker Change: A bit of a slowdown in terms of where datacenters are deployed because of the lack of availability of power from the utilities here in this area on the flip side of bringing data centers, where the power is some AI companies and data centers are experimenting with ways to generate their own power right on site opening I C. E O. Sam Altman has been vocal about this need he recently.
Invested in a solar startup that makes shipping container size modules that include both the panels and power storage and one oltmanns also invested in nuclear fission startup, Oklahoma that aims to make many nuclear reactors housed in a-frame structures and in nuclear fusion startup helium. Microsoft also signed a deal with helium last year to start buying its fusion electricity.
Speaker Change: In 2028.
And Google has partnered with a geothermal startup that says its next players will harness enough power from deep underground to run a large data center, even data centers themselves are starting to generate their own power, which vantage has done for example in Virginia, where over the course of the last year, we deployed 100 megawatt.
Speaker Change: To support a dedicated data center for one of our customers. There were self contained and we're delivering power to the data center that we have there and it doesn't touch public grid at all.
Speaker Change: Hum.
Speaker Change: Even when enough power can be generated the aging grid is often ill-equipped to handle transmitting it and that's where grid hardening comes in with haunting tracings, our data centers in particular areas. It tends to put somewhat more pressure on the grid in terms of delivering that much power in those locations and an area of northern Virginia known as datacenter Alistair.
Speaker Change: <unk> process, an estimated 70% of the world's internet traffic each day at one point in 2022 the power company there had to pause new datacenter connections as it struggled to keep up with demand basically during the peak hour we either asked.
Speaker Change: Resident turnover, there AC or re ask the company to stop their training vantage as an example voluntarily.
Speaker Change: Supports a load shedding programs such that when the utility knows that they're going to have a constraint based on high temperatures people need to run their air conditioners, we voluntarily come off the grid, we run our own generators during that time in order to ensure that that power is available for everybody. The bottleneck often occurs in.
Getting power from the site, where it's generated to where its consumed one solution is to add hundreds or even thousands of miles of new transmission lines, but those projects like one 5.2 billion dollar effort to expand lines to datacenter Ali have been met with opposition from local ratepayers, who don't want to see their bills go up to fund the project. It is a part of the solution to increase.
Can I ask from the grid side, but that's very costly.
Speaker Change: Sometimes the cost is just passed down to residents.
Speaker Change: Well there you today Dubuque increased.
Speaker Change: Another solution is to use predictive software to reduce failures at one of the grids weakest points. The Transformers, all electric generated must go through our transport and.
Speaker Change: That's primarily a function connect.
Speaker Change: Sorry, if I missed it.
Speaker Change: There are 60 to 80 million trucks, one within the U S alone the average transformer in the U S is 38 years old so the aging devices have become a common cause for power outages and replacing them is expensive and slow.
Speaker Change: Tiny they don't have a center, it's Troy Shannon Klinger, one inch thickness.
Speaker Change: Half the size of a hockey puck.
Speaker Change: Essentially glue it on the outside of a transformer by software can then predict failures and determine which transformer can handle more load. So it can be shifted away from those at risk of failure is being installed in high power demand areas like part of Mongolia, where data centers are coming online by says business has tripled some shot G. P. T came on the scene in 2022, and what we have here.
Speaker Change: In 2034 that we might double or triple again next year.
Speaker Change: [music].
Speaker Change: A large reason, we need more power and a more reliable grid for generative AI is to keep it servers cool all the servers generate an immense amount of hot air and cooling them down with air or water keeps them from overheating. So they can keep running 24 seven the problem is AI is projected to withdraw more water annually by 2027 four times all of Denmark.
Speaker Change: Everybody is worried about AI being energy intensive we can so that when we get off our Austin stop being such idiots about nuclear right that's solvable.
Speaker Change: Water is the fundamental limiting factor to what is coming in terms of AI I was shocked when I saw the number of <unk>.
Speaker Change: AI computing as our water.
Chalet: Chalet runs its been studying datacenter efficiency for over a decade. His research team found that every 10 to 50 Chow GPT prompts can burn through what you'd find in a standard 16 ounce water bottle training takes even more power and generate even more heat as it learns by accessing all of the data constantly being added to the entire internet.
Speaker Change: Training G. P T. Three in Microsoft U S data centers can directly evaporate 700000 leaders of clean freshwater with global AI demand accountable for up to $6 6 billion cubic meters of water withdrawal by 2027 more than four times. The total annual withdrawal of all of Denmark in drought ridden Chile, the government, partially reversed google's permit to build a.
Speaker Change: Data center there following public outcry about water usage and it's facing similar backlash to plant Datacenters in Uruguay too. There are technologies that are used in certain parts of the industry that do consume water in order to cool data centers through evaporative cooling that tends to be very efficient from a power perspective, it tends to be very inefficient four wall.
Speaker Change: Or use for stroke and so advantages designed from the beginning really has been to avoid using water at all costs. Instead vantage you. There's dozens of gigantic air conditioning units on the roof. There is a combination of air handling and cooling towers at the top there where the condenser coils allow each that's coming up from.
Speaker Change: The hot aisles that we were looking at inside the data and then to be converted back into the chilled water loop and brought back down into those critical air handlers.
Speaker Change: Microsoft has halted a radical project they tried keeping it service cool by submerging them under the Ocean. Another solution is using cool liquid directly on chips to cool them rather than the inefficient process of cooling air with water people are working on a whole bunch of things like direct to chip cooling for example, which would radically reduce the amount of water this need.
Speaker Change: Yes.
Speaker Change: But the speed at which this is building it makes it very challenging indeed, so there's a lot of talk in the industry right now and supportive.
Moving from air, which is moving around us through water.
Speaker Change: For liquids that can be brought to the chip itself in order to do it in a much more efficient way, but for a lot of data centers that requires an enormous amount of retrofits in our case advantage about six years ago, we deployed.
Speaker Change: A design that would allow for us to tap into that hold water loop here on the data hall floor.
Speaker Change: There is one broader approach to solving a massive problem of water and power lessen the amount of compute it meet in other words get more work per watt.
Speaker Change: All comes back to how do I get more done with power supply have Gil flux make memory and storage devices for data centers focused on power savings due to compression you can be very slow wait and see adding and power hungry. If you try to do it in general purpose quarters like Intel or Ian.
Speaker Change: <unk> six processors when you put it into a hardware state machine it can be done orders of magnitude faster and more efficiently our machine.
Speaker Change: Key alternative to those power hungry Asics 86 scores our arm based specialized processors arm got it started making low powered chips that maximized the battery life of early mobile phones every last bit of power.
Speaker Change: It's gonna be a fundamentally different design than when you're trying to maximize the performance and so it could be something as simple as how we access our memory can be simple as how we assess data but in the moment of that architecture is thought of as power first now on makes all sorts of chips, including me.
Speaker Change: Dover's for Datacenters and as they are it takes off arms power efficiency has made it increasingly popular with tech Giants like Google, Microsoft Oracle and Amazon I have here, AWS, graviton, and AWS graviton saved 60% power versus competitive architectures.
Speaker Change: In videos latest AI chip unveiled in March Grace Blackwell uses arm based Cpus that it says can run Jennie O models on 25 times less power and arms as a datacenter and filled with its chips can use 15% less power because of lower compute needs. If you think about the scale of data centers, 15% is almost too.
Speaker Change: 2 billion chat Gpt's queries thinks about that they can light 20% of American households, with just at 15% savings and companies like Apple Samsung and Qualcomm have been touting the benefits of doing AI on device a huge energy savings for each query capped off the cloud office servers like these perhaps giving data centers time to build more and catch up.
Speaker Change: AI is insatiable appetite for power.
Speaker Change: Everybody will build the data centers that they can and will have as much AI as those data centers will support and it may be less than what people aspire to but ultimately there's a lot of people working on finding ways to on throttled some of those supply constraints, but definitely a lot of growth ahead in this industry.
Speaker Change: [music].
Speaker Change: Okay.
Mike Garden: Gosh I plant. This is Mike garden doesn't receive directly.
[music].
Speaker Change: The API my team built makes it faster check into the capital one airport lounge, Cerberus and reusable by other capital and Dev teams I'm just glad this lounge is in service.
Mike Garden: Oh.
Speaker Change: We're just talking about you.
Speaker Change: Chairs with tears, that's technology at capital one welcome to this conference of course on open AI assistance, API, which allows the brokers to build powerful AI assistance capable of performing a variety of tasks. This course covers essential topics like and agreeing the API for advanced functionality of leveraging its <unk>.
Speaker Change: Knowledge retrieval and code interpretation capabilities and understanding the fundamentals of large language models through hands on projects with stream lift and real world Examples you're getting practical skills to build responsive AI enhanced applications by the end you'll be able to use your assistance API to transform your web apps into <unk>.
Speaker Change: <unk> smart platforms, Hello, and welcome to this course my name is powered to shown.
Software engineer: Software engineer, so I teach people how to become a software engineers developers build applications and I have to also tied over 250000 students on various skills from programming build apps AI as well as cloud engineering. So welcome to this course. The next question is what is it that you're going to be.
Software engineer: And this of course and of course, you're going to be learning about the existance API, especially going to learn about function calls go to learn about retrieval mechanisms and of course going to be building a lot of stuff going through this course, because that is how I like to introduce certain concepts to my students. So that's part.
Software engineer: What are you going to be expecting.
Software engineer: Course and of course I'll be talking about large language models embedding all of these things that relief.
Software engineer: Specifically.
Software engineer: Okay now, let's talk about the prerequisite for this course, so I expect you to at least have the basics of programming and of course, it I expect it to be an expert or do you think as long as you have some fundamentals of programming.
Software engineer: It's Java script or any other modern programming languages should be fine.
Software engineer: Going to discourse and one thing to keep in mind is that Unfortunately. This is not a 101 programming courses teach you how to program rather I'll focus on the big picture idea of it.
Speaker Change: This API and large language models, so we're going to be using Python English courses. So if you have ever used Python you don't even know what Python thats okay. Thank.
Speaker Change: Here. The main thing is that I want you to understand how this technology how is she speech API and how large language models. How AI based applications are built that is the main goal here. So don't worry you'll be fine as long as you want to learn.
Speaker Change: What are you going to be doing it. The other thing also remember that you'll have access to all of that code.
Speaker Change: Description below Okay. Now, let's go ahead and look into Python setup and essentially the environment is set up so that you can follow along with this course now keep in mind. If you already have high condensate up plenty of machine and you have some visual studio code or any other code editor. How do you use obviously you don't have to follow along because this is you have all that great.
So if you don't have that saying I'm going to show you right now what do you need to do what we need to install the machine and where you were able to follow along this course.
Speaker Change: The best place I found online where you are able to go through tutorials on how to shadow pipeline, specifically on your machine, whether its windows Mac Linux and so forth is this link here, which I'm going to show you right now, let's take a look alright. So if you go to this link here, which is kingstone I'd com knowledge base install Python.
Speaker Change: Everything you will ever need or at least has all of the instructions you need to install Python. If you don't have python installed on your machine. Okay. So just go ahead and follow exactly what they have here even tell you what is Python, which is kind of nice and all of the things that you need okay. So just to follow along and the great thing is that you can.
Speaker Change: I'll go through these different links here. So how do you so python windows SQL and windows click here.
Speaker Change: I will take you to this shadow and housekeeping, so Python under Michael Ash that we'll take your physician KOL set up that you need to go through and of course, if you have a very special.
Speaker Change: <unk> go ahead, and click here and Jeff.
Speaker Change: Followed instructions so it's really straightforward.
Speaker Change: See any value for me going through all of this with you. So go ahead and get that say that these people have python setup on your machine.
Speaker Change: We will go from there. So the next thing we will need is in E E.
Speaker Change: <unk> integrated development environment, I use visual SKU code, which is what I'm going to be using.
Speaker Change: Of course, so if you have something else that you use statutory if I can go with that but go ahead and download that if you don't have it. So it's very simple go to visual studio code.
Speaker Change: And depending on your machine for me I'm on Max It just go straight to download Mac Universal.
Speaker Change: Click here and you can see that we have Mac course reversal window early next in August so depending on the situation. We just go ahead and download the version the latest version of J code and it should be great to go.
Speaker Change: Because it would be nature of what are we going to be learning in this course, which is opening.
Speaker Change: API you will need to have an opening.
Speaker Change: This is very important for obvious reasons, and so, particularly what do you need to do is you need to go ahead and create in this case have any key because that's what will allow us to used here. She says API and kind of various things we can do with the opening.
Speaker Change: And so forth. So that is very important so let me show you real quick here. So if you type in opening Dot com you see here make this a little bit larger you'll be able to say log in quick here. If you'll have an open eye account. So you can go ahead and say sign up if you already have one you can just put your email and go ahead.
Speaker Change: And shiny.
Speaker Change: Also you can go ahead and continue with Google with Microsoft account or with Apple. So I already have an account but in this case you can go ahead and Shane application I'm going to say continue with Google I think that you can also go that route to create an account and gives you this opportunity each year to choose between going to tragic beauty or going to.
Speaker Change: We want to go to API and this is what is going to open. So this will take us to this main a few here. So there's a lot of things a lot of capabilities.
Speaker Change: Get started and all of that what do we really want to go to is to go to Washington's API, which actually we guarantee that player, but what we want right now just to go to API. So quite hear on API keys, you can see you're going to have one API key which created a little bit ago. So go ahead actually create an API key and you can name this.
Speaker Change: Ashish.
Speaker Change: API key can name or whatever you want and that API key click here to create this API.
Speaker Change: And then we're going to do is copy this API keybanc leakage here and save the sheep Yankee for later in this course once we get started coding into all of these things. So it's very important to not to share. This with anyone in fact after I've created disappointed to leakage. So that way you can.
Speaker Change: And to use it okay. So save it in a very safe place that way you don't lose it okay make sure that once you close that window, just like I said there is no other way for you to access it to get it again. So that's what that's why I wanted you to save it.
Speaker Change: But you can create as many secret keys as you need so a few for some reason didn't copy that.
Speaker Change: Go ahead and create a new one and go from there so that should be at about setting up your API environment understanding what are we going to be doing in the scores as well as having your API keys say that tour created for us to be able to use that in this course.
ashish: Okay. So now let's go ahead and look at what is this thing called assistance API Ashish since API is a tool built by the opening folks that allows developers to easily craft and build AI based applications that leverage the open AI.
Speaker Change: Environment the opening.
Speaker Change: Platform per se.
Speaker Change: So do you think to understand about DST since API is that each not each one NTT per se. Although it is but it is attached or exchange in this case, what do we know the opening.
Speaker Change: Which includes all of the tools and models that power <unk> and many other underlying infrastructure of the open AI environment. So that is an important distinction here is that when we talk about DST since API.
Speaker Change: It extends what already is there in this case the open AI API and so it makes it easier for us to build AI tools. In this case AI assistance that we can use in our obligations. So essentially allows us geezers dish platform. This framework tisch libraries to quickly use these tools to build any application.
Speaker Change: AI based applications that we would want to build without having to know too much about the underlining abstraction of how things actually work because we essentially can go ahead and create an assistant and use the API. So that we can connect my assistant in our application and use it has capabilities of <unk>.
Speaker Change: Connecting with the opening.
Speaker Change: The next thing we need to look at is for these assistance API. What is the problem that itself now the thing to understand is that building applications in general greater loan building AI based applications. It's a V.
Speaker Change: Very hard to ask for developers, but it's a very complex. There are usually a lot of moving parts a developer needs to focus on developers need to manage in this case certainly infrastructures they need to keep in mind, how the data is being used which models are needed to use in this case to power their applications. They have to learn how to craft.
Speaker Change: Past prompt possible sure to communicate with these large language models and they also need to understand or keep track of the application stage understand about embedding, which is something totally different but it is part of this realm of AI and large languish models.
Speaker Change: And I understand the storage mechanism right, how do we upload files, how does day large language model use of those files to allow us to tap into the main knowledge, but also those piles retrieval most firewalls knowledge, but also to retrieve information from those files and so many things right. So.
Speaker Change: This is not easy it's a very complex thing to carry as a developer and this poses a problem for developers because now developers instead of focusing on building the actual application now through focusing on how to stitch. All these pieces together to make this work you said the benefit of using the system.
Speaker Change: You said is that all of this complexity all of these things that developers needed to know or to deal with it's abstracted out which means they don't have to deal with anymore. Because now the assistance API. The backend of everything is taken care of all we need to do is developers now is to focus on what matter, which is build elba.
Speaker Change: Vacation to the assistance API already has all of the things that we need as developers, but we don't need to think about them because abstracts out all of that work. So one thing to keep in mind is that when you talk about the large language models.
By themselves they don't have state, which means they don't save a context of the conversation per se now with distributions API. We don't have their problem. Because there is this thing called the precision sweating for ongoing conversation and what this means is now we are able to shave messages and the context, so that messages.
Speaker Change: That way lets say, if youre, creating a bot.
Speaker Change: You'll have to yourself and save that context. So that then when you ask a certain question that the button you should know about the previous conversation.
Speaker Change: We'll actually know what you're referring to because it has the context. Okay. That's huge because now we don't have to worry about that the ex Houston CPI hatchback built in and also we have the retrieval mechanisms for digging through data. So what this means is that we can upload files for the models to use for additional knowledge base.
Speaker Change: So you can upload files about something let's say about crypto currency. So now that piece of knowledge is added to the main.
Speaker Change: This knowledge that comes with the large language model that way you can converse with the large language model. In addition to the knowledge that we just guided by uploading certain files documents and so forth. So now we have a more flexible and more knowledgeable if I may say large language model because we are aiding it with retrieval mechanism.
Speaker Change: It also has code interpreters, so youre actually right can analyze code into all sorts of things, which is amazing as you will see one of the biggest things that we now get with purchase of API. You said, we can actually do function, calling what it means is that one of our assistant is solving a problem. We ask a question.
Speaker Change: We will be able to call a function that we specified that will be used as a tool to go infectious certain data that the large language model needs to solve a certain problem.
Speaker Change: Is huge because now in addition to uploading files for retrieval mechanisms and so forth. We can also add more tools by adding these functions that go serve as agents that can go and do something else and bring back the results, which are going to be used by the large language model excuse to opening.
Speaker Change: Per se or tissue sprint right to solve the problem or to answer accurately. What you are asking for that's pretty awesome Mind-blowing. Let me show you. The diagram here real quick so you can see visually.
Speaker Change: Assistance API benefit. So if you look at this diagram here right. The assistance can go ahead and call the opening models right too.
Speaker Change: <unk> their personality in this case there are capabilities also these are Houston's can also access multiple tools in parallel so now it's sort of having these agents that can go and do stuff and bring back the results. So that we can help with your assistance to be a better assistance right. So in this case, you're these are tools.
Speaker Change #100: Tuesday, we have here I'm talking about the quote and quote and Herbert will have the knowledge retrieval right files and documents we can patch uploaded.
Speaker Change #100: Our system is more knowledgeable about certain topics.
Speaker Change #100: Well function, calling that the great thing about our functional calling is that we can create it's a way for us to create our own tools on top of all of the tools that the estrogen already has access to such as the code interpreter knowledge retrieval and so forth. So now with these we can create our own tools right our own functions.
Speaker Change #100: That go for instance, and fetch the current situation in Bulgaria or go in effect go infection I'm sort of data in a database somewhere.
Speaker Change #100: The idea and along with everything that I said, we have this persistent threats threats, who will talk about in a second here allows us to have these messages that we are saving or are being saved in our conversation and so those are saved for context, which is huge because remember all large language models. They don't have a car.
Speaker Change #100: Sept of saving history per se. So theres stateless. So don't have a way of saving the context, which is problematic when we wanted to refer to certain constantly talked about.
Speaker Change #100: They don't they are not saving that history, then it wouldn't know what you're referring to so context is very important and that is all given with the assistance API and.
Speaker Change #100: And of course, we can access files silver formats. This is a diagram I wanted to show you how about the benefits of the assistance API and almost like of course, you've heard of the chat completion, API, which is the one that <unk> been using if you were using the open AI API right. So you just send messages and you'll receive a response and is very useful.
Speaker Change #100: But as the completion API. It go straight to the open AI models and ask questions and the large language models and of course, the knowledge base, but the thing here is that this knowledge base is knowledge base that is already there. There is no addition, meaning if you were to ask certain questions about something that was done or happened after September.
'twenty after September of 2023, I believe right anything that was that after that then the large this large language model here wouldn't have that knowledge base I would just say I don't know because the completion API just a way for us to get back to response that is the difference here between the chat completion MP.
Speaker Change #100: Which is useful with the execution of API.
Speaker Change #100: I have discussed earlier, okay. So let's look at this general comparison actually we can see the differences between distributions API and be Chad completions API. It does just to have some sort of an idea an overall idea. So you can see here the aspect column and the API the Chad completion, API, so fresh Houston's API.
Speaker Change #100: Initial setup you have to create an assistant with defined capabilities, which we'll see in a little bit.
Speaker Change #100: For chat completion of course, there is nothing for you to set up you just called the API and get the results may answered and so forth for the Houston CPI, we have to initiate and manage in this case a thread for ongoing conversation, we'll talk about what the threat is and I'll, let Stephanie and a little bit and for the chat completion of course, we have none of that so this is just to show you the differences between the two.
Speaker Change #101: Is this API and the chat completions API and you can go down here to complexity solve more complex data of course for Nexus API and assembler of course for the Jaguar completions API. Okay. So no need to memorize. This this is just something you can take a screenshot of and then go ahead and just take a look to see.
Speaker Change #100: The difference is between the eastern and CPI and the chalk completions API.
Speaker Change #100: And there you have it.
Speaker Change #100: Alright. So we just finished looking at the benefits of the assistance API.
Speaker Change #100: It works and how it facilitates our lives as developers so that we can focus on actual building those AI based tools.
Speaker Change #100: Worrying about the underlying infrastructure things that we would have to do if we didnt have assistance. So now let's look at the Ashton's API the building blocks, because we talked a lot about the underlying infrastructure how it works to benefits. Let's go ahead and look inside and see.
Speaker Change #100: What are the building blocks of an assistant right. So here is a diagram I like having diagrams because hopefully helps you conceptualize. These eight years the efficiency PRA has about four main building blocks. So first do you see that we can have in this case an extra step. So the assistant itself is in this case the entity.
Speaker Change #100: Thing per se that we actually built which will then use to help us get information about a certain topic and so in this case here. We can have an example, an assistant who is a travel agent, but we can use so that is the first component and the second component of a second building block is what we call spreads a threat.
Speaker Change #100: <unk> is where all of the messages that occur between the assistant and the user that's the whole idea all those messages are attract here in this thread.
Speaker Change #100: So in this case here of users may have a message as to hey, what is the cost for an extra day in Paris.
Speaker Change #102: Okay, so kind of as a message that is going to be on a thread, which the assistant will have access to as well as to use it.
Speaker Change #103: And then the assistance message would be the cost is 12890 <unk> purchases.
Speaker Change #103: But then you will ask okay. Okay. There is assistance message, but how does she said no well.
Speaker Change #103: The whole process has to go through the other piece here. The other building block, which is the run entities under running entity needs to have a few things for it to be able to run those queries. This questions essentially eval way to what's going on so there is this dialogue percentage happening soon.
Speaker Change #103: So in this case here to run as you can see here. We have has to have access to the assistant use case, you will see layer. It's just going to be 90. It also has to be an actress or has to have a reference to describe because that's where all the messages are so in this case here. This is just going to be our travel agent partners.
Speaker Change #103: And as Brad is trip to Paris.
Speaker Change #103: And then inside of this run.
Speaker Change #103: The run can be triggered to then Brian different steps to get to that conclusion to get to the result, what would happen is if you look at all of this we have in this case the assistant.
Speaker Change #103: Number one building block we have thread.
Speaker Change #103: That is the number two building block in kind of a drag that we have to message messages or message. That's the number three building block and number four is the actual foreign entity.
Speaker Change #103: And so how would all of this works well who have decisions inside of Richardson, who have and then we have to thread.
Speaker Change #103: We have a message from the user what is the cost for an extra day in Paris that is going to be sent to run which will have the assistant I D as well as the thread because at national were to pull those messages that are coming in from <unk> and then it's going to go through a process.
Speaker Change #104: <unk> number one use quota interpreter, if that's what needed to calculate things.
Speaker Change #104: And then is going to go ahead and create a message and if need be this is the beauty is going to be able to go and call any other tool that may be needed in order to get to the correct response and the response is going to be as a message which is going to be returned back again to our trend.
Speaker Change #105: This makes sense to the threat is where all the action really is being dumped into the history per se right.
Speaker Change #105: And there was no and now the thread will have the assurance message because all these steps are done we have the response and goes back as a message I should just message, which then we can use that to show in our obligation.
Speaker Change #106: These are the assistance API building blocks, that's very important here because it can be a little bit tricky at first to really conceptualize sadia. The assistant itself needs threat threat, that's where all the messages scope just think of a bucket of messengers right and then the entity run here this is where the running of things.
Speaker Change #106: To go in first things to go through these steps. This is when it happens we run needs to have reference to the assistance business Snow who is this assistance because remember that Houston will have all of the specifications that he needs. So it knows what it specializes in.
Speaker Change #106: This case is a travel agent partners. So that one needs to have a piece in this case. It referenced these assistance so when it goes in stores brining the steps he knows what knowledge base it needs as well as other tools to indeed create those message back. So the assistance messages are all here. So that we can then use.
Speaker Change #106: Those messages to show in our applications and so forth.
Speaker Change #106: Great.
Speaker Change #106: Very simple, but it can be complex to wrap your head around I understand the conceptualize. These building blocks than what's coming next week, so I'm going to be too complicated so.
Speaker Change #106: We watched this card if you need to but I think it should be good. So what we'll do next is we're going to go in the dashboard in the playground and look at creating an assistant manually in later of course, we're going to do that using code. Okay. Go ahead and do that so now let's go and logging into the opening dashboard.
Speaker Change #106: So you should have an account and everything now when you login. This is more or less what are you going to be shipping. So what do you want to do is.
Speaker Change #106: We wanted to hover over here if you don't see that so quick here. This is what is going to be seeing when I have over and we're going to go to assistance, but this is where we want to grow so quick here.
Speaker Change #106: Sometimes it takes some time it looks like and correct. Let's go ahead and refresh this.
Speaker Change #106: Okay. So today, we have been having some issues, but just refresh if youre, having some issues. Okay. So once you hear it let's go ahead and create our first decision and so we can go ahead and say create here or from here it doesn't matter quickly and create and the first thing we need to do is add a name or so let's say this is going to be.
Speaker Change #106: Personal trainer is such and then we need to pass or add the instructions. So because he's assistance can you to say, okay. You are X y and Z you're knowledgeable in this area and so forth. Okay. I have the instructions here some leases in the patient in here and there.
Speaker Change #106: Click here to make it a little bit larger. So this says you are the best personal trainer and nutritionists, who knows how to get clients to build.
Speaker Change #106: Muscled, you've trained high caliber athletes and movie stars because that is exactly what we are all are striving to be okay. So there. We go. So these are the instructions of course, you will want to put as many instructions as a prompt really as you need for your assistance so specify exactly.
Speaker Change #107: What you want your assistance to help you with Quebec and next we're going to choose the model Brian to opening a model that we're going to be using there are few and as a recording of this video we have the TPG for preview and of course these numbers will change depending on when youre going to be watching this video, okay, but just imagine this.
Speaker Change #107: Remember that because ships of how this works and that's what really matters instead of the things that may change here. Okay. So I'm just going to go ahead and use the GPT three five trouble that should be fine for now and as little bit cheaper as well so going to your board.
Speaker Change #107: You're more than welcome to go to the higher ups and they just use that one clearly that's one and then we have the tools we talked about the tools. So these allow us to attach certain things that we want.
Speaker Change #107: These acquisitions to be able to do if he doesn't already have those tools right.
Speaker Change #108: So we have here retrieval, we have the code interpreter and we can add functions as well.
Speaker Change #108: So we don't need anything I'm just going to go ahead entitled The code interpreter, just because going back okay and anything else I can just slip in.
Stay safe sex. So now the assistant was created.
Speaker Change #108: And if I get this.
Speaker Change #108: Is there a read of that and we can see that we do have our personal trainer. So there is the instructions.
Speaker Change #108: And the <unk>. So this is a very important because remember the diagram was showing earlier was that.
When things are running when we have the fourth component of building block, which is run it needs to know these personal trainer or in this case. The assistant. So this is an idea that will be used internally.
Speaker Change #108: Later, we are going to be able to generate or create assistance using code, which I'm going to show you, but I just wanted to give you an overview right now so very important these ids.
And to be used and from here you can see you can go and test. So if you click here this will open a different.
Speaker Change #108: Tab as you see here and then you can test it out to see if this actually works for instance, you can enter a message to remember this is the message in this case will be the user message.
Speaker Change #110: So you're exactly this assistance API building blocks. This is why we've set up so we have the assistant which in this case, we say this travel agent bought but in these cases are trainer personal trainer and a threat.
Speaker Change #108: Spread which we haven't created yet hasnt been created but it will create all of this is going to be created in the backend. Once we start running things and then we have the messages which is now we users message is exactly what we pass here okay.
Speaker Change #108: Hey.
Speaker Change #112: I want to build muscles.
Speaker Change #109: What foods should I eat.
Ryan: Hey, Ryan.
Speaker Change #115: Brian what do you think it's supposed to do well.
Speaker Change #111: What's going to happen now when we run first of all that message the moment, we say.
Speaker Change #111: Brian the message will be added to threat and you can see he's even if there's a threat here alright. So gets read right now is empty it's actually run.
Speaker Change #113: Go ahead and add that message.
Speaker Change #113: And the structures as shown here and Theres a lot of things that are happening here. So let me go ahead and go through everything I'm going to just make this probably I can't make a smaller that's OK and one thing to see here. This is a thread and each Greg that is created because it is indeed, a simple message right and each thread that is created.
Speaker Change #113: Has also NID.
Speaker Change #113: This will make sense. There. So you can see here we have all the information. So the threat is where all the messages are going to be in from in this case our user the question that we ask as well as when we run and come back we should have the personal trainer messy.
Speaker Change #113: Message as well just like what I showed you hear this run went ahead and pulled in the assistant internally and then the spread I D.
Speaker Change #113: Internally and then went through the steps and speed.
Speaker Change #116: It's paid out via she says message, which now we can see here is the message right. This is the assistant says personal trainer. That's the name of course, Houston interests to build muscles lean muscles that is it's important to focus on balanced diet that includes Cobra.
Speaker Change #117: Protein rich foods.
Speaker Change #118: Whole grains, fruits and vegetables healthy fat dairy products and all this great stuff and even gives us a little recommendation here and note it's important to consult with health care professionals and all that great.
Speaker Change #118: So cool this is what's happening right. So essentially it goes back to what I showed you earlier going back to here you can also see that we have logs or this is really cool because it allows us to look at exactly what happens. So you can see here. We can hydrologic. So we don't want a high deluxe, Greg now because I want to show you something so for our logs here looking at what happened.
Speaker Change #119: Moment, we said Bryan what happens at eight <unk> was created indeed, because we need a thread where all the messages are going to be just like again.
Speaker Change #119: What I showed you here.
Speaker Change #119: Okay. This is this is good okay. So if we open here you can see exactly what happens so the grade was created and eat.
Speaker Change #119: Have a response, which is indeed different ideas and.
Speaker Change #119: And this idea here is exactly the same as these conditions create idea there was created.
Speaker Change #119: And we have other some other metadata that's okay and then we added a message to that thread. The message was the one that we wrote here. In fact, you can see all that happens here on the thread usually it is what's being shown here as a log.
Speaker Change #119: I want you to understand this so you know where things are in case things don't work you understand work fine. Thanks.
Speaker Change #119: So we have our AG message here. The message was added the role is user because I am a user in this case because I entered the message here.
Speaker Change #119: So going back it is this message here.
Speaker Change #119: Which is going to be sent to run.
Speaker Change #119: So that happens.
Speaker Change #119: And then go ahead and close this.
Speaker Change #119: We added the message and then we run the thread right just due to a post request.
Speaker Change #119: It has to have the assist 90 why did I tell you because if you look at this diagram here first as said assistant the name, but internally has to have actual <unk> as well as the thread I D.
Speaker Change #119: Which is exactly what's happening in the backend if I close this thread.
Speaker Change #119: Here.
Speaker Change #119: Let's see.
You can see that has the response and the response each response it has of course D. The ABA.
Speaker Change #119: <unk> is run and when it was created the assistant Ied as well as the thread I D.
Speaker Change #119: And all of these other metadata as well as the model that was used the instructions all of that was sent.
Speaker Change #119: Alone in the response.
Speaker Change #119: In the correct and then of course get right. It's status because when we hit run with Hayden Ryan what happens to the break and things are happening, meaning. These steps are going to go do you see maybe you guys to use a code interpreter create a message to all these other things it's not until all these steps are done which.
Speaker Change #120: In answer a message in this case have answer from our run okay.
In this case, it's not until then once that is done that the message is actually created instant back. So all of that is happening here alright. This is dog and run step, let's see what happens first hedges object here. This data open this data here.
Speaker Change #120: Opening at the AAD the object right. These are the steps right.
Speaker Change #120: Great practice, that's exactly that's exactly what I'm showing you is the status and this is the steps going through the whole process of creating crafting. This message for dish message will be sent and then we can see the results.
Speaker Change #120: Alright, let's continue so you can see it has adjacent on here response comes in as list and object list and we have the data field, which has an H D object, it's Greg step.
Speaker Change #120: O'brien step when it was created and all the great stuff.
Speaker Change #120: And continue with the other step.
Speaker Change #120: And as many steps as possible and then the status.
Brian: Brian status, just tell us whether it would be running is over everything is set up now we have the response domestic which can be passed back to the actually spent right. So that we can then see lets see continue completed can see here that status now is completed which means all is good we should have a formulated.
Speaker Change #122: Message, Okay. If I go to tools you can see what tools, we use code interpreter.
Even though it wasn't really needed, but it's OK and then get runs.
Speaker Change #122: You can see now we have returns data.
Speaker Change #122: Which has an a D. The object.
Speaker Change #122: And the status and everything.
Speaker Change #122: And then we go to the message of response now comes in as object list and the data there and you can see now we have the IDB threat message. Okay. The first one there and then this is squarely assistant.
Speaker Change #122: If you open here.
Speaker Change #122: Youll see that assistance will should have click here to open.
Speaker Change #123: Uh-huh ergo.
Speaker Change #123: And Barry go we have the actual value, which is exactly what you see here says to build muscles holding muscles all of that information, which we received back.
Speaker Change #124: So the assistant in this case, we're through this whole process that I showed you earlier and the return via shouldn't message and this gets back to our thread, which then we can see in this case, we're able to see that the information the messages here. So this is a very good representation of the assistance and all the building blocks, but this is wilco.
Speaker Change #125: The logs because he cheese, we can actually see all the whole process of what's happening. So we understand exactly whats happening says that this mystery box per se.
Speaker Change #126: What is learned here is that to create an assistance here manually you have too easily just go to the assistance API.
Speaker Change #126: Or playground that is and just.
Speaker Change #126: Create and you have capacity name, Okay assistance as well as instructions alright, so specify what do you want your assistance to be good at or to what knowledge. These assistance.
Speaker Change #126: Who are they going to help you with and then of course that will generate the I D.
Speaker Change #126: As you see here and of course as you create actually since you have to of course as you as I showed you you have to make sure that you attach device model and the tools that he wants to attach to.
So what I want you to do is create for instance, a code.
Speaker Change #127: Okay. So essentially.
Speaker Change #128: Come up with instructions for four and a system that can help you with code issues right can say you are a very helpful. Java developer assistant Blah Blah Blah, you are knowledgeable about the basic of Java intermediate advanced until you help developers to do pair programming whatever it is so that in test.
Speaker Change #128: It out and see if it works and make sure because it's code base make sure of course in this case, you really would need to have this code interpreter. Because then you can paste in as a message.
Speaker Change #129: User message a piece of code and ask.
Speaker Change #129: The assistant if this code will compile if there's something you can do they can do to improve it and so forth. So you have some ideas on how this works, okay do that and the shape changes and create the assistance they test it out and see if it works.
Speaker Change #133: Alright go ahead and do that MLC next.
Speaker Change #131: So now we can actually do the same thing we did before but in core which is very exciting. The first thing is let's go back to our playground here assistants playground walk in and everything and I Hope you were able to do that exercise earlier, if not well.
Speaker Change #130: Can I say.
Speaker Change #130: Alright, so what it will do here is we're going to do the same thing, but we're going to be using code right. So I'm going to go ahead and delete this yesterday and I was very sad, but okay.
Speaker Change #130: You kind of go Okay. Now it's empty so we going to do all of that using code. So you should have visual studio code installed or any other or the that you may use that's fine and if you'd also have python everything setup. So everything should be good right. So what I'm going to do here is I'm going to create a new folder.
Speaker Change #130: For our project.
Personal.
Speaker Change #132: Trainer is search.
Speaker Change #132: Especially D to our personal should be personal bank person on that that's fine too.
Speaker Change #132: Okay. So it's empty there so I'm going to say, let's say.
Speaker Change #132: Code.
Speaker Change #132: To open this exact here that's going to close that one and then they would go so we don't have much going on here. So I'm going to go ahead and create a new file let's call. This main got Pi.
Then we go and also we're going to go ahead and create this case requirements TXT requirements.
Speaker Change #132: T X T. So much. This is we're going to put Oliver dependencies, and libraries or we need.
Speaker Change #132: For our Python.
Speaker Change #132: And for our project I should say and next what I'm going to do let's go ahead and create a file this is going to be our environment favorable fire hose would that E. N. P. This is where we're going to put our environment variables. So the idea is we can have our opening.
Speaker Change #132: Variable closes down like that I'm going to put your opening.
Speaker Change #134: Remember a key that I showed you earlier, so essentially you are going to come here and go to API keys, and if you don't have an API go ahead and create one just like I showed earlier and take that key and that's what we're going to put inside this here. Okay. So go ahead and do that and for our requirements.
Speaker Change #132: Here I am.
Speaker Change #132: So you're going to.
Speaker Change #135: Cash in the few ones, where say Python.
Speaker Change #135: I got E M D and I also need open.
Speaker Change #135: A package like that very good so that's inside of our requirements that TXT I'm going to create another file here called that ticket ignore so that's for me too high to few things once they pushed us to the repository could have proprietary so that you don't have things that you read okay. So in this case here I'm going to make sure that.
Speaker Change #135: It's going to bypass the environment variable file so that it's not pushed I'm going to create a python environment that way, we can Bryan kipp install to install everything in this environment specific for this project.
Speaker Change #135: To do so.
Speaker Change #135: Remember I'm on Max here Python.
Speaker Change #136: Three and then it's going to be let's say dash M. B E N V.
Speaker Change #136: And then the name of the environment I'm going to say my A&P.
Speaker Change #136: And what will happen now is just going to create I am going to say, yes, because you'll notice a new environment has been created so yes, you can use that.
Speaker Change #136: And you will see now we have this my ENV with binaries include libraries and everything this is our pipeline environment that we can use them to activate it so two activated whereas a source.
Speaker Change #136: Goodbye.
Speaker Change #137: And then we'll go to primary and then activate and you can see now my ANV is environment is activates so that's real good which means then I can say pip.
Install, especially <unk> and Paas two requirements that text, which has all of these dependencies or or packages or libraries everyday somebody Anna.
Speaker Change #137: So it's going to go ahead and get all of that information for US. Okay. So all the packages have been downloaded that's really good clear all out of this.
Speaker Change #137: Then now if you look at my end of course in Gotta go too binary as you can see that we have got a and b. We have openly I wish you cycled. We added very good. So we should have everything set up now I'm going to get rid of this so let's go ahead and do some importing here somewhere or import open AI library, and I'm going to set up the dot and so they were able.
Speaker Change #137: To get to the environment variables into all the great stuff. So I have all that information here I'm, just going to copy that and pace from here.
Speaker Change #137: Important findings dot am had loaded and from dot and package alright.
Speaker Change #137: And I'm going to call this low.
Speaker Change #137: They're so they're all set up and then I'm going to create a client here, which you'll be using the clients going to be open AI that open AI search.
Speaker Change #137: Okay and now with this client are going to be able to call the opening high API.
Speaker Change #137: Distance and anything else that we wanted because we have created that.
Speaker Change #137: Now you could have also done something like this openly eye right and then say that API key and then go to OFC that environment get in past opening key which is the key in this case the value that we put inside of our environment variable. So that's another way to do that but since I'm loading all the virus.
Speaker Change #137: Variable additions to work with the client or benign at open AI and.
Speaker Change #137: And also if you wanted to get a pass should the OPI key directly from here, but it seems to work just like this.
Speaker Change #137: Because it gets all the apartment globally not just go ahead and add the opening Nike were correctly here or just like what I showed you. Let me just do that again.
Speaker Change #137: Put it here I'm going to leave it there.
Speaker Change #138: Okay. Whatever works for you go ahead and do that or.
Speaker Change #138: Or the other way to put it all here. There's another way you could have done this with client opening I just like I said pasty API key and go ahead into the customer environment variables you changed the names okay, but if you are using open AI.
Underscore API underscore key then this should just work actually this.
Speaker Change #138: I'm going to leave that there just in case you need that.
Speaker Change #138: Right very good so next what I'm going to do let's go ahead and to say model suggests the variable that we are going to be using and tomorrow, we're going to be using its going to be GPT three four turbo.
Speaker Change #138: And I'm going to put it here for now Okay. Now we may change. These you may want to use GPC for previewed at Pentagon situations, but so far so good. Okay. So now that we have everything set up let's see how can we create in this case, a an assistant like musicares when accretive b trainer the personal trainer assistance.
Speaker Change #138: Our receivable all we do I'm going to just put here.
Speaker Change #138: We do really is just see the assistance on let's say personal.
Speaker Change #138: And then I'm going to use our client right, which is.
Speaker Change #138: Which has instinct shaded our open AI there there's a client is going to go to beta and remember that because as a recording of this video the assistance API, it's actually even better which means they're still working on it and so maybe by the time you watch. This video you watched this course, maybe this you won't need to say beta.
It will be great. So just keep that in mind for now we just have to go to beta.
Speaker Change #139: And then we'll go to assistance and once we get the assistance. We go ahead and say create very conveniently and then we can pass the certain parameters here. Okay. So what parameters do we pass here well first of all the new capacity name and we want to.
Speaker Change #139: Name, our personal assistant in this case I'm going to call. This personal trainer as such and then we pass instructions, which are very very important as you remember and I'm going to pass the instructions here.
Speaker Change #139: Real quick.
Speaker Change #139: So these are the same instructions that we used before so you are the best personal trainer nutritionist and you've trained high caliber athletes and movie stars. Okay. There. We go we have all of that information.
Speaker Change #139: Carrier of that to know where it came from.
Speaker Change #139: There we go alright.
Speaker Change #139: And the next thing we need to pass here is the actual model because we need to remember this is the same thing we've done.
Speaker Change #139: Manually. So now we are passing tomorrow, but we kind of be using or the assistant is going to be relying on and it's going to be the model that we pass here is putting these variable so it's easier to change in one place.
Speaker Change #140: So it just like that we created our assistant that can go ahead and say print in this case I'm going to say personal trainer that.
Speaker Change #140: D right. This will give us the actual <unk> of this.
Speaker Change #140: Personal trainer assistant that was created and I'm going to go and coming back for now the next thing we need to do is to create yes. The thread because this is where all of the messages as you know will be such greatest Red again, who see that's fairly easy embassy thread.
Speaker Change #141: And he was client again data.
Speaker Change #141: And I'm going to go ahead, and say threads in that create.
Speaker Change #141: Again for a thread we need to pass if you think that the cool thing here is that for a thread with past messages, which is going to be a list. So this messages here I'm going to pass the object. This case I'm going to start with the raw, okay and the role it's going to be user.
Speaker Change #141: And for the user in this case the content is going to be what well I'm going to just put something I'm going to say.
Speaker Change #141: How do I.
Speaker Change #141: Get started.
Speaker Change #141: Working.
Speaker Change #141: Out.
Speaker Change #141: To lose.
Speaker Change #141: Fat and build muscles.
So this will be the first message is going to be sent for as to user okay.
Speaker Change #142: We could have created aspirator with no message it at all and then add those messages later, but we can go ahead and add a message of user message right away as well.
Speaker Change #142: We're going to print.
Speaker Change #142: Actually the skull this thread.
Speaker Change #142: Heidi and get to that spread.
Speaker Change #142: Spread could.
Speaker Change #142: Because those aren't needed.
And they can go ahead and print.
Speaker Change #143: Great I D.
Speaker Change #143: So we see that can do the same thing here.
Speaker Change #142: Assistant.
Speaker Change #142: D and personal.
Speaker Change #142: Got it and then here you can just go ahead and.
Speaker Change #144: When they need clinical or like that.
Very good so now that we have these two things what will happen now if you run this.
Speaker Change #144: Well, we are going to be able to create an assistant right and also in this case create a threat.
Speaker Change #144: Get those eighties, which you'll see in a second here.
Speaker Change #144: So let's go ahead and run this real quick and see if this works.
Speaker Change #144: Alright, So I know my environment is active so unless a python theory, so make sure on windows are thinking just Python and I'm Gonna say, Maine.
Speaker Change #144: That P Y and let's go ahead and make sure everything is good I think.
Ryan: Let's call Ryan.
Ryan: Well and you can see there we have our assistant Ied, because we want to create the richest 90, we created here personal trainer and we are printing it out and we also have the threat, let's see if this is correct because as you saw we deleted everything in our backend playground and now if we go back let's see let's go to.
Assistance, we should see our personal trainers system, which was created just now.
Speaker Change #145: Alright, and they say DS seven White T five.
Speaker Change #145: You can see seven y T. Five that is exactly what we have here you can see we have that personal.
Speaker Change #145: Trainer name instructions and the model that we're using but that's why we specified and so forth and internally. We do have a thread which is great to hear that it's ready to be used which will have a message. So now. This is not working we're not seeing anything right now, but it's okay. Because we are going to be using that kicked so we have.
Speaker Change #145: Our assistant and we have a threat, where all the messages aren't going to be in and so going back to quote here. We understand that if we were to run. This again that would kind of defeat the purpose because we have the system created already you would go ahead and create yet another assistant we just thought would've won and this is the reason why in this case here, we were able to get there.
Speaker Change #145: <unk>.
Speaker Change #145: In this case you can see we have the assistant I D as well the thread.
Speaker Change #145: Using to proceed creating and conversing in this case with our assistant so what I'm Gonna do hear them copy. These two real quick and I wanted to just go ahead and card code our Ids.
Speaker Change #145: Third we can use them kitchenware two attacks this is gonna be.
Speaker Change #145: Assist.
Speaker Change #146: Put that into variables that we can actually use.
Speaker Change #146: Thank you Stacy soda into issues. So now that we have that we can go ahead and comment all of this out here, but I believe this.
Speaker Change #146: It is so we don't need to you will have access to all this code anyway. So now we have what we need so in this case the assistant when we use that is going to be.
Speaker Change #146: Created right in this case, it's going we're going to be referenced back in fact, I'm going to move all of this too.
Speaker Change #146: To the bottom here because we already have all of that so I'm going to also.
Speaker Change #146: Comment this out because we don't need that anymore. So now we have the information that we need which is great I D. M. D. S. Just maybe because they have been created as you saw in bracket.
Speaker Change #146: Okay. So I'll do next is going to go ahead and create the actual message. Another message here. So we can start conversing with our API assistance API.
Speaker Change #146: Create.
A message.
Speaker Change #146: So let's say message.
And I said that to let's say and say what are the best.
Speaker Change #146: Excess sizes.
Speaker Change #146: Four.
Speaker Change #146: Helene.
Speaker Change #146: Muscles.
Speaker Change #146: And getting.
Speaker Change #146: Strong.
Speaker Change #147: That's our message we're going to then add to the thread to add to the thread while I'm just going to say message again, and I'm going to say client.
Speaker Change #147: That's better.
Speaker Change #147: And threads.
Speaker Change #147: And I'm going to go to messages right and then create miscues and message.
Speaker Change #147: And for the message well in this case here the thread will need we need capacity thread.
Which is going to be a threat I D and.
Speaker Change #147: And we need to pass to role, which he is gonna be they use a roll rate because we are conversing we are asking the question to them.
Speaker Change #147: And then the content in this case is going to be the message.
Speaker Change #148: Which we created I did hop here.
Bryan: Next we are going to then run the thread or at least gets run the assistant how do we do that well we need to create that entity first to run our systems and to do so I'm going to say, Bryan and Dan and their use client again.
Speaker Change #148: Better.
Speaker Change #148: Threads that runs.
Speaker Change #148: Alright that create so we can create that runs entity, which is attached to the threat and you can see the beauty here, because we said earlier that Brian it needs to know the assistant that's why we kept it as well as the threat Eddie so that they can get messy and added that back to that threat.
Speaker Change #148: So in this case I'm going to pass the credit is going to be a priority.
Speaker Change #148: And the assistant it's going to be the assistant I D.
Speaker Change #148: And in this case instructions when he took us instructions for our run okay.
Speaker Change #148: So in this case, we're just going to say please.
Speaker Change #150: Address the user does.
James Bond.
Speaker Change #151: And there we go so now we have all run here now we have to remember that our run has to go through different steps you could go and find a tool that needs to be able to assist the user well right to create to give their system more power things that he needs to do go through all the steps that we saw before.
Speaker Change #151: You may need to then formulate of course at that message back right, it's going to be the assistant message with a result that the user would wanted to receive okay. So that takes time because of the process. So what we'll do here is I'm going to put together a helper function there will help us deal with the weighting of dish.
Speaker Change #151: Stepping that do run has to do before they catch to the result like the message is written back the response et cetera. Okay. So for the sake of time here I do have this wait for Ron completion. So essentially we are passing declined and the passengers Tara deep <unk> and then sleep interval is going to be five now for this to work.
Speaker Change #151: I'm going to have to import a few other things here.
Speaker Change #152: Real quick.
Speaker Change #152: So because it's going to calculate in this case the time, the starting time and all of that to give that elapsed time. So I'm going to just go ahead and based in the time logging in daytime from daytime. Okay. So these are the packages that we need so essentially what this is doing here is we're going to wait so wild true, but they are trying to go ahead and.
Speaker Change #152: A client threads retrieve it escapes me in the past the three D and the run a D. And then it's going to check if run completed at and is going to go through and get the elapsed time, we're going to get that in going to subtract. So do all the calculation just to tell us how long this whole process took some necessary, but it's fun.
Speaker Change #152: To know and then we're going to print run completed at the elapsed formatted elapsed time.
Speaker Change #152: Got that okay, but most importantly, this is where we actually going to get the message messages that is once it Brian is complete it because that's where also the message that we need the assistant is going to be spinning out send to us that's where it's going to be because all of that is going to be put back into the threat.
Speaker Change #152: Okay. So what do we do here is we go through our threat again remember, Greg that's where all the messages are the users message as well as the system messages lift we're going to go through that because it's the list and then we need to patch it threat I D. So we can get those messages that's very important because you could have multiple threads, scoring right.
Speaker Change #152: But on the same assistant so it's important to understand that we need to patch the actual threat. So.
Speaker Change #152: So that we know we are looking at the right bucket in this case, where all the messages are so we can remove all those messages and then we're going to get the last message. Okay that is fair because that's going to be a response in this case and then they will go to the text and get the value could this is how we get the responses. So response here is going to go to last which is the <unk>.
Speaker Change #152: Messages code to content and then the tax and the value and we are going to retreat back and now here. This is where I'm going to actually run by just calling the wait for completion and pass what needs to be passed which is declined local client.
Speaker Change #155: Hi, Good August.
Speaker Change #154: Because of the name so the same because it's past client, but let's just say clients like this and then I'm going to pass the thread Ids can be a threat a D I need to pass what else I'd say, Australia E. Ryan I'd. So run a D. In this case, how do we get the run 80, while we know that we.
Speaker Change #153: We have all run here, which is being passed along right. So we're going to pass that run that I D C.
Speaker Change #153: None that I D. So we get that for this to work.
Speaker Change #153: And there we have it so when we run this we should see some sort of result, let's see if this works well go ahead and open here.
Speaker Change #153: Here.
Speaker Change #153: And let's say Python three main that pie.
Speaker Change #153: Basically the window is going to be something else. That's one if all goes well it will take a little bit because it's thinking.
Speaker Change #153: And we should see once all is done we should see some results.
Speaker Change #153: What they would do now we have a result, so if you go up here.
Speaker Change #153: You can see the Orion completed and opened 320.
Speaker Change #153: 24 seconds alright.
Speaker Change #156: And then the assistant response, well James Bond gives.
Speaker Change #157: As we told it to refer as James Bond when it comes to getting lean and all that stuff its essential to focus on a combination of resistance training and cardiovascular exercises their squat deadlift bench-press pull ups tune ups lunges planks and all of that great stuff. So we got the response.
Speaker Change #158: So you can see that this indeed works right and got a thing you can do also here is we noticed.
Speaker Change #159: Earlier that whenever we run something it was go to test here you can see that we have a log so it can actually go and look at all the logs. If you want to quote to do so I'm going to in fact, it's going to be the steps right of whatever it's happening all the steps when we say run the steps it goes through.
Speaker Change #159: So I can do that as well real quick here to do so I'm going to say Ron steps.
Putting a favorable and I'm going to use client.
Speaker Change #159: Better again.
Speaker Change #159: Reds and runs.
Speaker Change #159: Steps look at that.
Alicia: And then in this case, it's going to come in as Alicia I'm going to say that list enemy to pass again, you get the threat is.
Alicia: It Didnt snow, where I'm getting the steps gram ore by four in this case and the run I D, which is going to be run that Heidi okay.
Alicia: And remember this run here. It is what are we created earlier here very important important.
Alicia: Alright, so what it can do now isn't going to change the message here that the user and I can say how.
Speaker Change #161: How much water.
Speaker Change #161: Sure.
I drink.
Speaker Change #161: Day to get healthier.
Speaker Change #161: Okay.
Speaker Change #162: There we go so let's go back and open our terminal.
Speaker Change #162: And I'm going to run this again.
Speaker Change #163: Okay. So there we go we have a result here too took about 15 seconds and to maintain a good health with Amazon. It's generally recommended to aim for intake of eight glasses roughly two liters of water per day. However, it is a general guideline.
Speaker Change #163: And all of that information is very very good.
Speaker Change #164: Look it is stay hydrated diebold seven prioritize the health and wellbeing very cool.
Speaker Change #164: Cool indeed, so this is a very exciting notice here that now we have this power of creating different.
Speaker Change #164: Systems' API alright, great.
Speaker Change #165: A great threads and different threads actually even within that at one of our system API and we can have all this conversation and get response.
Speaker Change #165: Can see how easy this is and this is a very simple example, and later I'm going to show you how to create natural bought or.
Speaker Change #165: How to create a bought a chat bot, where he can go ahead and start chatting and then D. C. Snow will respond and you can get information that way as well, which is really interesting and now you can see the advantages here right advantages that not only are we just going to cover here in the playground and creative assistance.
Speaker Change #165: And having to interact with it here, we can obviously, but that's not scalable right because we want to build applications that will leverage this assistance API and this what we're doing here is indeed, what is the leverage that were given by the assistance API because now we can use the API the actuals of API.
Speaker Change #165: To create in code and attach this to a website or any application that we may be building ourselves and then we can also go steps and look at all the steps right in fact I did not.
Speaker Change #165: There we go so I didn't.
Speaker Change #165: And in previous staffs, let's go ahead and bring the steps you probably saw that.
Speaker Change #165: Put instead of F string here I'm going to say.
Speaker Change #165: Steps.
Ron: Ron steps.
If that data that's how you get to the steps that data and then it's a list.
Ron: And well Okay. Let's go ahead and run this again of course.
Ron: Can do what I wanted to do because I didn't printed out but that's okay, let's give a new message how many reps do.
Ron: Do I need to do to.
Ron: To build lean muscles.
Ron: Okay, let's see if this works.
Ron: And run again.
Ron: Alright, and you can see we.
Speaker Change #167: We know of course this more expect what I want to show you is that we can see the steps look at this object here the step I D. Dr. Susan Mcgee and all this information, but most importantly, it also has all the things that we're that habit. So step details some message creation details, let's just clean that as an object itself.
Speaker Change #168: Just the data.
Speaker Change #168: Let's see if we can get more.
Speaker Change #168: So you can see a way a thread derived steps and all other these metadata in Kuwait and was completed the assistant Ids and all of these have information here that was generated type message creation.
Speaker Change #168: And well.
Speaker Change #168: Now I really hope that he's seeing the whole value of the whole.
Speaker Change #169: The leverage that we get with this okay. So go ahead and play around this concept of course as always I. Thank you so much and I'll see you next.
Speaker Change #169: Okay. So we're making really good progress here. So now what we'll do is we're going to create yet another very awesome application here called the current news summarize our system. So essentially it's going to be a summarize our new summarize that will allow us to learn a few new things what are we going to be using in this case, it's going to be the function.
Speaker Change #169: And calling tool now if we go back to what we saw before when he talked about the ash Houston's API in the beginning we notice that we have distance API, which taps into API models and then in this case he calls with specific instructions to the opening of our model and also can access.
Speaker Change #169: Multiple tools and apparel, which is amazing because in these tools list, who can have different things different tools right. So it can have code interpreter can have knowledge retrieval, which we'll see later, but the cool thing also but the amazing thing is that we also have access to function, calling which is great because it sort of gives us.
Speaker Change #169: Wings per se, which allows us to create our own tools right, meaning we could create functions that will go be able to fetch data somewhere or do something and then retrieve that information and push it back to the large language model in this case the opening in our models and the decisions can then do what it needs to do.
Speaker Change #169: <unk>.
Speaker Change #169: So this is the part that we're going to be look into them.
Speaker Change #170: In this upcoming lessons, let's go ahead and take a look at what are we going to be building. This summarizes our application at least a little demo. So you understand what's going on all right. So this is the app. It's called the news summarizes so essentially this will allow you to enter any topic I could say for instance, vaccine and then I can run the assistant so what.
Speaker Change #170: Will happen here in Iraq, and it's going to go and tap into a function a call a function calling function that was created which is going to be called by assistant.
Speaker Change #170: And that function is actually going to get an API a news API pull the news.
To have this topic vaccine and then summarize everything for us and as you can see we have here hear some news articles on the topic of vaccines and then we have these other headline here and where thing is that we also can click here to go to see more of those news about whatever is that it's being talked about.
Speaker Change #171: So it's very cool actually gives you some sort of a summary and at the end of course I added is one steps, which just logs out.
Speaker Change #172: Ron steps from the assistant as we've seen before okay. So very cool. So this is exactly what we would've building I can also enter another topic here, let's say bitcoin why not.
Speaker Change #172: And it's going to go ahead and run this is actually extremely application, which I'll show you how to put together is very simple if you've never.
Speaker Change #172: Part of whatever we haven't done anything with stimulated it's very cool. Okay. So it's running as you can see here and it takes a bit of course, because it's pulling all of that information calling that function.
Speaker Change #172: And then recruiting that information and then pull it back to the AI. Okay. So they would go we have here here are some articles on the topic bitcoin. It tells us exactly what's going on give some descriptions. So this is what we're going to be building and let's go ahead and get started so we need to go ahead and get an API key in order for us to be able to.
Speaker Change #172: To get this application, calling so let's go to news API Dot Org as you see here. This is where you were going to go ahead to either logging. If you were to have a logging Oh go ahead, and say get API from here or from down here, but if you want to learn a little bit more about what is happening here, it's a very simple articles or news.
Speaker Change #172: <unk> API that allows you to fetch data for instance, if you add a topic such as Tesla as you can see here in Chicago and then you get something like this so it Jason that allows us to go with protein and get information pertaining to that topic, So which is exactly what we wanted in this application. So it's very simple go ahead as they get.
Speaker Change #172: The API and the thing you need to do is to register for to in order for you to get an API. So you put your first name you'll watch name and then choose a password.
Speaker Change #172: Sure you are if you are an individual or a business I would just go with any new visual I think that's the easiest and of course, we have to capture here agree and should make so I'm not going to do that because I already have their API. So once you have the API of course as we did before go ahead and say that API, because we're going to use it.
Speaker Change #173: Shortly in our application or you have created already this news summarize or so I've got the environment going I have everything I also have read the requirements that TXT with Python.
Speaker Change #175: N V and opening I of course, and I'm going to say Pip installed dash are past the requirement of text and go ahead to make sure that we have all of that installed.
Speaker Change #174: Okay, Okay, and if you go to my <unk> been you can see we should have.
Speaker Change #174: E N V as well as open the eyes set up for us. So the main folder or the main file as you see here is the essentially the same setup. We had before okay. So just copy and paste would have declined and associated are open AI.
Speaker Change #174: Here.
Speaker Change #174: And the passing Tomorrow of course remember we could change this model here too, perhaps GPT for depending on when you're watching this video I'm using the 3.5 turbo six okay. Because that's all we need it anyway, but feel free to change that okay. Okay. So we have all of these imported nothing new here. So if you click here you can see that I have the open API key and.
Speaker Change #174: What we'll do next is you need to add the other key which is going to be the news API key. So here then you can put like that and put your API Keith I think the API key that you created.
Speaker Change #174: So once we have all of that let's go back to our main.
Speaker Change #174: <unk> to our mainland Pi or App like P y.
Speaker Change #174: And I'm going to put here.
Coach: Coach So it's gonna be news API, Oh ash environment of course, we need to make sure that we import.
Coach: Oh ash for that as well and then it should because here we are getting the news API. We just created put that into a news API key. So we can use instead of things up in a little bit. Okay. So once you have all of that we should be able to get going now what I'm going to do next here I'm going to create a clash.
Coach: And that will be our manager per se, our assistant manager, which will allow us to call. It and then get the assistance or create assistance to Craig I D and do all the things that we've seen before so I think that's the better way to do it of course, we could do this in a more modular way create functions into what we did before but I think this is kind of fun and also.
Coach: Keep in mind that you will have access to all of these codes. So it's all good.
Coach: So in a bottom here I'm going to put this piece of code, which allows us of course to pick up the main function.
Coach: Create a here and then run whatever is here. So for now I'm, just gonna say patch. So that we don't have any issues. So let's go ahead and create a function, which is going to allow us to tap into the API and get some resolved because that is the base of this entire application. So that is the first thing we need to do so unless they get.
Coach: News.
Coach: Define dev for to define and then I'm going to pass here, the topic, which is going to be the topic. We're gonna pasch. So Fortunately I put the euro here so Dr. Al that we need to tap into essentially it's our API, so I'm going to I have it already.
Coach: And when I put it inside of an F string and expired and grab it so essentially what I'm doing here I have the STP Ash news API to org.
Coach: And in this case here the end point that I want is everything okay. There are different endpoints, but we can just focus on everything and you can go back to the API page, which I will recommend you do to read a little bit more about all these end points and everything but this should suffice and then you have or acquire a year in the past the topic.
Coach: Is gonna be passed along here and then be API key which is the news API key that we put together right at the top here and of course, we saying page size about five because it went on and get more than back with that just a little bit too much right and you can play around with the numbers and everything that's totally fine and up to you now.
Coach: Next thing we need to do here is to go back to our requirements TXT and I need to pass a request package here, because we're going to need that to hit our API due to request to our API.
Coach: And then get them the information queso.
Coach: Bush.
Coach: Go ahead and say people install.
Coach: Hopes, let's say.
Coach: So gosh our requirement of text.
Coach: And we should be good.
Coach: Go back here now I can go ahead, and say try put all of that inside of a try and I'm going to say, except at the bottom here require a request.
Coach: So I actually have to import requests so import requests such package and now can use the requests and then extraction.
Coach: Exception.
Speaker Change #177: As he this is just to save us.
Speaker Change #177: This makes our requests and I'm just going to say print.
Speaker Change #177: Or whether it's a.
Speaker Change #177: Error occurred.
Speaker Change #177: During a P. I request, some like that okay, and Patrick so it don't worry too much suggests an exception here because we want to put some code inside of the try here. So that if something happens at least we have a way of handling our errors were probably there are better ways of doing this but this is.
Speaker Change #177: Alright, so now inside here, we're going to do the fracturing of the response from our API when it put in a response very well.
Speaker Change #177: And unless they request.
Speaker Change #177: Get escape and passionate EUR out that's how easy it really is to use request to go and fetch some data.
Speaker Change #177: From the API. So now that we have a response here I'm going to put some if statements here.
Speaker Change #177: Just to make sure things are okay. Some let's say if response status because they're responsible have this status code in this case, if a SAS code is okay. In this case, it's just 200 between stripping, Okay, and then I'm going to be able to parse through our J sign So, let's say news and then I'm going to transform that into Jason which means we need.
Speaker Change #177: To import.
Sean as such.
Speaker Change #177: C J Shaun.
Speaker Change #177: Dumps and I'm going to pass pass our response.
Jason Moa: Hi, Jason and such.
And of course, I can say indentation about for Isd, Jason comes in so to make the actual restart it looks a little bit better. Okay have our object here, which is going to be our payload with all the news. So the next thing that we'll do here just to make things simpler is we're going to transform this Jason here, we say discipline dumps.
Jason Moa: Which if you have over what it shows here says serialized object to adjacent format shrink. So this is just a format recent string now we need to actually convert that string into a Python dictionary that way better way, we're going to be able to access some of the fields easily. So I'm just going to say Jay News Jae song.
Jason Moa: And then us Jason.
Jason Moa: Package, you can and say loads and then pass our new.
Jason Moa: This shouldn't be news that new but either way it works, Okay Passover news here.
Jason Moa: There. We go so now this is easy for us to work with which.
Jason Moa: Which is exactly what we want and then I'm going to say data.
Jason Moa: It's a news Jason here just to patch things around a little bit and then I'm going to go ahead and.
Jason Moa: Here I'm going to go ahead and access all the fields.
Jason Moa: <unk> looked through right looked through the raison and extract all the things that we wanted to okay. So if we go back to the news API of course, we have to get started documentation everything but if you look here you can see the payload how it looks right. So all the payload will more or less look like this okay, which is really cool and also U K.
Jason Moa: Scroll left and now you can store left to see different end points top headlines.
We have here cockpits lines still and they would go dishes to everything endpoint that we are using.
Jason Moa: With some modification to get the data that we're looking for it and so it will look essentially the same the payload you can see here, we have status as an object of caisson object. So in this case, it's just an object would have the status. Okay results 204, and then we have this article's array, which they don't have the source.
Jason Moa: And Arthur So each article is an object itself with all information and has Arthur titled description and your L. Gerald imaging all of these fields. So we can extrapolate some of these fields. So that we can get the information that we need because we need everything from these.
Jason Moa: From the payload so essentially we're going to look through our payload and get the.
Jason Moa: And access to field and kept at the information that we actually need so before we even go through the four loop. Let's go ahead and get some of the most important fields, so I'm going to start with status.
Jason Moa: And this stat is going to be getting this status is going to get from data <unk>.
Jason Moa: And go to status field here. So you can see we'll have the object go to status and get this satish field new skills. He was going to say, okay. Okay, we got that and let's get the total results in this case unless it's going to be data and then I believe it's just total we go down here and get to the total results.
Jason Moa: Which will say how many articles are English payload and then we're gonna go to articles to get the actual articles.
Jason Moa: To go through data again going back to get to this array, which will contain all of the articles as objects or dictionary and Python. Okay. So we says we'll just say already kohl's. So this is exactly what we want to make sure that these names are exactly the same because these are our fields, which are.
Jason Moa: Our our Ids for us to be able to get to what do we need I think I got everything right. So I've got all the articles. So now is when I'm going to loop through all the look through the articles and get the information that I want So first thing I'm going to say four.
Jason Moa: Article in articles or simple loop here. So what do we want to do is I can go and get the information that we want from each article what we want is the source and get the name and then we may need the author.
Jason Moa: The title of the article of course and the description.
Jason Moa: We may need some other things here, so and we mainly the content on other things. So we're just going to go ahead and extrapolate a few of these fields.
Jason Moa: Name in this case is going to be gone two articles or article use case for each article and I'm going to go to source and go through and get the name right to do the same to others, So I'm going to get the offer.
Jason Moa: Nicole.
Yeah.
Jason Moa: Arthur.
Jason Moa: Title.
Jason Moa: Yeah.
Jason Moa: Mexico and <unk>.
Jason Moa: What else I need description, which can be article.
Jason Moa: And description.
Jason Moa: And what else, let's get EUR out because we may need that the oil to the article.
Jason Moa: Shelf and it's gonna be R. L.
Jason Moa: Yeah.
Jason Moa: Okay, Let's go ahead and get the content.
Jason Moa: Okay write offs such good than here at a bottom I'm going to put all of that into a string. So it's easy for us to use it so I'm going to say call. This title.
Jason Moa: Description.
Jason Moa: I'm going to put all of that into F string.
Jason Moa: Just to facilitate everything really and then here's what's going to happen. So I'm going to go ahead and concatenate all of these different pieces that we put together here we received into a long nice strength. So first I'm going to put the title.
Jason Moa: And then.
Jason Moa: Put a text title, let's say is titled first and then I'm going to say offer.
Jason Moa: So put get the offer.
Jason Moa: <unk> that we just got from here.
Jason Moa: And what else, let's go ahead and get let's.
Jason Moa: Let's say source source name in this case and description subscription.
Jason Moa: Let's go ahead and get G. R L.
Jason Moa: You're out okay. So now we have this long string that has all this information that we pulled from the API looking good and the next thing we'll do here is that I'm going to actually put that into an array because each one of these shrink that contains title author source named description or al. We know that we have inside of four loop.
Jason Moa: We want to do that for each one of these articles are were getting and so I'm going to go ahead and create an empty list here say final news that way I can pass all of that.
Jason Moa: Each time, a loop through alright.
Jason Moa: Right below here I'm Gonna say final.
Jason Moa: News.
Jason Moa: I'm Gonna panned hour.
Jason Moa: Description, so title description, maybe I should've named it better but that's okay.
Jason Moa: Okay. So each time, we do that we are going to pull in all of the title description, which we are getting all of the title author source named description the Doral for each article as we look through.
Jason Moa: All of that so that way, we can actually return that array. So we see all of the information in this case all of the news that we want so at the bottom here I'm going to go ahead, and just say return.
Jason Moa: The final news.
Jason Moa: Okay. Let me go ahead and.
Jason Moa: It is because it's an and statement I can say return els.
Jason Moa: Yeah.
Jason Moa: In this case, if indeed response.
Jason Moa: If a sponsor status code is not 200, meaning we have some issues. We just going to go ahead and return.
Jason Moa: This case and empty.
Speaker Change #179: <unk> Oh listen to like this.
Speaker Change #179: Alright, very good so what we'll do now is let's go ahead and call our get news and passionate topic here that says bitcoin just to see what will happen. Let's go ahead and quickly run this.
Speaker Change #179: So I'm Gonna say, a python three I am on the Max on Windows or Linux you have to do something else I believe and a lets call main let's give it a run its hopefully everything works.
Speaker Change #179: It looks like its running but it's not showing anything that is because I need to actually put that into a variable.
Speaker Change #179: News.
Speaker Change #179: And then say print.
Speaker Change #179: News like this.
Speaker Change #179: Okay, let's see if this works, it's Ron again, and as you see we're getting some information and the great thing is because it's an array.
In fact, we should be getting yes, a list keeps saying right isolation to Python, but same thing you can see we have the square brackets, there and of course I can go ahead and get just that first item in our list if I wish to do so.
Speaker Change #179: And restaurant again, we should get suggest one so we can see exactly that we have as title and description author source and all that good stuff in your al and that's exactly what it wants so they would go so we have all the articles that we want to we just got the pieces that we want and created one long string it.
Speaker Change #179: Put that in array each time, we call. Okay. So this is good news the thing. They say is that this tells US that we were able to Fox news from our API and get the data that we want for what are we going to be doing next.
Speaker Change #179: So now that we know that the get news works by the way you will see later this get news. This is the function that we are going to be using you will see in a bit here.
Speaker Change #179: As the function, calling functionality, we talk about with assistance API, which is pretty cool. Okay. So now we have that working you know we were able to pass in this case.
Speaker Change #179: Topic and then we received the news formatting everything we got what we need and always get so we're going to use that as our function colleague vehicle alright. So next we'll do here is as I said before we are going to actually create a clash. This is going to be a mandatory assistant manager class, where we're gonna put everything in that one.
Speaker Change #179: Okay. So now we're going to have done this.
Speaker Change #179: Put it functions.
Speaker Change #179: Modular early but this is I think that's the best way to do it. This is probably the better way for us to have everything in one place and one class, where we can essentially that class as an object and then get what we want from that let's do that so I'm going to credit class here. So, it's a class and called especially student manager.
Speaker Change #179: Sachin alright, very good and so I'm going to add a few fields for our class here. The first filter we need is going to be the thread.
Speaker Change #179: <unk>.
Speaker Change #179: And for now I'm going to say none.
Speaker Change #179: And then.
Speaker Change #179: I need the assistant.
Speaker Change #179: I D, which is also is going to be none like this have a constructor or initialized her and depending on which programming language coming from so I'm going to say define and this is going to be the image.
Speaker Change #179: And it passed the shelf and it's returning in this case.
Speaker Change #179: Nothing.
Speaker Change #179: Just to simplify things of course, I'm going to pass if few parameters here. So I'm just gonna self when a peso also the model was going to be a string.
Speaker Change #179: Okay and just in case I'm, just going to go ahead and pass our motto Curry patched at the top here, we created at the top here, we have a default value, which is going to be the model for GPT three or whatever model you added here.
Speaker Change #179: And I'm just going to remove that.
Speaker Change #179: And next I am going to then set up a few things for our class here an hour constructor Michel iser, Okay. So lets say itself.
Speaker Change #179: And I'm going to call the client cause unwanted declined to be in this case open AI at open AI are suggesting there should be especially with all of that or it could address called our client.
Speaker Change #179: Here I would work as well so either way it works I'm just going to pass client like this which is going to be in this case our client.
Speaker Change #179: And then of course shelf that model.
Speaker Change #179: In this case I'm just going to say.
Speaker Change #179: R O.
Speaker Change #179: Whatever we're passing along here and there.
Speaker Change #179: Yourself.
Speaker Change #179: The assistant is gonna be none.
In the beginning.
Speaker Change #179: And the shelf.
Speaker Change #179: Thread also is going to be none.
Speaker Change #179: And shelf that run rate is not as well the other thing I'm gonna add here, because I want to be able to have the actual summary, but that's the whole goal is that this class is going to be able to give us a summary of the news from the topic, though we paced in or enter so I'm going to create yet another.
Speaker Change #179: Field here called summary, which in the beginning is going to be equal to none like that.
Speaker Change #179: So now we're going to do some if statements here to actually check if some of these.
Speaker Change #179: Feels like assistant and a thread, but more particularly if this.
Speaker Change #179: Static field here thread I D.
Speaker Change #179: Ashish and ladies if there are existent that where we can then look at that and see whether we need to create a new assistant or just use existing because they days that as we run to this the first time as you saw before we will have the ashish maybe at least as well as authority.
Speaker Change #180: So that we don't run this many times and then recreate the same things in the backend and the console oriented playground, we want to make sure that those things are set up so that we don't have copies of the assistant and Ids and so forth. So it's still inside of our in it.
Here I'm going to say if.
Speaker Change #179: Assistant manager.
Speaker Change #179: Thread and just get a start with assistant so if we have an estrogen lady that means we have an assistant in that case, we are going to set our assistant too.
Speaker Change #179: The assistant that we already have so much yourself that client.
Speaker Change #179: Better.
Speaker Change #179: Assistance, and then went to retrieve that assistance and to retreat or assistant and we need to say patch of course, the idea of their assistant. So we're just going to say.
Speaker Change #179: Kashi Sprint I D is equal to.
Speaker Change #179: Manager assistant manager and get that.
Kristen I D. A section and also going to check for our strategy to see if we have a three day to ESAU assistant manager that forever I D.
Speaker Change #179: If that's the case, we're going to do the same thing we did which he is going to go which is we're going to go ahead and get the Friday diesel shelf assistant or a thread idea I should say.
And set that up.
Speaker Change #179: With the shelf that client.
Speaker Change #179:
Speaker Change #181: Uh huh.
Speaker Change #181: Threads and retrieve this case.
Speaker Change #182: D, it's going to be to assistant manager.
Speaker Change #182: Troy criticize shelf, but that's OK great idea.
Speaker Change #182: Alright, very good so now we are making sure that indeed, if we have an assistant D that we don't create an ecosystem. In this case, we just go ahead and retrieve the assistant though we have the.
Speaker Change #182: Same thing with a greatly okay. So all of that that is inside of our elite function here. Our constructor next we're going to define a new method here called create.
Assistant: Assistant So this will allow us to create an actual assistant so I'm going to pass shelf name and instructions as well as tools because those are the things that an assistant as you would know by now may need when we create in the system. Okay. So first of all I'm going to go ahead and put an if statement here so if not shelf.
Assistant: Assistant right. So if theres no assistance of course, they weren't going to do I'm going to create an assistant assess assistant.
Assistant: Object, essentially which is gonna be shelf that client that better.
Assistant: That.
Assistant: Assistance, and then I'm going to create any assistance essentially so to do that we need to pass name, which is gonna be name when you have to pass the instructions.
Assistant: Structuring or we are passing along.
Assistant: And then within Apache also tools and patched to tools for such.
Assistant: And for completion, we also going to past tomorrow, and we're going to say.
Dietmar: Shelf dietmar.
Dietmar: Tomorrow, so to get to the model that we already have.
Speaker Change #185: In our cost structure in our class or the top here. Okay very good. So that's how we would create an assistant if we didn't have an assistance. Okay. So now that we know that we've created the estrogen object here next I'm going to say assistant manager that is just an idea I'm going to grab that a D and then I'm going to.
Speaker Change #185: You get to that from our system object that I D.
Speaker Change #186: You bet.
Speaker Change #186: And then I'm going to make sure that the class field has that can efficiently.
Speaker Change #186: So Matt you use yourself.
Speaker Change #187: Assistance, he's going to eat.
Speaker Change #188: And then I'm going to set up the assistant field, which is usually none in the beginning to the.
Speaker Change #188: Assistance that we've just created here, which is gonna be dish assistant object right. So actually so self.
Speaker Change #188: Assistant now is equal to our assistant object.
Speaker Change #189: Very good so if you want we can just print things out here. So that we can deepak and see what's going on so I'm going to say Ashish I E. Just put something more there. So we can see what's going on.
Speaker Change #189: And then I'm going to put say self that assist I D.
Speaker Change #189: Actually could you square assistant that idea like this right to get to the actual Ashish <unk> when that is created that why that's why we're saying this alright.
Speaker Change #189: Very good.
Speaker Change #189: And that's it for create assistant.
Speaker Change #189: Okay. So next one we will do is we are going to then define another function or method in this case.
Speaker Change #189: This is gonna be coal create.
Speaker Change #189: Thread coarse litter pass shelf so we have.
Speaker Change #189: But.
Speaker Change #189: Preference as actually we can see.
Speaker Change #189: Really nothing is out of this world. It's the process is still the same it's just that it's changed a few things. So that we have an actual crash that helps do all the things in one place. So we can just instantiate that class and get what we need alright. So at the same thing really if not in this case yourself that thread. So there's nothing there then that means we.
Speaker Change #190: You need to create a threat objects.
Speaker Change #189: Hey.
Speaker Change #189: So some things shelf that client.
Speaker Change #189: And then threads and they want to create a threat and as you know now to create a thread would just needs to pass we don't actually need to passionate things, which actually I'm going to just leave US live. So we're going to create an object bread and we can attach messages and whatever we need later alright. So now that we have that thread, we're going to use assistant managers, just like what we did before.
Speaker Change #189: And thread deep, it's going to be equal to a thread object that I D.
Speaker Change #189: I think that up and then we're going to set the field the kras field shelf that thread.
Speaker Change #189: To be equal to the thread object Ken.
Speaker Change #189: And I'm going to go out and print.
Speaker Change #189: Spring here and can say thread alrighty, just to make things better and just pass here self that thread alright, alright. So just print it out so we have it and make sure that we are getting what we need. So now we have created the create assistant method.
We also have in this case they create a thread method that we need to add messages to that thread so want to find out other function here.
Speaker Change #189: AD.
Speaker Change #189: <unk>.
Speaker Change #189: To thread okay. So we're gonna patch here first of all self reference roll as well as the content right. So to create value metrics. Because we know messages are added into a threat. So we need to make sure that we indeed have a threat I D. So, let's say if self that thread.
Speaker Change #189: That then we're going to go ahead itself that.
Speaker Change #189: Client.
Speaker Change #189: Baghdad threads messages and we're going to create that message alright to create a massive need a threat I D, which is going to be in this case shelf that thread.
Speaker Change #189: Got a D and then we need the role which is gonna be dual role, okay, which is going to be passing when we call. These create a message or AD message thread.
Speaker Change #189: As well as the content, okay and pasty content.
Speaker Change #189: That's right, which is being passed along that's it right. So we have that function or in this case a method and next we need of course, a way for us to run the assistance. So I'm going to try another method here. So this is going to be run.
Speaker Change #189: Assistant.
Speaker Change #189: And we're going to pass shelf reference and instructions as well.
Speaker Change #189: Okay. So how do we do that again, we're going to check it's always important to check because in order to run an assistant we need of course to check if there is a thread I D as well as decisions okay.
Speaker Change #189: So itself that thread.
Speaker Change #189: And.
Speaker Change #189: Self that.
Persistent if they are existent sedan, where our safe two ragnar this thread so self.
Speaker Change #189: Run.
Speaker Change #189: This case.
Speaker Change #189: I said that to yourself that client.
Speaker Change #189: Beta three.
Speaker Change #189: Reds and runs.
Create okay. So we have create here so what we need to do we need to pass a few things obviously, we need deposit thread I E. How do we get that we'll get that by saying shelf.
Speaker Change #189: Right.
The reference of fish class.
Speaker Change #189: And we go and get this Friday.
Speaker Change #189: Threat that I D.
Speaker Change #189: And then we need to pass the assistant do.
Speaker Change #189: The same thing and can pass the instructions, which are the instructions are we passing.
Speaker Change #189: Price parameters.
Speaker Change #189: Okay. So our clash is actually coming along nicely next we are going to define yet another method here called process.
Messages, because we need a way as you know to process those messages going through all of that stuff and retrieve what we need alright, so I'm going to pass here just the self reference Okay. Let's go ahead and work on this bad boy. So what do we need now here in the process message, where first of all I'm going to check if there is a threat because we can.
Speaker Change #189: Because we know that messages are inside of a threat. So it into tracking there is indeed, a working threat in order for us to go in and get.
Speaker Change #189: That information, which are the messages.
Speaker Change #189: If threads.
Speaker Change #189: For yourself, I guess or itself that thread.
Speaker Change #189: If that's existent if that exists and I'm going to go send messages.
Speaker Change #191: Okay reprieve those messages so self critical client.
Speaker Change #192: Better for now that May change by the time you watch this video dish lessons.
Speaker Change #192: And I'm going to say threads messages and we know that comes in the list. So let's go to the list.
Speaker Change #192: And in this case, we need to pass a threat I D, which is going to be self that thread.
Speaker Change #192: <unk>.
Speaker Change #192: I'm going to create a list and empty list, because that's where we're going to add all of the messages or somewhere in this case right. So let's say summary.
Speaker Change #192: Can am to list a list of such.
Speaker Change #192: I'm going to just go ahead and get to the last message of the threat because that's all that we need so I'm gonna say lashed mess.
Speaker Change #192: The message and how do we get that we say messages, but this is indeed the list right and then get go to data right.
Object and then get the first one zebra.
Speaker Change #192: And I need to get the role we'd get the role from the message in this case.
Speaker Change #192: Payload, which is a a dictionary really that we're receiving.
Speaker Change #192: We say messages.
Speaker Change #192: In.
Speaker Change #192: Actually since we already have the last message here was just probe into that.
Speaker Change #192: And <unk> content.
Speaker Change #192: Okay.
Speaker Change #192: And of course get the first index and got to text and value research.
Speaker Change #192: Value.
Speaker Change #192: Okay. So now we get the actually my this is my role this is going to be the response.
Speaker Change #192: Alright, but I want that they'll roll, which is gonna be I'm going to do the same thing so last message that.
Speaker Change #192: Of that content I believe zero and then.
Speaker Change #192: I need no actually it can get that straight to roll I think yeah. There. We go so we can see Intel essentially is helping me trying to get so we got the last message the big object, because we looping we know that the messages come in in a list. So we're probing in and getting what exactly what we need so we need the last message.
Speaker Change #192: The list.
Speaker Change #192: And the message is less that we got from our threat that messages and then we get the role just need the role. So we can use it in a bit here and the response that we're getting alright. So that we can formulate and create a nice response alright. So we have to respond to now go ahead and say print in this case put them inside of it.
Speaker Change #192: F string here.
Speaker Change #192: Just for US a summary, and put a lot of information like that where we know exactly what's what.
Speaker Change #192: And I'm Gonna say role.
Speaker Change #193: I'm actually going to go ahead and capitalize there all right.
Speaker Change #193: Response like that.
Speaker Change #193: So we just printing out this summary, and on top of them that have put the role. So it says for instance user or assistant and this guy is going to be assistant right and then we pay and then we have our responsive there.
Speaker Change #193: Okay. So what are we going to do before even that we have this summary here right, which is an empty array. So what I'm gonna do is mostly a summary.
Speaker Change #194: Is that a pan and patch in our response.
Speaker Change #194: So now our summary, when we return because this is going to return something when I return real quick here.
Speaker Change #194: This is going to return our summary.
Speaker Change #195: So now there are summary will have the response, which is exactly what we need this is going to be the assistant response, the processing messages. So what we'll do next well you'll remember at the top of our class here. We have this field called summary, Barry Instantiating initializing ear to none so now we can fill that summary, Inc.
Speaker Change #195: With this summary that we got here so all of their due.
Speaker Change #195: Here now I can say.
Speaker Change #195: A shelf that summary.
Speaker Change #195: And I'm going to just say summary.
Speaker Change #195: Right, Okay, but I want actually to make it a little bit better, which means I'm going too, which means we're gonna format things a little bit so first I'm going to put.
Speaker Change #195: A new line every time, we add before we added the actual summary, the actual text in this case this.
Speaker Change #195: Summary that we get as a response.
Speaker Change #195: And then I'm going to call the join and then pass the summary as such.
Speaker Change #195: What we have here.
Speaker Change #195: List, which will contain in this case this.
Speaker Change #195: The summary.
Speaker Change #195: Which is which will contain the assistant.