AgentFlow JavaScript client for browser and Node.js
npm install @syncly/agentflow
import { AgentFlow } from "@syncly/agentflow"; const client = new AgentFlow({ endpoint: "http://localhost:8000", token: "your-auth-token", });
const response = await client.chat("Hello!", { agent: "MainAgent" }); console.log(response);
const stream = client.chatStream("Hello!", { agent: "MainAgent" }); for await (const event of stream) { if (event.type === "DELTA") { process.stdout.write(event.delta); } }
const results = await client.knowledgeBases.search("kb_123", { query: "How does billing work?", top_k: 5, });
const conversations = await client.conversations.list(); const messages = await client.conversations.messages("conv_abc123");