FlowiseAI / FlowiseSDK

MIT License
3 stars 1 forks source link

Flowise SDK

A TypeScript SDK for interacting with the Flowise API.

Installation

npm install flowise-sdk

Usage

import { FlowiseClient } from 'flowise-sdk';

const flowise = new FlowiseClient({ baseUrl: 'http://localhost:3000' });

async function main() {
  const completion = await flowise.createPrediction({
    chatflowId: '<id>',
    question: "hello",
    streaming: true
  });

  for await (const chunk of completion) {
    console.log(chunk);
  }
}

main();

API Reference

FlowiseClient

The main class for interacting with the Flowise API.

Constructor

new FlowiseClient(baseUrl?: <your-base-url>, apiKey: <chatflow-apikey>)

Methods

createPrediction(params: PredictionParams)

Creates a new prediction.

License

This project is licensed under the MIT License - see the LICENSE file for details.