Skip to content

Update OpenUI Cloud ShadCN example#741

Open
AbhinRustagi wants to merge 8 commits into
mainfrom
ar-openui-cloud-shadcn
Open

Update OpenUI Cloud ShadCN example#741
AbhinRustagi wants to merge 8 commits into
mainfrom
ar-openui-cloud-shadcn

Conversation

@AbhinRustagi

@AbhinRustagi AbhinRustagi commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What

Rebuild examples/shadcn-chat as the OpenUI Cloud reference example. Instead of calling OpenAI directly with a build-time-generated system prompt, the example now sends its shadcn component library to Thesys backend per-request via createResponsesInstructions({ componentLibrary }) — Thesys backend generates the component system prompt server-side, validates model output against the library's schema. The demo shows the full cloud surface: conversation threads, frontend tokens, artifacts (slides/report), server-side search tools, and an app-side function-tool loop.

Changes

  • api/chat/route.ts — swapped chat-completions + runTools against OpenAI for the Responses API against Thesys API (/v1/embed) with conversation threads and store: true. Instructions carry the componentLibrary config block (shadcnLibraryConfig from lib/shadcn-genui/server).
  • api/frontend-token/route.ts (new) — mints muse frontend tokens for the client SDK.
  • page.tsx — AgentInterface wired with the cloud llm transport, artifact renderers/categories.
  • .env.example (THESYS_API_KEY, OPENUI_MODEL, DEMO_USER_ID), lib/env.ts helpers; package.json gains @openuidev/thesys-server + openai.
  • The build-time system-prompt.txt generation step is gone — the prompt is server-generated from the wire config.

Test Plan

  • Verified locally

Checklist

  • I linked a related issue, if applicable (TH-2035)
  • I updated docs/README when needed (example README needs a pass: cloud env vars replace OPENAI_API_KEY + the prompt-generation step)
  • I considered backwards compatibility

@AbhinRustagi AbhinRustagi marked this pull request as ready for review July 9, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant