tafromthereturneddictionary.Wethenaddthedailytemperaturetoarunningtotal.Finally,wecalculatetheaveragetemperaturebydividingthetotaltemperaturebyNandreturnit.Notethatthiscodeassumesthattheforecast_weatherfunctionreturnsadictionarywithakeytemperaturethatcontainsthetemperatureforagivenday.Iftheactualfunctionreturnsadifferentformat,youmayneedtoadjustthecodeaccordingly.Figure8:Exampleoftoolencapsulation,whereweaskChatGPTtoencapsulateaweatherforecastAPIintoanewfunction.civilizationisinextricablyintertwinedwiththeevolutionoftools,andtherelentlesspursuitofinnovativetoolcreationconstitutesavitalaspectofhumaningenuity.HumanbeingsarethecreatorsandusersofalmostalltoolsfromtheStoneAgetothe21stcentury.Althoughwetakeitasgranted,thingsaredifferentwhenfoundationmodelsareinvolved.Consideringthattheyhaveproventool-usecapabilitiestocertainextents,itisalsopossibletoputthemintothelifecycleoftoolcreation.ToolsforAI.Humanscreatetoolstosatisfyourownneeds,sothedesignationnaturallysuitshumanpreferenceandconvenien
Tool Learning with Foundation Models