@camelai/run-vue

Vue bindings for chatting with agents on camelRun.
2,258 2
Install
npm install @camelai/run-vue
Latest Version:0.22.1
Vue:3
License:MIT
Last Updated:Oct 23, 2026
Links: GitHub  ·  npm
Maintainer: camelai

@camelai/run-vue

Vue 3 bindings for a chat with an agent on camelRun, through your server's route (createAgentHandler from @camelai/run/server; see the Frontend guide).

<script setup lang="ts">
import { ref } from "vue";
import { useAgentChat } from "@camelai/run-vue";

const { messages, status, send, stop } = useAgentChat({ endpoint: "/api/agent" });
const text = ref("");
</script>

<template>
  <div v-for="message in messages" :key="message.id">
    <p v-if="message.role === 'user'">{{ message.text }}</p>
    <template v-else v-for="part in message.parts" :key="part.id">
      <p v-if="part.type === 'text'">{{ part.text }}</p>
      <small v-else-if="part.type === 'tool'">{{ part.name }}: {{ part.state }}</small>
    </template>
  </div>
  <form @submit.prevent="send(text); text = ''"><input v-model="text" /><button>Send</button></form>
  <button v-if="status === 'streaming'" @click="stop()">Stop</button>
</template>

useAgentChat(options | chat) returns refs (messages, status, inputs, error, hasOlder, snapshot) and actions (send, answer, decline, stop, retry, loadOlder, fileUrl); the chat is connected until the component unmounts. provideAgentChat / useAgent share one chat with descendants. Render markdown with parseMarkdown from @camelai/run/markdown.

Version History

Version Released License
0.22.1 MIT
0.22.0 MIT
0.21.0 MIT
0.20.0 MIT
0.19.0 MIT