1.2.3 • Published 7 months ago

openai-text-splitter v1.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

OpenAI Text Splitter

Openai prompt splitter. Dividing large texts into manageable parts for processing with OpenAI APIs. A library inspired by chatgpt-prompt-splitter to divide large texts into smaller parts for efficient processing with OpenAI APIs.

Installation

  npm install openai-text-splitter

Usage

Arguments

ArgumentDefaultDescription
textrequiredThe input text to be split into parts.
textChunkLength20The maximum length of each character chunk to process.
tokenLimitPerPrompt400The token limit per prompt for OpenAI API.

Node: Configure textChunkLength and tokenLimitPerPrompt according to content you are processing.

import {splitTextForOpenAI} from 'openai-text-splitter';

const text = 'Your large text here...';
const textChunkLength = 500;
const tokenLimitPerPrompt = 2048;

const messages = splitTextForOpenAI(text, {
  textChunkLength,
  tokenLimitPerPrompt,
});
1.2.3

7 months ago

1.2.2

7 months ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago