Add prompt suggestions to your app

Choose Clone API or SDK for contextual prompt suggestions, React chat autocomplete and headless editors. Includes integration code and an evaluation path.

Clone SDK adds contextual prompt suggestions to an existing chat composer. It can suggest the next user prompt when the draft is empty or complete a draft the user has started. Use the React components or headless controller for editor behavior; use Clone API from any backend when you want to build the interface yourself.

What is a prompt suggestion?

A prompt suggestion is text a user can review, edit and send to an AI assistant. For example, after an assistant drafts a launch announcement, the next suggestion might be “Make it more concise and add a clear call to action.” A fixed starter prompt can introduce a feature; a contextual suggestion uses the conversation and current work to propose a relevant follow-up. This example illustrates the behavior, not a guaranteed prediction.

Clone predicts the user's input. Your existing assistant handles the message after the user sends it. You can keep your current chat backend and add suggestions around its composer.

Should I use Clone API or Clone SDK?

Your productStart withWhat you implement
React chat app or copilotClone SDK quickstartAn authenticated backend proxy and a React composer using TabCompletionInput or useTabCompletion
Custom editor with existing input bindingsHeadless Composer SDKConnect CompletionController to your editor and render its visible candidate
Custom web or mobile interfaceClone API quickstartServer-side HTTP calls plus your own display, acceptance and stale-response handling
JavaScript/TypeScript or Python backendServer clientsKeep the app key on the server and derive the subject from your authenticated session

The SDK and direct HTTP API use the same prediction service. The JavaScript package provides composer UI and a server client. The Python package provides synchronous and asynchronous backend clients; composer UI stays in JavaScript or your own interface.

Add prompt suggestions to a React chat composer

Install the published JavaScript SDK:

Shell
npm install --save-exact @clone-ai/prompt-prediction@0.7.1

Connect your existing draft state and current context to an authenticated proxy. This is the composer portion of the integration:

React
import { TabCompletionInput } from '@clone-ai/prompt-prediction/react';
import { createPredictionTransport } from '@clone-ai/prompt-prediction';

// Define once, outside the render function.
const transport = createPredictionTransport('/api/clone/predict');

// Inside your existing composer, using its draft state and context:
<TabCompletionInput
  value={draft}
  onValueChange={setDraft}
  context={context}
  transport={transport}
  presentation="instant"
  requestTimeoutMs={15000}
/>

Your backend must implement /api/clone/predict, authenticate the product user and call Clone with a server-owned app key. Never ship that key in the browser bundle. The SDK quickstart includes a runnable local example, backend wiring and sandbox setup. For editor-specific bindings, see the Composer SDK.

Tab accepts the suggestion into the draft. The user can edit it before using your existing send control. Keep suggestion requests separate from the normal send path so typing and sending remain available during a timeout or outage.

What context should I send?

Start with recent conversation turns and the current draft. Add known artifact text or selection and current, permitted user preferences when they help. Change the context revision when this information changes, and discard results for an older draft, conversation or account.

Product-context predictions do not require a Clone end-user account. Optional Connect Clone lets a user explicitly select personal context to share with your app. App registration does not grant access to private Clone history. See personalization.

How do I evaluate prompt suggestions?

First use deterministic fixtures in the actual composer to check typing, IME composition, Tab insertion, editing, dismissal, stale responses and outages. Then evaluate real sandbox suggestions against representative product conversations. Record presentation, acceptance, editing and submission separately; accepting a suggestion alone does not prove task success.

The free sandbox includes 1,000 suggestions once per developer account, with no card or automatic paid upgrade. Review API and SDK pricing and reliability and limits before production rollout.

Continue with prompt prediction modes or the SDK quickstart.