liveBook · Manning

Call

As explained in Build AI-Enhanced Web Apps

Function calling is a technique in which an AI model requests execution of specified functions to obtain information or perform actions and then uses the results in its response.

Function calling lets an AI model request execution of developer-provided functions, obtain external results, and incorporate those results into its response. It extends a model beyond its training data to access real-time information or perform specialized actions. section 4.4

A function-calling workflow connects the model to application capabilities:

  • Recognize when external information or an action is needed. section 4.4
  • Request execution of a specific function or tool. section 4.4
  • Run the supplied function against an external resource, such as an API. section 4.4
  • Return the result so the model can produce a structured, relevant response. section 4.3.2 section 4.4

Weather lookup

For a question about the weather in a particular region, the model can request a weather API call, receive current regional data, and use that result in its response instead of relying only on its trained knowledge. section 4.4

Function calling also supports structured responses: a function schema constrains the model’s requested data structure, while schema validation can improve type safety and data integrity. In the Vercel AI SDK, custom tools are defined, registered, and handled as React components. section 4.3.2 section 4.5

How Build AI-Enhanced Web Apps covers it

How deep it goes
Explains the request–execute–incorporate workflow and schema role without detailing implementation code.
Examples
Uses a weather API lookup and custom Vercel AI SDK tools handled as React components.
What it assumes
Builds on structured data generation and streaming content before introducing external tool interaction.
What you can do after
Apply it via the Vercel AI SDK by defining functions, registering tools, and handling their responses as React components.
How it connects
Connects structured data generation, tool calling, external resources, schema validation, the Vercel AI SDK, and React components.

Also explained in

Compare how 7 books explain call →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI-Enhanced Web Apps. The section links point to the parts of the book it draws on.