A powerful and flexible React library for integrating multiple AI assistants (OpenAI, Google Gemini, and Ollama) into your applications.
- 🤖 Support for multiple AI providers:
- OpenAI (GPT models)
- Google Gemini
- Ollama (local AI models)
- 🔄 Streaming responses
- 🎯 Function calling support
- 🎤 Audio-to-text conversion
- 🖼️ Image processing capabilities
- 🔌 Easy-to-use React hooks
- 📝 Type-safe APIs
npm install @react-ai-assist/core
The following peer dependencies are required:
{
"react": "^18 || ^19",
"@langchain/core": "^0.3.26",
"@langchain/google-genai": "^0.1.6",
"@langchain/ollama": "^0.1.4",
"@langchain/openai": "^0.3.16"
}
use with @react-ai-assist/cli
to create chat UI with AI Assist.
npx @react-ai-assist/cli
Feature | OpenAI | Ollama | |
---|---|---|---|
Text Chat | ✅ | ✅ | ✅ |
Image Processing | ✅ | ✅ | ✅ |
Audio to Text | ✅ | ✅ | ❌ |
Function Calling | ✅ | ✅ | ✅ |
Streaming | ✅ | ✅ | ✅ |
The main hook for interacting with AI assistants. See UseAssistantProps documentation for detailed configuration options.
const assistant = useAssistant({
name: string;
modelProvider: string;
model: string;
apiKey: string;
version: string;
baseUrl?: string;
description?: string;
temperature?: number;
topP?: number;
instructions: string;
functions?: Array<FunctionDefinition>;
});
MIT © Xun Li