examples/ts-vue-chat
| Name | Last commit message | Last commit date |
|---|---|---|
| .. | ||
README.md
TanStack AI - Vue Chat Example#
A Vue 3 chat application demonstrating the use of @tanstack/ai-vue.
Setup#
- Copy
env.exampleto.envand add your API keys:
cp env.example .env
- Install dependencies:
pnpm install
- Start the development server:
pnpm dev
- Open http://localhost:5173 in your browser.
Features#
- Real-time streaming chat with multiple AI providers
- Support for OpenAI, Anthropic, Gemini, and Ollama
- Client-side and server-side tools
- Tool approval workflow
- Guitar recommendation demo
Project Structure#
src/
├── main.ts # App entry point
├── App.vue # Root component
├── router.ts # Vue Router setup
├── styles.css # Global styles
├── components/ # UI components
│ ├── Header.vue
│ ├── ChatInput.vue
│ ├── Messages.vue
│ ├── ThinkingPart.vue
│ └── GuitarRecommendation.vue
├── lib/ # Utilities
│ ├── model-selection.ts
│ └── guitar-tools.ts
├── data/ # Example data
│ └── guitars.ts
└── views/ # Page components
├── ChatView.vue
└── GuitarDetailView.vue
Tech Stack#
- Vue 3 with Composition API
- TypeScript
- Vite
- Tailwind CSS
- @tanstack/ai-vue