liveBook · Manning

Api integration

As explained in Build AI-Enhanced Web Apps

The connection of an application to external application programming interfaces to access their functionality or data.

API integration connects a web application with external systems to access functionality or data. In generative AI applications, those systems can provide language processing, image recognition, sentiment analysis, or model access, extending what the application can do. section 1.2.1

A typical integration moves input through a supporting pipeline: prepare data, send it to an AI model or external provider, then postprocess and format the result for the user interface. The surrounding application also needs UI and conversational components, backend infrastructure, deployment, and scaling. section 1.2.1 section 1.7

Production-oriented integrations commonly account for these moving parts:

  • Choose a model and provider according to the application task, data requirements, and desired capabilities. section 1.7
  • Use provider abstraction to reduce dependence on a single external AI service or model. section 3.5
  • Handle streamed output, asynchronous processing, connection management, buffering, and errors. section 3.5
  • Separate concerns, integrate incrementally, test and validate behavior, and document the integration. section 3.5

AI web application integration

A JavaScript and React application can use Next.js with the Vercel AI SDK to interact with external AI providers. The SDK exposes generateText and streamText for generation, while useChat and useCompletion support conversational and completion interfaces. Streaming responses can improve the user experience while the SDK handles much of the underlying connection and buffering complexity. section 1.7 section 3.5

How Build AI-Enhanced Web Apps covers it

How deep it goes
Explains pipelines, provider abstraction, streaming concerns, and integration guidelines without detailing provider-specific request implementations.
Examples
Uses JavaScript, React, Next.js, Vercel AI SDK, generateText, streamText, useChat, and useCompletion as integration examples.
What it assumes
Assumes JavaScript and React application development while introducing the supporting AI application ecosystem and provider integration concerns.
What you can do after
Apply it via Next.js and the Vercel AI SDK to connect applications with AI providers and deliver generated or streamed responses.
How it connects
Connects data processing pipelines, generative AI, model selection, provider abstraction, streaming responses, and deployment and scaling.

Also explained in

Compare how 2 books explain api integration →

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.