hashbrown

Choosing an API

Watch streamed JSON resolve into a trusted SummaryCard, then accept and revise the plan.

Recorded in the real Angular workbench with OpenAI requests, browser tools, Hashbrown streaming, and application state. Footage slowed to half speed for readability. Replay reads captured frames. No narration. Read the text walkthrough.

Start with what your interface needs to show: text, typed data, your own components, or a choice among known options. Then decide whether the request needs earlier conversation turns.

New to Hashbrown? Build the two-step plan in the Quickstart first. The examples below extend that setup.

Choose by result

I want to…APIContextContinue with
Render trusted components in a conversationuiChatResourceEarlier turnsUI chatbot
Build a text conversationchatResourceEarlier turnsMessages and turns
Keep a conversation with typed datastructuredChatResourceEarlier turnsStructured output
Generate text from the current inputcompletionResourceCurrent inputChat or completion
Generate typed data from the current inputstructuredCompletionResourceCurrent inputPredictive suggestions
Generate trusted components from the current inputuiCompletionResourceCurrent inputExposing components
Choose among named optionsdecisionResourceCurrent inputDecisions
Narrow the components available to a chatuiDecisionResourceChat modeUI Selection

The API links open the reference for exact options and return values. For UI selection, the recipe starts with application-owned views and props. Use the UI decision API's chat mode when a decision should narrow the components a UI chat can generate; its standalone mode can also select among supplied components.

Chat or completion?

A chat keeps earlier turns in its current instance. Send a message when the user asks a follow-up or when the answer depends on the conversation so far. The UI chatbot reads application context, proposes a plan, and reads the accepted state on the next turn.

A completion responds to the current input. Use it for a focused transformation, such as generating suggestions from the current form values. Input changes can schedule another completion; keep the input absent until the application is ready to request it. See Predictive suggestions for an explicit request and review flow.

Neither choice automatically persists a conversation after refresh. Message history explains what the application must save and restore.

Decide or generate?

Use a decision when the possible answers are known: choose a workflow, classify intent, or select a view. The application owns those options and handles unavailable or unsuitable results. Follow Decisions in Agents to route a request through a server-owned decision contract.

Use structured output when the model must produce new values within a schema. Use generative UI when it should select trusted components and supply their props. A decision can narrow that component set before generation.

Choose where the work runs

The framework API owns browser state and rendering. A provider adapter connects your server endpoint to a hosted model or an Ollama server. Keep provider credentials and endpoint policy on the server; see Securing a public endpoint.

For on-device inference, follow Local Models. For parsing an existing JSON stream without a model or endpoint, use JSON Parser. For a finished chat interface around your runtime, see Threadplane.

Explore it in the workbench

Use the workbench below to compare result shapes after choosing an API; the workbench guide covers every lesson. Start with Messages and turns for text, Structured output for typed data, and Generative UI for trusted components. Each lesson uses the same plan so the changed API is easier to spot.

Inspect Requests and JSON, then compare the live renderer and application State. A different output API changes how the response is interpreted; it does not grant permission to apply it. The teaser demonstrates generative UI with real OpenAI output, not every API in the table.

Follow one learning path

Choosing an APIChoose by resultChat or completion?Decide or generate?Choose where the work runsExplore it in the workbenchFollow one learning path