How AI tool calling works (40 lines of vanilla JavaScript)
Thread
Loading the complete thread in the background. This saved snapshot is available now. Refresh
Unofficial Hacker News client; not affiliated with Y Combinator.
How AI tool calling works (40 lines of vanilla JavaScript)
Loading the complete thread in the background. This saved snapshot is available now. Refresh
Unofficial Hacker News client; not affiliated with Y Combinator.
stephenblum · · focus · HN ↗
[dead]
sebiandev · · focus · HN ↗
stephenblum · · focus · HN ↗
ramon156 · · focus · HN ↗
stephenblum · · focus · HN ↗
stratos123 · · focus · HN ↗
It also spends an entire section trying to convey that large tools waste tokens:
but surely that's wrong - it's part of the same conversation, it only gets processed once and then cached. Otherwise doing long conversations would always cost an amount quadratic with length.dvt · · focus · HN ↗
This isn't necessarily true. I'm working on a local harness that doesn't do this and instead coerces everything to YAML (including tool calls) for better bucketing. Some models are indeed trained on the `<|tool_call>...<tool_call|>` token schema (or something similar), but it's vendor-specific and often times inconsistent (so you're constantly fixing calls or going back to the LLM).
stephenblum · · focus · HN ↗
stephenblum · · focus · HN ↗
KolibriFly · · focus · HN ↗
peak tech blogging right here
flipflowdev · · focus · HN ↗
[dead]