๐Ÿ“ฆ FlowiseAI / FlowiseSDK

โ˜… 17 stars โ‘‚ 17 forks ๐Ÿ‘ 17 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/FlowiseAI/FlowiseSDK.git
HTTPS git clone https://github.com/FlowiseAI/FlowiseSDK.git
SSH git clone git@github.com:FlowiseAI/FlowiseSDK.git
CLI gh repo clone FlowiseAI/FlowiseSDK
Henry Henry make api key available in constructor 56df09a 1 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ examples
๐Ÿ“ src
๐Ÿ“ tests
๐Ÿ“„ .eslintrc.js
๐Ÿ“„ .gitignore
๐Ÿ“„ .npmignore
๐Ÿ“„ .prettierrc
๐Ÿ“„ jest.config.js
๐Ÿ“„ LICENSE.md
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ tsconfig.json
๐Ÿ“„ README.md

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>)

  • baseUrl: Optional. The base URL for the Flowise API. Defaults to 'http://localhost:3000'
  • apiKey: Optional. The API Key used to access the chatflow

Methods

createPrediction(params: PredictionParams)

Creates a new prediction.

  • params: An object containing the following properties:
  • chatflowId: string - Chatflow ID to execute prediction
  • question: string - The question to ask.
  • streaming: boolean (optional) - Whether to stream the response.
  • chatId: string (optional) - Chat ID of the session
  • overrideConfig: object (optional) - Override configuration
  • history: array (optional) - Array of prepended messages

License

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