Get the latest tech news

How AI tool calling works (40 lines of vanilla JavaScript)


Lesson 2 of the free buttercup.sh agent course: the twenty-line loop that turns a chat model into an agent, working JavaScript and Python, what each turn costs in tokens, and an exercise you run in the browser.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of works

works

Photo of javascript

javascript

Photo of lines

lines

Related news:

News photo

Developer builds viral 3D source code visualizer that consumes 21GB of RAM — flies around 2.5 million lines of code at over 120 frames per second

News photo

Removing Drivers For Outdated ARM Platforms Will Lighten The Kernel By ~247k Lines

News photo

Security boffin claims airport group left API keys in client-side JavaScript for four years