Socket
Book a DemoInstallSign in
Socket

flowise-sdk

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flowise-sdk

Flowise SDK for streaming API responses.

latest
npmnpm
Version
1.0.9
Version published
Weekly downloads
1K
15.03%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

flowise

FAQs

Package last updated on 23 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts