JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11281
  • Score
    100M100P100Q134671F
  • License MIT

React Native bindings for assistant-ui

Package Exports

  • @assistant-ui/react-native
  • @assistant-ui/react-native/internal

Readme

@assistant-ui/react-native

npm version npm downloads GitHub stars License

React Native bindings for assistant-ui. Native primitives for Thread, Composer, Message, and ThreadList that share the same runtime and adapters as @assistant-ui/react.

Installation

npm install @assistant-ui/react-native

Usage

import {
  AssistantRuntimeProvider,
  useLocalRuntime,
  type ChatModelAdapter,
} from "@assistant-ui/react-native";

const adapter: ChatModelAdapter = {
  async *run({ messages }) {
    yield { content: [{ type: "text", text: "Hello!" }] };
  },
};

export function App() {
  const runtime = useLocalRuntime(adapter);
  return (
    <AssistantRuntimeProvider runtime={runtime}>
      {/* Thread, Composer, Message primitives */}
    </AssistantRuntimeProvider>
  );
}

Documentation

Full primitives, hooks, and adapter reference at assistant-ui.com/docs/react-native.

For other platforms