Co-Pilot
Updated a month ago

setup

Aassistant-ui
0.0k
assistant-ui/skills/assistant-ui/skills/setup
76
Agent Score

💡 Summary

This skill helps set up and configure the assistant-ui for various AI integrations.

🎯 Target Audience

Frontend developersAI enthusiastsProject managersTechnical leadsDevOps engineers

🤖 AI Roast:The README suggests the use of environment variables for API keys, which poses a risk if not managed securely. Ensure to use a secure vault for storing sensitive keys.

Security AnalysisMedium Risk

The README suggests the use of environment variables for API keys, which poses a risk if not managed securely. Ensure to use a secure vault for storing sensitive keys.


name: setup description: Setup and configure assistant-ui in a project. Use when installing packages, configuring runtimes, or troubleshooting setup issues. version: 0.0.1 license: MIT

assistant-ui Setup

Always consult assistant-ui.com/llms.txt for latest API.

References

Pick Your Setup

Using Vercel AI SDK?
├─ Yes → useChatRuntime (recommended)
└─ No
   ├─ LangGraph agents? → useLangGraphRuntime
   ├─ AG-UI protocol? → useAgUiRuntime
   ├─ A2A protocol? → useA2ARuntime
   ├─ External state (Redux/Zustand)? → useExternalStoreRuntime
   └─ Custom API → useLocalRuntime

Quick Start (AI SDK)

npm install @assistant-ui/react @assistant-ui/react-ai-sdk @ai-sdk/react ai @ai-sdk/openai
// app/page.tsx "use client"; import { AssistantRuntimeProvider, Thread } from "@assistant-ui/react"; import { useChatRuntime, AssistantChatTransport } from "@assistant-ui/react-ai-sdk"; export default function Chat() { const runtime = useChatRuntime({ transport: new AssistantChatTransport({ api: "/api/chat" }), }); return ( <AssistantRuntimeProvider runtime={runtime}> <Thread /> </AssistantRuntimeProvider> ); }
// app/api/chat/route.ts import { openai } from "@ai-sdk/openai"; import { streamText } from "ai"; export async function POST(req: Request) { const { messages } = await req.json(); const result = streamText({ model: openai("gpt-4o"), messages }); return result.toUIMessageStreamResponse(); }

Styling

// Option 1: Pre-built CSS import "@assistant-ui/styles/default.css"; // Option 2: Tailwind (add to tailwind.config.js) content: ["./node_modules/@assistant-ui/react/dist/**/*.js"]

Environment Variables

OPENAI_API_KEY=sk-... ANTHROPIC_API_KEY=sk-ant-... NEXT_PUBLIC_ASSISTANT_BASE_URL=https://api.assistant-ui.com # For cloud

Common Gotchas

"Cannot find module @ai-sdk/react"

npm install @ai-sdk/react

Styles not applied

  • Import CSS at root level or configure Tailwind content paths

Streaming not working

  • Use toUIMessageStreamResponse() in API route
  • Check for CORS errors in console

"runtime is undefined"

  • Call useChatRuntime inside a component, not at module level
5-Dim Analysis
Clarity8/10
Novelty6/10
Utility9/10
Completeness8/10
Maintainability7/10
Pros & Cons

Pros

  • Clear setup instructions
  • Supports multiple protocols
  • Quick start guide available

Cons

  • Lacks detailed troubleshooting steps
  • Assumes familiarity with various protocols
  • Environment variable management could be clearer

Related Skills

web-perf

A
toolCo-Pilot
88/ 100

“This skill is so thorough it might start charging consulting fees after the audit.”

tldraw

A
toolCode Lib
86/ 100

“A fantastic library for drawing, though its licensing model means your masterpiece will forever be signed 'Made with tldraw' unless you pay the ransom.”

vue-expert

A
toolCo-Pilot
86/ 100

“Powerful, but the setup might scare off the impatient.”

Disclaimer: This content is sourced from GitHub open source projects for display and rating purposes only.

Copyright belongs to the original author assistant-ui.