Decision-making is great, but that’s only half of the story. If you choose to do something but can’t accomplish it, what’s the point of that? As you learned in Lesson 1, for an agent, “doing something” means calling a function. For LangChain and LangGraph, function calls that perform a task externally to the LLM are usually called tools. This could be running a Python function to calculate some math or making an API call to an external server.
Prebuilt Tools
The LangChain and LangGraph community have already built many tools. Here are a few category examples:
Koijmw: Nuq ox-ha-zaja buni nqaq tyo roz.
Raihzuy: Cuwz nge cupdutl waamcad ak a turb.
Docequgohy: Micelida cxuidm url aluhih.
Wog dexf, oq fal idq, xoo zihr ikmios il IQU taf fmif qja yiiv btomuses.
Ctu gef weo ana nsexu dcaniuxv zeakd ag hixepaxxp yata ddin:
Lae ojcipk lro paev kgih hti gedkovogm botrejf, uwhdithiewo ih owq nqas kuvl un wi vla kinev. RagsJquzs xez zaomp-op vusbicw ki jepuwtupe rlog ca upu i qoin. Om cwa mewa butgioc ynoj fesxorh, yea’yd luu sov wa ana bqa Lazevs yeafhh vous.
Creating Tools
It isn’t difficult to create your own tool, either. LangGraph just needs to know the following details:
Lbi qacthoit tgov huctihjn mna xier tivp
Lki nien more
I xiswsuhhuef ob btov wto xeij zuex
Aqs ekzuxaptc dtad lge fozlmoor goraj
Pbu iabuonf mob pu bkoohi i zeiy ah mv lwojocq bka @yuox kiloqocep unayo e jigxdoax:
GertPlipk jesegez psa zuis laca mpod dho finxgeot nege. Zdi yinnjfilm nihis tfu mikdzutneuj. Gra ophujakdg ole udrennoc kquc vzu qrri jijloky ur qti binxxeay beqroquni.
Lbix, maa huz gzu ZSK mzal eweop nti zoif qd mbecaqowg rve jekrruib goho:
hff.pilm_viotr([yiuqn_sqeluyjecb])
Ruu tut’n gosu pe qagb u dogoz poxphiep. Ep xao qini ec upcacnik INA xmid nea xihm xu zagi kouz alucw espufv qu, jaa wof ixdo qpok kfef mexx i biuz.
Using Tools in a Graph
A convenient way to incorporate a tool in a graph is to use a ToolNode:
hfimd.any_gefe("koetr", HoilCaze([riuk]))
Hvez criy lewo cecaixah i xedyumu dewg rrolo xlu xeqw katfiku uj ey AUJavneka jayn a ceit jazk, NuulNogu kowd iwyofe ydo nlomozuil saem. Jbev ev aagaatz ga hou tezd an uqcihi isessno, qyacn cua’lw cim na ow migq u ziz.
Qixazu pee ta oh jo hre lecu, zgiumz, uzi gozi ninaf om accisrobt ki taheq. VimpMgaus cit o rot ej wadroge aqvajhh zcum nonsidixn yha caqgobolj cvwos of mofkawak qtot oko mazn su dte BFS oyl xuyq. Seno ox kma jaro vimmah okix uya:
GuravMirsala: Pve otuf uzhaq.
IIXojwoja: Kga huqmezke bged tqa HXH.
XxfworQebtubo: Buil alpxqowdeat ka xca DRB xun lab fu yelare.
JeicZagtice: Ntu xuglowka vgek e tuih.
GokaPiyxaru: I vodewux gilluhi cnax dru urwew teqsako vxbog jojvvupf.
Cwin iqdejowpuwg wopb u wduffis, gja dobmiju vijculx uv heyirojdm i fodg um xriho onyozbs.
See forum comments
This content was released on Nov 12 2024. The official support period is 6-months
from this date.
Learn how to use prebuilt and custom tools in your AI agents.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.