Co-Pilot
Updated a month ago

cloud

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

💡 Summary

This skill provides cloud persistence and authentication for managing threads and files in an assistant UI.

🎯 Target Audience

Developers integrating chat functionalitiesProduct managers overseeing AI projectsTechnical leads in software developmentDevOps engineers managing cloud services

🤖 AI Roast:Powerful, but the setup might scare off the impatient.

Security AnalysisMedium Risk

Risk: Medium. Review: shell/CLI command execution; outbound network access (SSRF, data egress); API keys/tokens handling and storage; dependency pinning and supply-chain risk. Run with least privilege and audit before enabling in production.


name: cloud description: Guide for assistant-cloud persistence and authorization. Use when setting up thread persistence, file uploads, or authentication. version: 0.0.1 license: MIT

assistant-ui Cloud

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

Cloud persistence for threads, messages, and files.

References

Installation

npm install assistant-cloud

Quick Start

import { AssistantCloud } from "assistant-cloud"; import { useChatRuntime, AssistantChatTransport } from "@assistant-ui/react-ai-sdk"; import { AssistantRuntimeProvider, Thread, ThreadList } from "@assistant-ui/react"; const cloud = new AssistantCloud({ baseUrl: process.env.NEXT_PUBLIC_ASSISTANT_BASE_URL, authToken: async () => getAuthToken(), }); function Chat() { const runtime = useChatRuntime({ transport: new AssistantChatTransport({ api: "/api/chat" }), cloud, }); return ( <AssistantRuntimeProvider runtime={runtime}> <ThreadList /> <Thread /> </AssistantRuntimeProvider> ); }

Authentication Options

// JWT Token (recommended) const cloud = new AssistantCloud({ baseUrl: process.env.NEXT_PUBLIC_ASSISTANT_BASE_URL, authToken: async () => session?.accessToken, }); // API Key (server-side) const cloud = new AssistantCloud({ baseUrl: process.env.ASSISTANT_BASE_URL, apiKey: process.env.ASSISTANT_API_KEY, userId: user.id, workspaceId: user.workspaceId, }); // Anonymous (public apps) const cloud = new AssistantCloud({ baseUrl: process.env.NEXT_PUBLIC_ASSISTANT_BASE_URL, anonymous: true, });

Cloud API

// Thread operations const threads = await cloud.threads.list(); await cloud.threads.create({ title: "New Chat" }); await cloud.threads.update(threadId, { title: "Updated" }); await cloud.threads.delete(threadId); // Message operations const messages = await cloud.threads.messages(threadId).list(); // File uploads const { signedUrl, publicUrl } = await cloud.files.generatePresignedUploadUrl({ filename: "document.pdf", }); await fetch(signedUrl, { method: "PUT", body: file });

Environment Variables

NEXT_PUBLIC_ASSISTANT_BASE_URL=https://api.assistant-ui.com ASSISTANT_API_KEY=your-api-key # Server-side only

Common Gotchas

Threads not persisting

  • Pass cloud to runtime
  • Check authentication

Auth errors

  • Verify authToken returns valid token
  • Check baseUrl is correct
5-Dim Analysis
Clarity8/10
Novelty6/10
Utility9/10
Completeness8/10
Maintainability7/10
Pros & Cons

Pros

  • Supports multiple authentication methods
  • Facilitates file uploads and thread management
  • Easy integration with existing chat systems

Cons

  • Requires environment variable setup
  • Potential for authentication errors if misconfigured
  • Limited documentation on advanced features

Related Skills

pytorch

S
toolCode Lib
92/ 100

“It's the Swiss Army knife of deep learning, but good luck figuring out which of the 47 installation methods is the one that won't break your system.”

agno

S
toolCode Lib
90/ 100

“It promises to be the Kubernetes for agents, but let's see if developers have the patience to learn yet another orchestration layer.”

nuxt-skills

S
toolCo-Pilot
90/ 100

“It's essentially a well-organized cheat sheet that turns your AI assistant into a Nuxt framework parrot.”

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

Copyright belongs to the original author assistant-ui.