Send a link to your students to track their progress
21 Terms
1
New cards
Where should some tools run instead of inside the server process; according to the notes?
Where the user's app runs — typically the browser.
2
New cards
What are headless tools?
Tool definitions (name; description; argument schema) that are registered on the server with the agent; while the implementation is registered only on the client and executed after a short interrupt/resume handshake.
3
New cards
How do headless tools differ from ordinary tools?
Ordinary tools have their function body executed on the server; whereas headless tools have no in-process implementation — execution happens on the client.
4
New cards
How do headless tools differ from server-side tool use?
In server-side tool use; the model provider itself executes built-in tools remotely; with headless tools; execution happens outside the server process entirely (e.g. in a browser; another service; or via a human action).
5
New cards
What kinds of browser APIs are given as examples of when headless tools are needed?
Why might headless tools be preferred for privacy and locality?
Because data stays on the device; for example local memory in IndexedDB.
7
New cards
Why might headless tools reduce latency?
Because there's no extra server round-trip needed for purely local operations.
8
New cards
What is preferred over sending arbitrary code to `eval` for structured; safe effects?
Many small; typed tools — for example one tool per canvas primitive.
9
New cards
What are the four steps of the headless tool pattern?
1) Define the headless tool via `tool(name=...; description=...; args_schema=...)` with no implementation. 2) Register it with `create_agent` or the LangGraph graph. 3) Handle the interrupt payload when the tool is invoked. 4) Resume the graph after the action is performed.
10
New cards
What does a headless tool have; and what does it lack; compared to an ordinary tool definition?
It has only a schema (name; description; args_schema) — it has no in-process implementation.
11
New cards
What happens when the model issues a tool call for a headless tool; instead of the tool executing locally?
The run interrupts; and the graph pauses with a payload shaped like `{'type': 'tool'; 'tool_call': {'id'; 'name'; 'args'}}`.
12
New cards
After a headless tool's interrupt payload is handled; what must happen to continue the graph?
The graph must be resumed with the tool result; after the app; another service; or a human step performs the action.
13
New cards
For browser-based flows; how can the schema be connected to a client-side implementation?
By mirroring the schema in the frontend and attaching `.implement(...)` there.
14
New cards
What can supported JS SDK hooks do automatically regarding headless-tool interrupts?
They can detect headless-tool interrupts; run the matching client implementation; and submit the resume command automatically.
15
New cards
Why are headless tools needed for payment operations; according to the notes?
Because money can't be charged without user confirmation in the UI.
16
New cards
Why are headless tools needed for human-in-the-loop scenarios?
Because a human needs to review or approve the LLM's action.
17
New cards
python from langchain.tools import tool headless_tool = ________( name='confirm_payment'; description='Ask user to confirm a payment in the browser'; args_schema=PaymentConfirmInput )
```python from langchain.tools import tool headless_tool = tool( name='confirm_payment'; description='Ask user to confirm a payment in the browser'; args_schema=PaymentConfirmInput ) ```