@krytabo/ai-chat-core
v0.1.2
Published
Framework-agnostic core for AI Chat WebSocket communication.
Readme
@krytabo/ai-chat-core
Framework-agnostic core for AI Chat WebSocket communication.
Install
yarn add @krytabo/ai-chat-coreUsage
import { VoiceAgentClient } from "@krytabo/ai-chat-core";
const client = new VoiceAgentClient({
basePath: "/ws/audio",
// host: "your-host",
// port: 8000,
// url: "wss://example.com/ws/audio"
});
client.on("state_update", (payload) => {
console.log(payload.state);
});
client.on("text", (payload) => {
console.log(payload.source, payload.text);
});
client.on("audio", (buffer) => {
console.log("tts audio", buffer.byteLength);
});
client.connect();
client.sendText("hello");Supported Events
- state_update
- text
- trace
- llm_delta
- agent_response
- audio
- tts_stop
- error
